Utilities
AsymptoticPDC.detrend — Functiondetrend(signal::AbstractVector, order::Int=1; verbose::Bool=true)Detrend a signal by removing polynomial trend of order p using build in least squares .
Args:
signalData Vector containing te signalorder=1: order of polynomial
Return:
- (detrended_signal, coefs): The detrended signal and the estimated coefficients from order 0 to p
Examples
julia> signal = sin.([1:100;]) + 0.03 .* [1:100;] .+ 1
julia> _, coefficients = detrend(signal)
julia> coefficients
2-element Vector{Float64}:
1.0583465387418984
0.028819440616267268detrend(signals::AbstractArray, order::Int = 1; verbose = false, dims::Int = 1)Deterend an array signals along dimension dims.