Estimation - parametric estimation functions

DSP.Estimation.espritFunction
esprit(x::AbstractArray, M::Integer, p::Integer, Fs::Real=1.0)

ESPRIT [Roy1986] algorithm for frequency estimation. Estimation of Signal Parameters via Rotational Invariance Techniques

Given a signal x of length N that is the sum of p complex exponentials (cisoids) with unknown constant amplitudes and phases, estimate and return an array of the p frequencies.

\[x(t)=\sum_{i=1}^p A_ie^{j2\pi f_i t}\]

where $A_i$ and $f_i$ are the amplitude and frequency of the $i$th cisoid.

Arguments

  • x::AbstractArray: complex length N signal array
  • M::Integer: size of correlation matrix, must be <= N. The signal subspace is computed from the SVD of an M x (N-M+1) signal matrix formed from N-M+1 length-M shifts of the signal x in its columns. For best performance for 1 cisoid, use M = (N+1)/3 (according to van der Veen and Leus). For faster execution (due to smaller SVD), use small M or small N-M
  • p::Integer: number of complex exponentials/frequencies to estimate.
  • Fs::Float64: sampling frequency, in Hz.

Returns

length p real array of frequencies in units of Hz.

Examples

Suppose a signal $x(t)=2e^{j2\pi(2500)t} + 5e^{j2\pi(400)t}$ is corrupted by noise. The goal is to retrieve the frequencies in the signal. Let the sampling frequency be $8kHz$.

julia> Fs = 8000;                 # sampling frequency (Hz)
julia> true_freq = [2500 400];    # true frequencies (Hz)
julia> t = collect(1:Fs)/Fs;      # time vector
julia> x = 2exp.(1im*2π*true_freq[1]*t) + 5exp.(1im*2π*true_freq[2]*t); # original signal x

Add gaussian noise in complex form to the signal $x$ to mimic noise corruption.

julia> noise = randn(Fs, 2)*[1; 1im];    # complex random noise
julia> x += noise;                       # add noise to signal x

Run the ESPRIT algorithm to retrieve approximate frequencies.

julia> M = 5;    # window length of 5
julia> p = 2;    # 2 frequencies to estimate
julia> esprit(x, M, p, Fs)
2-element Vector{Float64}:
2502.2704154274957
399.8420984461712
source
DSP.Estimation.jacobsenFunction
jacobsen(x::AbstractVector, Fs::Real = 1.0)

Estimate the largest frequency in the complex signal x using Jacobsen's algorithm [Jacobsen2007]. Argument Fs is the sampling frequency. All frequencies are expressed in Hz.

If the signal x is real, the estimated frequency is guaranteed to be positive, but it may be highly inaccurate (especially for frequencies close to zero or to Fs/2).

If the sampling frequency Fs is not provided, then it is assumed that Fs = 1.0.

source
DSP.Estimation.quinnFunction
quinn(x::Vector, f0::Real, Fs::Real = 1.0 ; tol = 1e-6, maxiters = 20)

quinn(x::Vector, Fs::Real = 1.0 ; kwargs...)

quinn(x::Vector ; kwargs...)

Algorithms by Quinn and Quinn & Fernandes for frequency estimation. Given a signal x and an initial guess f0, estimate and return the frequency of the largest sinusoid in x. Fs is the sampling frequency. All frequencies are expressed in Hz.

If the initial guess f0 is not provided, then a guess is calculated using Jacobsen's estimator. If the sampling frequency Fs is not provided, then it is assumed that Fs = 1.0.

The following keyword arguments control the algorithm's behavior:

  • tol: the algorithm stops when the absolute value of the difference between two consecutive estimates is less than tol. Defaults to 1e-6.
  • maxiters: the maximum number of iterations to run. Defaults to 20.

Returns a tuple (estimate, reachedmaxiters), where estimate is the estimated frequency, and reachedmaxiters is true if the algorithm finished after running for maxiters iterations (this may indicate that the algorithm did not converge).

If the signal x is real, then the algorithm used is [Quinn1991]. If the signal is complex, the algorithm is [Quinn2009].

source
  • Roy1986R Roy, A Paulraj and T Kailath, ESPRIT - A subspace approach to estimation of parameters of cisoids in noise, IEEE Trans. Acoustics, Speech, Signal Process., 34, 1340-1342 (1986). http://ieeexplore.ieee.org/abstract/document/1164935/.
  • Jacobsen2007E Jacobsen and P Kootsookos, "Fast, Accurate Frequency Estimators", Chapter 10 in "Streamlining Digital Signal Processing", edited by R. Lyons, 2007, IEEE Press.
  • Quinn1991B Quinn and J Fernandes, "A fast efficient technique for the estimation of frequency", Biometrika, Vol. 78 (1991).
  • Quinn2009B Quinn, "Recent advances in rapid frequency estimation", Digital Signal Processing, Vol. 19 (2009), Elsevier.