views:

178

answers:

1

Using GNU octave, I'm computing a fft over a piece of signal, then eliminating some frequencies, and finally reconstructing the signal. This give me a nice approximation of the signal ; but it doesn't give me a way to extrapolate the data.

Suppose basically that I have plotted three periods and a half of

f: x -> sin(x) + 0.5*sin(3*x) + 1.2*sin(5*x)

and then added a piece of low amplitude, zero-centered random noise. With fft/ifft, I can easily remove most of the noise ; but then how do I extrapolate 3 more periods of my signal data? (other of course that duplicating the signal).

The math way is easy : you have a decomposition of your function as an infinite sum of sines/cosines, and you just need to extract a partial sum and apply it anywhere. But I don't quite get the programmatic way...

Thanks!

+1  A: 

The Discrete Fourier Transform relies on the assumption that your time domain data is periodic, so you can just repeat your time domain data ad nauseam - no explicit extrapolation is necessary. Of course this may not give you what you expect if your individual component periods are not exact sub-multiples of the DFT input window duration. This is one reason why we typically apply window functions such as the Hanning Window prior to the transform.

Paul R
Hmm, but then what do you use when extrapolating tendencies of non-periodic time series, such as http://codebase.mql4.com/4990 (method 1, "Quinn-Fernandes Algorithm")
CFP
I haven't read this in detail but I suspect this is extrapolation based on successive (possibly overlapping) DFTs. The assumption is probably that the time series is periodic and stationary locally and you can take care of the (relatively slow) time-varying parameters by looking at how successive spectra vary. This is somewhat like speech analysis.
Paul R
Hmm, I'm not sure I understand you ; what do you mean by overlapping DFTs?
CFP
Somehow, what I believe I need is something like `III. Aperiodic discrete signal, continuous periodic spectrum` on http://fourier.eng.hmc.edu/e101/lectures/handout4/node3.html but I don't quite now how to do this...
CFP
Overlapping DFTs means that the first FFT might take as input samples 0..M-1, while the second DFT takes samples M/2..3M/2-1, i.e. there is a 50% overlap. The successive output spectra can be viewed as an approximation of time-varying spectrum of the non-stationary series.
Paul R
To sum up (correct me if I'm mistaken : My sample has M points; I compute to DFTs, one over `0..M-1`, the second over `(M/2..M-1)U(0,M/2-1)`, and then add the two resulting iffts?
CFP
@CFP: no, this is just a general approach for data series whose properties are time-varying - you get more information by overlapping the successive DFTs. The idea is that for a long time series you will take many successive DFTs, which may optionally overlap, to get a frequency domain model of the data wrt time. E.g. imagine you have a sinusoidal component whose fundamental frequency is slowly increasing - in each successive DFT you will get a peak at a slightly higher frequency. You can extrapolate the movement of this peak to predict its frequency beyond the end of the time series. HTH
Paul R
Oh, I get it :) Thanks Paul (sounds quite tricky though)
CFP