Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Matlab - Power Spectrum

Status
Not open for further replies.

asd09

Newbie level 1
Newbie level 1
Joined
Apr 10, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,287
power spectrum matlab

Hi,

I am new to matlab. I would like to ask how can i plot the power spectrum like the one below (see file attached) from a wave file.

I have tried something like below but it didn't turn out what i wanted.

[filename, pathname] = uigetfile;
[data,Fs,nbits] = wavread([pathname filename]);
n = length(data);
t = (0:n-1)/Fs;
p = abs(fft(data));
f = (0:n-1)*(Fs/n);
plot(f,p);
axis([0 500 0 100])


Any info/help is much appreciated.
My apologies if i've posted posted in the wrong section.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top