From ff2e425cbdd81665e1dabf3e89af5598f204849a Mon Sep 17 00:00:00 2001 From: Jonas Schumacher Date: Thu, 29 Feb 2024 11:21:55 +0100 Subject: [PATCH] Update Acquisition.jl --- src/client/julia/src/Acquisition.jl | 30 ++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/client/julia/src/Acquisition.jl b/src/client/julia/src/Acquisition.jl index a33df88f..db43f4c0 100644 --- a/src/client/julia/src/Acquisition.jl +++ b/src/client/julia/src/Acquisition.jl @@ -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] @@ -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") @@ -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] @@ -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) @@ -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 \ No newline at end of file +end