Skip to content

Commit

Permalink
Update Acquisition.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschumacher authored Feb 29, 2024
1 parent 2fdcff5 commit ff2e425
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/client/julia/src/Acquisition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ function readFrames(rpu::Union{RedPitaya,RedPitayaCluster, RedPitayaClusterView}
return data
end

"""
convertSamplesToFrames(rpu::Union{RedPitayaCluster, RedPitayaClusterView}, samples, numChan, numSampPerPeriod, numPeriods, numFrames, numBlockAverages=1, numPeriodsPerPatch=1)
Converts a given set of samples to frames.
See [`readFrames`](@ref)
"""
function convertSamplesToFrames(rpu::Union{RedPitaya, RedPitayaCluster, RedPitayaClusterView}, samples, numChan, numSampPerPeriod, numPeriods, numFrames, numBlockAverages=1, numPeriodsPerPatch=1)
frames = convertSamplesToFrames(samples, numChan, numSampPerPeriod, numPeriods, numFrames, numBlockAverages, numPeriodsPerPatch)
calibs = [x.calib for x in rpu]
Expand All @@ -220,6 +227,13 @@ function convertSamplesToFrames(rpu::Union{RedPitaya, RedPitayaCluster, RedPitay
return frames
end

"""
convertSamplesToFrames(samples, numChan, numSampPerPeriod, numPeriods, numFrames, numBlockAverages=1, numPeriodsPerPatch=1)
Converts a given set of samples to frames.
See [`readFrames`](@ref)
"""
function convertSamplesToFrames(samples, numChan, numSampPerPeriod, numPeriods, numFrames, numBlockAverages=1, numPeriodsPerPatch=1)
if rem(numSampPerPeriod,numBlockAverages) != 0
error("block averages has to be a divider of numSampPerPeriod")
Expand All @@ -230,6 +244,13 @@ function convertSamplesToFrames(samples, numChan, numSampPerPeriod, numPeriods,
return frames
end

"""
convertSamplesToFrames!(rpu::Union{RedPitayaCluster, RedPitayaClusterView}, samples, frames, numChan, numSampPerPeriod, numPeriods, numFrames, numTrueSampPerPeriod, numBlockAverages=1, numPeriodsPerPatch=1)
Converts a given set of samples to frames in-place.
See [`readFrames`](@ref)
"""
function convertSamplesToFrames!(rpu::Union{RedPitaya, RedPitayaCluster, RedPitayaClusterView}, samples, frames, numChan, numSampPerPeriod, numPeriods, numFrames, numTrueSampPerPeriod, numBlockAverages=1, numPeriodsPerPatch=1)
convertSamplesToFrames!(samples, frames, numChan, numSampPerPeriod, numPeriods, numFrames, numTrueSampPerPeriod, numBlockAverages, numPeriodsPerPatch)
calibs = [x.calib for x in rpu]
Expand All @@ -240,6 +261,13 @@ function convertSamplesToFrames!(rpu::Union{RedPitaya, RedPitayaCluster, RedPita
end
end

"""
convertSamplesToFrames!(samples, frames, numChan, numSampPerPeriod, numPeriods, numFrames, numTrueSampPerPeriod, numBlockAverages=1, numPeriodsPerPatch=1)
Converts a given set of samples to frames in-place.
See [`readFrames`](@ref)
"""
function convertSamplesToFrames!(samples, frames, numChan, numSampPerPeriod, numPeriods, numFrames, numTrueSampPerPeriod, numBlockAverages=1, numPeriodsPerPatch=1)
temp = reshape(samples, numChan, numSampPerPeriod, numPeriods, numFrames)
for d = 1:div(numChan,2)
Expand Down Expand Up @@ -312,4 +340,4 @@ function convertSamplesToPeriods!(samples, periods, numChan, numSampPerPeriod, n
periods[:,2*d-1,:] = utmp2[1,:,1,:]
periods[:,2*d,:] = utmp2[2,:,1,:]
end
end
end

0 comments on commit ff2e425

Please sign in to comment.