Calculating FFT on a wav file in matlab

I am new to MATLAB and have to do some simple signal processing, specifically I would like to take a wav file and apply the built in FFT function to it.

I was thinking to do the following but not sure if it is correct. Can some guide me as to what to do to get this FFT if my code is incorrect.

[y, Fs, nbits] = wavread('test.wav');
myFtt = fft(y,512);

Answers


In principle yes, provided the length of the input is longer than 512. The result will be the amplitudes for the frequencies k*Fs/512, first for k from 0 to 255 and then for k from -256 to -1.

If you want to do any kind of analysis on the signal, you should take a longer segment and apply windowing. The FFT sees the input as a periodic signal, so unwindowed you get a jump at the wrap-around from the end to the start. Any jump in the signal leads to background artifacts in the amplitudes.


Need Your Help

Byte Array copy in Jsp

google-app-engine copy bytearray

I am trying to append 2 images (as byte[] ) in GoogleAppEngine Java and then ask HttpResponseServlet to display it.

Remove the yellow background on input on autofill

html css forms css3 input

Anyone knows how to remove this ugly chrome background when autofill? (Refer below.)