MATLAB: Audio Procesing

audio

Im new to Matlab. I need to split the time dimensions of an audio track into frames of 10mS and for every 10mS frame have to compute the FFT to generate the spectrograph. I need help on this.

Best Answer

Hi Karthik, Why can't you just use spectrogram()? You can specify the window length (the number of samples corresponding to 10 msec) as an input.
If you cannot use spectrogram(), you can use reshape() as one option.
Suppose you have an audio signal sampled at 20 kHz.
Then 200 samples is 10 msec.
x = randn(2e4,1);
x = reshape(x,200,100);
You can then apply the Fourier transform to the columns of x.
Better than the above option is buffer(), which allows you to construct overlapping segments.
x = 1:16;
x = buffer(x,4,2)
Again, spectrogram provides a NOVERLAP input argument that handles this easily.