Getting the amplitude back from FFT, how to ?
Mostra commenti meno recenti
Hi everyone, I have a wave that is a sum of sines and cosines:
x = A*sin(wt * phi1) + B*cos(2w*t + phi2) + C*sin(2wt +phi3) and D*cos(wt +phi4). Now I use fft on x and get the magnitude with abs(fft(x)). How do I get A, B, C and D back? The reason behind this is that I am new to fft and I am trying to understand the output that Matlab fft gives back in depth. Thank you
Risposta accettata
Più risposte (1)
Wayne King
il 18 Feb 2013
By getting back do you mean finding the information in the Fourier domain? You have to know which DFT bin contains the frequency of interest
Fs = 100;
t = 0:1/Fs:1-1/Fs;
x = 1.5*cos(2*pi*10*t-pi/4);
xdft = fft(x);
Now the spacing in the frequency domain is Fs/N where N is the length of the signal, so 1 Hz in this case. Because the first DFT bin corresponds to 0 frequency, this means that 10 Hz is localized to DFT bin number 11.
tenHzcoef = xdft(11)/length(x);
angle(tenHzcoef) % this is the starting phase
2*abs(tenHzcoef) % the amplitude
2 Commenti
Nina
il 18 Feb 2013
Wayne King
il 18 Feb 2013
The discrete Fourier transform (DFT) uses a discrete set of frequencies. Don't get hung up on fft(), fft() is an algorithm, you want to understand the DFT.
Once you see the defining equation for the DFT, you'll see what set of frequencies the coefficients are associated with. Those are the DFT "bins".
There are so many good textbooks and sources to understand the DFT.
Categorie
Scopri di più su Discrete Fourier and Cosine Transforms in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!