Skip to content

Commit

Permalink
remove differentiation for DC values in TF correction
Browse files Browse the repository at this point in the history
  • Loading branch information
jusack committed Sep 9, 2024
1 parent c47eaee commit c8e7504
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/Measurements.jl
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,8 @@ function getMeasurements(f::MPIFile, neglectBGFrames=true;

J = size(data,1)
dataF = rfft(data, 1)
dataF[2:end,:,:,:] ./= tf[2:end,:,:,:]

if all(tf[1,:,:,:] .!= 0) && !any(isnan.(tf[1,:,:,:]))
dataF[1,:,:,:] ./= tf[1,:,:,:]
end
dataF ./= tf
dataF[isnan.(dataF)] .= zero(eltype(dataF))

@warn "This measurement has been corrected with a Transfer Function. Name of TF: $(rxTransferFunctionFileName(f))"
if !isnothing(inductionFactor)
Expand Down Expand Up @@ -335,11 +332,7 @@ function getMeasurementsFD(f::MPIFile, args...;
inductionFactor = ones(Float64, rxNumChannels(f))
end

data[2:end,:,:,:] ./= tf[2:end,:,:,:]

if all(tf[1,:,:,:] .!= 0) && !any(isnan.(tf[1,:,:,:]))
data[1,:,:,:] ./= tf[1,:,:,:]
end
data ./= tf

@warn "This measurement has been corrected with a Transfer Function. Name of TF: $(rxTransferFunctionFileName(f))"
if !isnothing(inductionFactor)
Expand Down

0 comments on commit c8e7504

Please sign in to comment.