I have an audio file, that I analyse with audacity and the spectrum look like :
I would like to get the same with scilab so I've run this code :
[y,Fs] = wavread('fileName.wav');
Y_0 = abs(fft(y(1,:),-1));
plot(fftshift(Y_0));
and the result is :
I tried this as well :
plot(10*log10(fftshift(Y_0)));
the result was different but still not the same as audacity, any idea how to do it ? thanks in advance for any help !
Audacity's spectrum is actually a periodogram, which is an estimate of spectral density. Try using the pwelch function. Here is my Audacity frequency analysis:
Recreated using MATLAB's pwelch function:
[y, fs] = wavread('inputfile.wav');
pwelch(y, hanning(512))