FFT output is a frequency vector that can apply to this function?

4 visualizzazioni (ultimi 30 giorni)
In the Description of fft, it said "If X is a vector, then fft(X) returns the Fourier transform of the vector.". If I read a wav file into matlab,
x = wavread(wavFile);
xF = fft(x)
What kind of thing xF is? Is it a vector, matrix or multidimensional array? If I would like to implement melfilter function, can I use xF as the frequency vector?
If I cant, how can I create a frequency vector from the wav file I read?
Thanks

Risposta accettata

Star Strider
Star Strider il 6 Nov 2016
Your ‘xF’ variable contains the complex Fourier transform of ‘x’. For a vector, it take the Fourier Transform of the vector For a matrix, it takes the Fourier transform column-wise (along the columns). Since your ‘x’ is most likely a (Nx2) matrix, (one column for each channel), ‘xF’ will have the same dimensions.
I still prefer the R2015a documentation for fft (link), because the code between the first (top) two plot figures is descriptive and easy to understand.
  4 Commenti
Peter
Peter il 6 Nov 2016
Is that going to be the same if I cut the x frame to frame? lets say x(1:320) x(321:640) . . .
Star Strider
Star Strider il 6 Nov 2016
It would be. Cutting it frame-to-frame would significantly reduce the frequency resolution, unless you zero-pad your vector by using a relative large (and constant) value for the length of the Fourier transform (noted as ‘NFFT’ in the documentation).
I’m not certain what you’re doing with your signal. If you want to do a time-frequency analysis of it, and if you have the Signal Processing Toolbox, see the spectrogram function. It will probably do the time-frequency analysis much more easily than writing your own code.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by