API
Modules
Types and constants
LegendDSP.DSPConfig
LegendDSP.IntersectMaximum
LegendDSP.ModifiedSincFilter
LegendDSP.MovingWindowFilter
LegendDSP.MovingWindowMultiFilter
LegendDSP.MultiIntersect
LegendDSP.WeightedSavitzkyGolayFilter
LegendDSP.WhittakerHendersonFilter
Functions and macros
LegendDSP._create_dsp_config
LegendDSP.banded_cholesky_solve!
LegendDSP.choleskyL!
LegendDSP.dsp_cusp_ft_optimization
LegendDSP.dsp_cusp_rt_optimization
LegendDSP.dsp_decay_times
LegendDSP.dsp_icpc
LegendDSP.dsp_icpc_compressed
LegendDSP.dsp_puls
LegendDSP.dsp_qc_flt_optimization
LegendDSP.dsp_qc_flt_optimization_compressed
LegendDSP.dsp_qdrift_flt_optimization
LegendDSP.dsp_sg_optimization
LegendDSP.dsp_sg_optimization_compressed
LegendDSP.dsp_sipm
LegendDSP.dsp_sipm_compressed
LegendDSP.dsp_sipm_thresholds_compressed
LegendDSP.dsp_trap_ft_optimization
LegendDSP.dsp_trap_rt_optimization
LegendDSP.dsp_zac_ft_optimization
LegendDSP.dsp_zac_rt_optimization
LegendDSP.extrema3points
LegendDSP.get_intracePileUp
LegendDSP.get_qc_classifier
LegendDSP.get_qc_classifier_compressed
LegendDSP.get_qc_ml_func
LegendDSP.get_qdrift
LegendDSP.get_t0
LegendDSP.get_threshold
LegendDSP.get_wvf_maximum
LegendDSP.makeFitWeights
LegendDSP.makeIPlusLambdaDprimeD
LegendDSP.saturation
LegendDSP.tailstats
LegendDSP.weighted_linear_reg
Documentation
LegendDSP.LegendDSP
— ModuleLegendDSP
Template for Julia packages.
LegendDSP.DSPConfig
— TypeDSPConfig{T <: Real}
Configuration parameters for DSP algorithms.
Fields
enc_pickoff::Quantity{<:T}
: pick-off time for ENC noise calculationsbl_window::ClosedInterval{Quantity{<:T}}
: fit window for basline extractiontail_window::ClosedInterval{Quantity{<:T}}
: fit window for decay time extractioninTraceCut_std_threshold::T
: in-trace pile-up rejector threshold in standard deviationst0_threshold::T
: ADC threshold for t0 determinatione_grid_rt_trap::StepRangeLen{Quantity{<:T}}
: rise time grid scan range for trapezoidal filtere_grid_ft_trap::StepRangeLen{Quantity{<:T}}
: flat-top time grid scan range for trapezoidal filtere_grid_rt_zac::StepRangeLen{Quantity{<:T}}
: rise time grid scan range for ZAC filtere_grid_ft_zac::StepRangeLen{Quantity{<:T}}
: flat-top time grid scan range for ZAC filtere_grid_rt_cusp::StepRangeLen{Quantity{<:T}}
: rise time grid scan range for CUSP filtere_grid_ft_cusp::StepRangeLen{Quantity{<:T}}
: flat-top time grid scan range for CUSP filtera_grid_rt_sg::StepRangeLen{Quantity{<:T}}
: window length grid scan range for SG filter
Examples
using LegendDSP
using LegendDataManagement
l200 = LegendData(:l200)
filekey = start_filekey(l200, (:p03, :r000, :cal))
dsp_config = DSPConfig(dataprod_config(l200).dsp(filekey).default)
LegendDSP.IntersectMaximum
— Typestruct IntersectMaximum <: Function
Finds the intersects of a Y with a threshold and picking the maximum in a given time window. Constructors:
IntersectMaximum(; fields...)
Fields:
mintot::Union{Unitful.Quantity{<:var"#s10"}, var"#s10"} where var"#s10"<:Real
: minimum time-over-thresholdmaxtot::Union{Unitful.Quantity{<:var"#s10"}, var"#s10"} where var"#s10"<:Real
: maximum time-over-threshold for max to appear
LegendDSP.ModifiedSincFilter
— Typestruct ModifiedSincFilter{T<:RealQuantity} <: AbstractRadFIRFilter{}
A Modified-Sinc filter Working example
using RadiationDetectorSignals
using Unitful
n = 600
noise = 1.
t = range(0u"μs", 20u"μs", 2*n)
signal = vcat(zeros(n), 10*ones(n)) + (noise*rand(2*n) .- noise/2)
wf = RDWaveform(t, signal)
# define filter parameters and filter
flt = ModifiedSincFilter(d=4, m=1u"μs")
# apply filter to signal
wf_new = flt(wf)
Constructors:
ModifiedSincFilter(; fields...)
Fields:
d::Int64
: degree of the filter determining the number of extrema in the kernelm::Union{Real, Unitful.AbstractQuantity{<:Real}}
: half-width of the kernel
LegendDSP.MovingWindowFilter
— Typestruct MovingWindowFilter <: AbstractRadFIRFilter
apply left moving average window to signal. The exact computations are:
yₙ = yₙ₋₁ + (xₙ - x₁)/l, for n ∈ {1, …, l}
yₙ = yₙ₋₁ + (xₙ - xₙ₋ₗ)/l, for n ∈ {l+1, …, L}
Constructors:
MovingWindowFilter(; fields...)
Fields:
length::Union{Unitful.Quantity{<:var"#s10"}, var"#s10"} where var"#s10"<:Real
: length of the moving average window
LegendDSP.MovingWindowMultiFilter
— Typestruct MovingWindowMultiFilter <: AbstractRadFIRFilter
apply left and right moving average windows to signal. Working example:
using RadiationDetectorSignals
using Unitful
signal = rand(100)
t = range(0u"ms", 20u"ms", 100)
wf = RDWaveform(t, signal)
flt = MovingWindowMultiFilter(1u"ms")
wf_new = flt(wf)
Constructors:
MovingWindowMultiFilter(; fields...)
Fields:
length::Union{Unitful.Quantity{<:var"#s10"}, var"#s10"} where var"#s10"<:Real
: size of the moving average window
LegendDSP.MultiIntersect
— Typestruct MultiIntersect <: Function Finds the x values at which a signal exceeds the provided threshold_ratios
the first time. Constructors: * MultiIntersect(; fields...)
Fields:
threshold_ratios::Vector{Float64}
: ratios which determine the thresholdsmintot::Union{Unitful.Quantity{<:var"#s10"}, var"#s10"} where var"#s10"<:Real
: minimum time-over-thresholdn::Int64
: half window length of polynomial fitd::Int64
: degree of polynomialsampling_rate::Int64
: upsampling rate
LegendDSP.WeightedSavitzkyGolayFilter
— Typestruct WeightedSavitzkyGolayFilter{T<:RealQuantity} <: AbstractRadFIRFilter
A Weighted-Savitzky-Golay filter. Working example:
using RadiationDetectorSignals
using Unitful
n = 600
noise = 1.
t = range(0u"μs", 20u"μs", 2*n)
signal = vcat(zeros(n), 10*ones(n)) + (noise*rand(2*n) .- noise/2)
wf = RDWaveform(t, signal)
# define filter parameters and filter
flt = WeightedSavitzkyGolayFilter(length=1u"μs", degree=3, weightType=2)
# apply filter to signal
wf_new = flt(wf)
Constructors:
WeightedSavitzkyGolayFilter(; fields...)
Fields:
length::Union{Real, Unitful.AbstractQuantity{<:Real}}
: total filter lengthdegree::Int64
: Polynomial degreeweightType::Int64
: weight function to use
LegendDSP.WhittakerHendersonFilter
— Typestruct WhittakerHendersonFilter <: AbstractRadSigFilter{LinearFiltering}
A Whittaker-Henderson filter. Working example: ```julia using RadiationDetectorSignals using Unitful
n = 600 noise = 1. t = range(0u"μs", 20u"μs", 2n) signal = vcat(zeros(n), 10ones(n)) + (noiserand(2n) .- noise/2) wf = RDWaveform(t, signal)
define filter parameters and filter
flt = WhittakerHendersonFilter(p=3, λ=4)
apply filter to signal
wf_new = flt(wf)
LegendDSP._create_dsp_config
— Method_create_dsp_config(dsp_metadata::PropDicts.PropDict)
Create a DSPConfig
from a PropDict
of DSP metadata.
Arguments
dsp_metadata::PropDicts.PropDict
: DSP metadata
Returns
dsp_config::DSPConfig
: DSP configuration
LegendDSP.banded_cholesky_solve!
— Methodbanded_cholesky_solve!(x::AbstractVector, A::AbstractMatrix, y::AbstractVector)
solve the linear equation AA'x = y
and store the result in x
, where A
is the cholesky decomposition of a banded centro symmetric matrix. A[1, i]
is the diagonal, A[2, i]
is the first subdiagonal and so on.
LegendDSP.choleskyL!
— MethodcholeskyL!(b::AbstractMatrix{T})
inplace cholesky decomposition of a banded symmetric matrix, where b[1, i] contains the diagonal elements, b[2, i] the elements of the first subdiagonal and so on.
LegendDSP.dsp_cusp_ft_optimization
— Methoddsp_cusp_ft_optimization(wvfs::ArrayOfRDWaveforms, config::DSPConfig, τ::Quantity{T}, rt::Quantity{T}) where T<:Real
Get energy grid values for given CUSP grid rise times while varying the flat-top time.
Returns
- `e_grid`: Array energy values for the given CUSP rise time grid at a given flat-top time grid.
LegendDSP.dsp_cusp_rt_optimization
— Methoddsp_cusp_rt_optimization(wvfs::ArrayOfRDWaveforms, config::DSPConfig, τ::Quantity{T},; ft::Quantity{T}=4.0u"µs") where T<:Real
Get ENC noise grid values for given CUSP grid rise times.
Returns
- `enc_cusp_grid`: Array ENC noise values for the given CUSP rise time grid
LegendDSP.dsp_decay_times
— Methoddsp_decay_times(wvfs::ArrayOfRDWaveforms, bl_window::ClosedInterval{<:Unitful.Time{<:T}}, tail_window::ClosedInterval{<:Unitful.Time{<:T}})
dsp_decay_times(wvfs::ArrayOfRDWaveforms, config::DSPConfig)
Get statistics on the logarhithmic of the tail of the wvfs
in the interval tail_window
.
Returns
τ
: decay time in µs
LegendDSP.dsp_icpc
— Methoddsp_icpc(data::Q, config::DSPConfig, τ::Quantity{T}, pars_filter::PropDict) where {Q <: Table, T<:Real}
DSP for ICPC detectors. It needs the decay time τ
of the detector and the filter parameters pars_filter
for the optimal filter parameters for the Trap, CUSP and ZAC filter.
Input data
The input data is a table with the following columns:
waveform
: waveform databaseline
: baseline from FADCtimestamp
: timestamp from FADCeventnumber
: event ID from FADCdaqenergy
: energy from FADC
Output data
The output data is a table with the following columns:
blmean
: baseline meanblsigma
: baseline sigmablslope
: baseline slopebloffset
: baseline offsettailmean
: tail mean after PZ correctiontailsigma
: tail sigma after PZ correctiontailslope
: tail slope after PZ correctiontailoffset
: tail offset after PZ correctiont0
: start time of waveform driftt10
: timepoint of 10% of waveform maximumt50
: timepoint of 50% of waveform maximumt80
: timepoint of 80% of waveform maximumt90
: timepoint of 90% of waveform maximumt99
: timepoint of 99% of waveform maximumt50_current
: timepoint of current rise to 50% of maximumtail_τ
: tail decay timetail_mean
: tail mean before PZ correctiontail_sigma
: tail sigma before PZ correctione_max
: maximum of waveforme_min
: minimum of waveforme_10410
: energy of waveform with trapezoidal filter of 10µs rise time with 4µs flat-tope_313
: energy of waveform with trapezoidal filter of 3µs rise time with 1µs flat-tope_10410_inv
: maximum of inverted waveform with trapezoidal filter of 10µs rise time with 4µs flat-tope_313_inv
: maximum of inverted waveform with trapezoidal filter of 3µs rise time with 1µs flat-topt0_inv
: start time of inverted waveform drifte_trap
: energy of waveform with trapezoidal filter of optimized rise and flat-top timee_cusp
: energy of waveform with CUSP filter of optimized rise and flat-top timee_zac
: energy of waveform with ZAC filter of optimized rise and flat-top timeqdrift
: Q-drift parameterlq
: LQ parametera
: current maximum with optimal Savitzky-Golay filter length parameterblfc
: baseline from FADCtimestamp
: timestamp from FADCeventID_fadc
: event ID from FADCe_fc
: energy from FADCpretrace_diff
: difference between first sample and baseline meandrift_time
: drift time between t0 and 90% of waveform maximuminTrace_intersect
: position of in-trace pile-upinTrace_n
: multiplicity of in-trace pile-upn_sat_low
: number of samples the waveform is saturated at low of FADC rangen_sat_high
: number of samples the waveform is saturated at high of FADC rangen_sat_low_cons
: number of consecutive samples the waveform is saturated at low of FADC rangen_sat_high_cons
: number of consecutive samples the waveform is saturated at high of FADC range
LegendDSP.dsp_icpc_compressed
— Methoddsp_icpc_compressed(data::Q, config::DSPConfig, τ::Quantity{T}, pars_filter::PropDict) where {Q <: Table, T<:Real}
DSP for ICPC detectors. It needs the decay time τ
of the detector and the filter parameters pars_filter
for the optimal filter parameters for the Trap, CUSP and ZAC filter.
Input data
The input data is a table with the following columns:
waveform
: waveform databaseline
: baseline from FADCtimestamp
: timestamp from FADCeventnumber
: event ID from FADCdaqenergy
: energy from FADC
Output data
The output data is a table with the following columns:
blmean
: baseline meanblsigma
: baseline sigmablslope
: baseline slopebloffset
: baseline offsettailmean
: tail mean after PZ correctiontailsigma
: tail sigma after PZ correctiontailslope
: tail slope after PZ correctiontailoffset
: tail offset after PZ correctiont0
: start time of waveform driftt10
: timepoint of 10% of waveform maximumt50
: timepoint of 50% of waveform maximumt80
: timepoint of 80% of waveform maximumt90
: timepoint of 90% of waveform maximumt99
: timepoint of 99% of waveform maximumt50_current
: timepoint of current rise to 50% of maximumtail_τ
: tail decay timetail_mean
: tail mean before PZ correctiontail_sigma
: tail sigma before PZ correctione_max
: maximum of waveforme_min
: minimum of waveforme_10410
: energy of waveform with trapezoidal filter of 10µs rise time with 4µs flat-tope_313
: energy of waveform with trapezoidal filter of 3µs rise time with 1µs flat-tope_10410_inv
: maximum of inverted waveform with trapezoidal filter of 10µs rise time with 4µs flat-tope_313_inv
: maximum of inverted waveform with trapezoidal filter of 3µs rise time with 1µs flat-topt0_inv
: start time of inverted waveform drifte_trap
: energy of waveform with trapezoidal filter of optimized rise and flat-top timee_cusp
: energy of waveform with CUSP filter of optimized rise and flat-top timee_zac
: energy of waveform with ZAC filter of optimized rise and flat-top timeqdrift
: Q-drift parameterlq
: LQ parametera
: current maximum with optimal Savitzky-Golay filter length parameterblfc
: baseline from FADCtimestamp
: timestamp from FADCeventID_fadc
: event ID from FADCe_fc
: energy from FADCpretrace_diff
: difference between first sample and baseline meandrift_time
: drift time between t0 and 90% of waveform maximuminTrace_intersect
: position of in-trace pile-upinTrace_n
: multiplicity of in-trace pile-upn_sat_low
: number of samples the waveform is saturated at low of FADC rangen_sat_high
: number of samples the waveform is saturated at high of FADC rangen_sat_low_cons
: number of consecutive samples the waveform is saturated at low of FADC rangen_sat_high_cons
: number of consecutive samples the waveform is saturated at high of FADC range
LegendDSP.dsp_puls
— Methoddsp_puls(data::Q, config::DSPConfig) where {Q <: Table}
DSP function for pulser processing.
Input data
The input data is a table with the following columns:
waveform
: waveform databaseline
: baseline datatimestamp
: timestamp dataeventnumber
: event number datadaqenergy
: energy data
Output data
The output data is a table with the following columns:
blmean
: baseline meanblsigma
: baseline sigmablslope
: baseline slopebloffset
: baseline offsett50
: timepoint of 50% of waveform maximume_max
: maximum of waveforme_10410
: energy of waveform with trapezoidal filter of 10µs rise time with 4µs flat-topblfc
: baseline from FADCtimestamp
: timestampeventID_fadc
: event number from FADCe_fc
: energy from FADC
LegendDSP.dsp_qc_flt_optimization
— Methoddsp_flt_optimization(wvfs::ArrayOfRDWaveforms, config::DSPConfig, τ::Unitful.Time{<:Real}, f_evaluate_qc::Function)
Get QC DSP for filter parameter optimization for a given waveform set.
LegendDSP.dsp_qc_flt_optimization_compressed
— Methoddsp_qc_flt_optimization_compressed(wvfs::ArrayOfRDWaveforms, config::DSPConfig, τ::Unitful.Time{<:Real}, f_evaluate_qc::Function)
Get QC DSP for filter parameter optimization for a given waveform set.
LegendDSP.dsp_qdrift_flt_optimization
— Methoddsp_qdrift_flt_optimization(wvfs::ArrayOfRDWaveforms, blmean::Vector{<:Real}, config::DSPConfig, τ::Unitful.Time{<:Real})
Get QDrift filter parameter optimization for a given waveform set.
LegendDSP.dsp_sg_optimization
— Methoddsp_sg_optimization(wvfs::ArrayOfRDWaveforms, config::DSPConfig, τ::Quantity{T}, pars_filter::PropDict) where T<:Real
Optimize the Savitzky-Golay filter parameters for a given waveform set.
Returns
- `aoe`: Array of efficiency values for the given Savitzky-Golay filter parameters
- `e`: Array of energy values for the given Savitzky-Golay filter parameters
- `blmean`: Baseline mean value
- `blslope`: Baseline slope value
LegendDSP.dsp_sg_optimization_compressed
— Methoddsp_sg_optimization_compressed(wvfs::ArrayOfRDWaveforms, config::DSPConfig, τ::Quantity{T}, pars_filter::PropDict) where T<:Real
Optimize the Savitzky-Golay filter parameters for a given waveform set.
Returns
- `aoe`: Array of efficiency values for the given Savitzky-Golay filter parameters
- `e`: Array of energy values for the given Savitzky-Golay filter parameters
- `blmean`: Baseline mean value
- `blslope`: Baseline slope value
LegendDSP.dsp_sipm
— Methoddsp_sipm(data::Q, config::PropDict, pars_threshold::PropDict)
DSP routine for SiPM data. It needs the threshold parameters from the threshold scan for the given SiPM channel as well as the discharge threshold parameters.
Input data
The input data is a table with the following columns:
waveform
: waveform databaseline
: baseline datatimestamp
: timestamp dataeventnumber
: event number datadaqenergy
: energy data
Output data
The output data is a table with the following columns:
blfc
: baseline from FADCtimestamp
: timestampeventID_fadc
: event number from FADCe_fc
: energy from FADCtrig_pos
: trigger positions from DSPtrig_max
: trigger maxima from DSPtrig_pos_DC
: trigger positions of dischargestrig_max_DC
: trigger maxima of discharges
LegendDSP.dsp_sipm_compressed
— Methoddsp_sipm_compressed(data::Q, config::PropDict, pars_threshold::PropDict)
DSP routine for SiPM data. It needs the threshold parameters from the threshold scan for the given SiPM channel as well as the discharge threshold parameters.
Input data
The input data is a table with the following columns:
waveform
: waveform databaseline
: baseline datatimestamp
: timestamp dataeventnumber
: event number datadaqenergy
: energy data
Output data
The output data is a table with the following columns:
blfc
: baseline from FADCtimestamp
: timestampeventID_fadc
: event number from FADCe_fc
: energy from FADCtrig_pos
: trigger positions from DSPtrig_max
: trigger maxima from DSPtrig_pos_DC
: trigger positions of dischargestrig_max_DC
: trigger maxima of discharges
LegendDSP.dsp_sipm_thresholds_compressed
— Methoddsp_sipm_thresholds_compressed(wvfs::ArrayOfRDWaveforms, config::PropDict)
This function calculates the baseline of the waveforms and the baseline of the waveforms with the sign flipped. The function is used to calculate the thresholds for the SiPMs.
Arguments
wvfs::ArrayOfRDWaveforms
: Array of RDWaveformsconfig::PropDict
: Configuration parameters
Returns
Table
: Table with the baseline of the waveforms and the baseline of the waveforms with the sign flipped
LegendDSP.dsp_trap_ft_optimization
— Methoddsp_trap_ft_optimization(wvfs::ArrayOfRDWaveforms, config::DSPConfig, τ::Quantity{T}, rt::Quantity{T}) where T<:Real
Get energy grid values for given trap grid rise times while varying the flat-top time.
Returns
- `e_grid`: Array energy values for the given trap rise time grid at a given flat-top time grid.
LegendDSP.dsp_trap_rt_optimization
— Methoddsp_trap_rt_optimization(wvfs::ArrayOfRDWaveforms, config::DSPConfig, τ::Quantity{T},; ft::Quantity{T}=4.0u"µs") where T<:Real
Get ENC noise grid values for given trap grid rise times.
Returns
- `enc_trap_grid`: Array ENC noise values for the given trap rise time grid
LegendDSP.dsp_zac_ft_optimization
— Methoddsp_zac_ft_optimization(wvfs::ArrayOfRDWaveforms, config::DSPConfig, τ::Quantity{T}, rt::Quantity{T}) where T<:Real
Get energy grid values for given ZAC grid rise times while varying the flat-top time.
Returns: - e_grid
: Array energy values for the given ZAC rise time grid at a given flat-top time grid.
LegendDSP.dsp_zac_rt_optimization
— Methoddsp_zac_rt_optimization(wvfs::ArrayOfRDWaveforms, config::DSPConfig, τ::Quantity{T},; ft::Quantity{T}=4.0u"µs") where T<:Real
Get ENC noise grid values for given ZAC grid rise times.
Returns
- `enc_zac_grid`: Array ENC noise values for the given ZAC rise time grid
LegendDSP.extrema3points
— Methodextrema3points(y1::T,y2::T,y3::T)::T where {T<:AbstractFloat}
Calculate the extrema of a parabola defined by three points.
LegendDSP.get_intracePileUp
— Methodget_intracePileUp(wvfs::ArrayOfRDWaveforms, sigma_threshold::Real, bl_window::ClosedInterval{<:Unitful.Time{<:Real}}; mintot::Unitful.Time=100.0u"ns")
Get position and multiplicity of in-trace pile-up as intersect of reversed derivative signal with threshold as multiple of std. The wvfs
have to be a current signal.
LegendDSP.get_qc_classifier
— Functionget_qc_classifier(wvfs::ArrayOfRDWaveforms, f_evaluate_qc::Function)
Get a classifier for quality cuts using the given waveforms and evaluation function which evulates a predefined SVM model.
LegendDSP.get_qc_classifier_compressed
— Functionget_qc_classifier_compressed(wvfs::ArrayOfRDWaveforms, f_evaluate_qc::Function)
get_qc_classifier_compressed(wvfs::ArrayOfRDWaveforms, f_evaluate_qc::Function, config::DSPConfig)
Get a classifier for quality cuts using the given waveforms and evaluation function which evulates a predefined SVM model.
LegendDSP.get_qc_ml_func
— Methodget_qc_ml_func(dwts_norm::Matrix{<:Real}, dc_labels::Vector{<:Real}, hyperparams::PropDict)
Create a function that takes a signal and returns the prediction using the given hyperparameters and discrete wavelet transforms.
LegendDSP.get_qdrift
— Methodget_qdrift(wvfs::ArrayOfRDWaveforms, t_start::Array{Unitful.Time{T}}, Δt::UnitRange{Unitful.Time{T}}; pol_power::Int=3, sign_est_length::Unitful.Time=100u"ns")
Get the Q-drift parameter for each waveform in wvfs
by integrating the waveform with gain = 1 and using a polynomial signal estimator of order pol_power
and length sign_est_length
to estimate the signal.
LegendDSP.get_t0
— Methodget_t0(wvfs_pz::ArrayOfRDWaveforms, t0_threshold::T) where T<:Real
Get t0 for each waveform in wvfs_pz
by using a fast asymetric trapezoidal filter and a fixed threshold at t0_threshold
. The filter is truncated to the range 0µs to 60µs where the Ge trigger is expected in FlashCam.
LegendDSP.get_threshold
— Methodget_threshold(wvfs::ArrayOfRDWaveforms, threshold::Array{T}) where T<:Real
Get threshold for each waveform in wvfs
by intersecting the waveform with a threshold
per waveform or globally.
LegendDSP.get_wvf_maximum
— Functionget_wvf_maximum(signal::AbstractSamples, start::Real, stop::Real)
get_wvf_maximum(signal::RDWaveform, start::RealQuantity, stop::RealQuantity)
Get the maximum of a signal
in the interval (start
,stop
) by quadaratic interpolation.
LegendDSP.makeFitWeights
— MethodmakeFitWeights(d::Int, m::Int) where {U}
return the weights for the linear fit user for linear extrapolation at at the right boundary.
LegendDSP.makeIPlusLambdaDprimeD
— MethodmakeIPlusLambdaDprimeD(λ::T, p::Int, N::Int) where {T}
build the centro symmetric banded matrix which needs to be inverted later: I + λ*D'D D is the finite difference matrix of order p
.
LegendDSP.saturation
— Functiontailstats(signal::AbstractSamples, start::Real, stop::Real)
tailstats(signal::RDWaveform, start::RealQuantity, stop::RealQuantity)
Get statistics on the logarhithmic of the tail of a signal
in the interval (start
,stop
).
LegendDSP.tailstats
— Functiontailstats(signal::AbstractSamples, start::Real, stop::Real)
tailstats(signal::RDWaveform, start::RealQuantity, stop::RealQuantity)
Get statistics on the logarhithmic of the tail of a signal
in the interval (start
,stop
) by fitting a linear function.
LegendDSP.weighted_linear_reg
— Methodweighted_linear_reg(w::AbstractVector, y::AbstractVector)
Do a weighted linear regression of the data y
with weights w
and return the offset and slope. its assumed that x is a range from 1 to length(y)