Victor Pira
Victor Pira

Reputation: 1172

Robust least squares in Octave

I am programming the classical Prony's method (or sometimes Prony's analysis) using Octave. The script works pretty fine on a test signal such as:

t = 1:600;
sig = exp(-0.01*t).*cos(0.1*t);

but totally collapses when even a small amount of noise is added:

sig = sig + 0.001*rand(size(sig));

The issue is computing the overdetermined set of equations using pinv when the linear prediction is bulit (see the link above). I need something more robust and less sensitive to outliers. Sadly, no function in the Octave core helped me so far. I have tried ols and lscov but they don't do the trick.

Any hints, please?

Note: I am aware that the classic Prony is very problematic just because of this issues and there are modified algorithms (such as this one). I just feel that I haven't done the maximum for the classic method to work. Using a better solver it should persist this kind of noise.

Upvotes: 3

Views: 310

Answers (1)

rwp
rwp

Reputation: 1886

I think the issue here is the difference in timescale between the noise and the underlying damped-sinusoid. The lowest order of difference equation that could match your damped-sinusoid is second-order, so span only three adjacent timesteps. But such a model would be very likely to overfit the noise signal simply because the sinusoid has a period of dozens of samples. If the noise is weak enough, you may be able to use Prony's method by regularizing the pseudo-inverse by diagonal loading and/or increasing the order of the model so that the prediction filter spans a wider time extent.

Upvotes: 0

Related Questions