How to get the values of signal frequencies that was loaded from wav file to variable

Status
Not open for further replies.

toybani

Newbie level 3
Joined
Jun 15, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,299
hi... I load a wav file to a variable....
how can i get the values of the frequencies of this signal???
thanks
 

Re: signal frequencies

well thanks but I still can't figure it out...

we have:
i=wavread('sound.wav');
x=abs(fft(i));

how then can i see which frequencies exist in this signal???
 

signal frequencies

You need to know the sampling frequency, Fs. Then you can plot the spectrum as follows:
Code:
[x,Fs,NBIT]=wavread('sound.wav'); 
N=length(x);
X=fft(x);
f=(0:N/2-1)*Fs/N;
plot(f,abs(X(1:N/2)))
You might have to adjust the vector sizes, using floor if your number of points is not even, but I hope you get the point...
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…