5

I'm working on a control system that measures the movement of a vibrating robot arm. Because there is some deadtime, I need to look into the future of the somewhat noisy signal. My idea was to use the frequencies in the sampled signal and produce a fourier function that could be used for extrapolation.

My question: I already have the FFT of the signal vector (containing 60-100 values e.g.) and can see the main frequencies in the amplitude spectrum. Now I want to have a function f(t) which fits to the signal, removes some noise, and can be used to predict the near future of the signal. How do I calculate the coefficients for the sine/cosine functions out of the complex FFT data?

Dipan Mehta
  • 5,587
  • 2
  • 30
  • 53
Cassimir Ovin
  • 51
  • 1
  • 3
  • This may be what you want: http://dsp.stackexchange.com/questions/101/how-do-i-extrapolate-a-1d-signal – datageist Oct 29 '11 at 13:24
  • 1
    Are you looking for help with your MATLAB code? If so, then [so] is the right place for you. [dsp.se] is more for conceptual questions, algorithms and language agnostic solutions – Lorem Ipsum Oct 29 '11 at 19:47

1 Answers1

4

This is a no brainer for anyone who's studied signal processing (Im wondering why its been so long since its been answered)

The Fourier Transform itself is a function that tells you what sinusoid do you need to add together to create this continuous signal. (Its like the Fourier series for more complex signals)

the FFT algorithm gives you COMPLEX coefficients (a+bj) (where j is the imaginary number... it looks like and i but backwards....)

calculate the magnitude of each coefficient A(n) = sqrt(a(n)^2 + b(n)^2) calculate the phase of each coefficient phi(n) = inverse_tan(b(n)/a(n)); (remember to use atan2 so that it results in the correct quadrant)

now remember based on your sampling rate each coeff represents a "bin" of frequencies, however you should think of them as evenly distributed frequencies:

So if you have N bins each frequency_bin they represent is f = Fs/(2*N)

then your signal becomes

$$ f(x) = \Sigma^N_0 A(n)*cos(2*\pi*f(n) + \phi(n)) $$

also: Predicting function: Impossible. that would be asking for a non-causal system.

CyberMen
  • 831
  • 9
  • 18
  • Two reasons why I didn't answer it- 1) it's old, don't know why Dipan resurrected it, and 2) FFT's are not how I would do function prediction. The OP is asking for the wrong thing. – Jim Clay Apr 17 '12 at 18:02