From: gökan vural on
Hi dear friends,

I wanna take some '.wav' -uncompressed- samples from songs. However, to convert 200 .mp3 file to .wav will take too long time. Therefore, i want to read the files in mp3 format and use them in wav format in matlab.

It'll be grateful if anyone helps me about the code..
From: Wayne King on
"gökan vural" <vural.gkan(a)gmail.com> wrote in message <hkagv1$p1f$1(a)fred.mathworks.com>...
> Hi dear friends,
>
> I wanna take some '.wav' -uncompressed- samples from songs. However, to convert 200 .mp3 file to .wav will take too long time. Therefore, i want to read the files in mp3 format and use them in wav format in matlab.
>
> It'll be grateful if anyone helps me about the code..

Hi, have you checked the file exchange?

http://www.mathworks.com/matlabcentral/fileexchange/13852-mp3read-and-mp3write

Wayne
From: gökan vural on
Thanks for the thread, it's very useful :)

If you know, could you tell me how to take the power spectrum of the wav file ?
From: Wayne King on
"gökan vural" <vural.gkan(a)gmail.com> wrote in message <hkavfh$3ou$1(a)fred.mathworks.com>...
> Thanks for the thread, it's very useful :)
>
> If you know, could you tell me how to take the power spectrum of the wav file ?

If you have the Signal Processing Toolbox, you can use spectrum.periodogram, or spectrum.welch to obtain power spectral density (PSD) estimates:

Fs=1000;
t=0:1/Fs:.3;
x=cos(2*pi*t*200)+randn(size(t));
Hper = spectrum.periodogram;
HpsdPer = psd(Hper,x,'Fs',Fs);
plot(HpsdPer); title('Periodogram');

Hwelch = spectrum.welch;
HpsdWelch = psd(Hwelch,x,'Fs',Fs);
figure;
plot(HpsdWelch); title('Welch');

If you do not have the Signal Processing Toolbox, you can take the absolute value squared of the discrete Fourier transform (using fft() ). You will have to scale that appropriately to get a PSD estimate.

Hope that helps,
Wayne
From: gökan vural on
Thanks for above code, but i couldn't obtain what i need exactly..

I'm trying apply stft to a .wav file and obtain such a graphic : http://upload.wikimedia.org/wikipedia/commons/9/9b/Short_time_fourier_transform.PNG

Therefore, i'm gonna start my analysis on songs ..

King Regards,

Gökhan , Cs Student