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.

Help me to compute the power spectrum for a sampled signal using Matlab

Status
Not open for further replies.

MATLAB

Newbie level 1
Joined
Feb 13, 2006
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,288
Hi!
I have a question on MATLAB as follows:
The signal x(t) = sin(ω1t) , given ω1 = 5 , is sampled at 7 samples/sec during8 sec. Compute the power spectrum for the sampled signal.
Can any body help me with that?
thanks
 

Question on MATLAB

Unless some adjustment in frequency axis, you can start trying the code below.

>> w1=5;
>> t=0:1/7:8;
>> ws=7;
>> x=sin(w1*t);
>> Xw=abs(fftshift(fft(x)));
>> Ws=[-28:28]*ws;
>> plot(Ws,Xw)
 

Re: Question on MATLAB

correct Matlab Code is:

>> w1=5;
>> t=0:1/7:8;
>> ws=7;
>> x=sin(2*pi*w1*t);
>> Xw=abs(fftshift(fft(x)));
>> Ws=[-28:28]*ws;
>> plot(Ws,Xw)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top