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.

PSD calculation using Matlab{help needed}

Status
Not open for further replies.

qslazio

Full Member level 3
Full Member level 3
Joined
May 23, 2004
Messages
175
Helped
18
Reputation
36
Reaction score
7
Trophy points
1,298
Activity points
1,420
calculate psd

I'm writing a Matlab m-file to calculate PSD of sinusoid signal.
However the output puzzle me a lot.

Below is the m-file:
------------------------------------------------------------------
fs =1e10;
fi =1e8;
amp =1;
nbpts =4e5;
t =[0:1/fs:nbpts/fs];
sig =amp*sin(2*pi*fi*t);
Hs = spectrum.periodogram('rectangular');
Hdsp2 = psd(Hs,sig,'Fs',fs,'NFFT',nbpts,'SpectrumType','onesided');
Pow = avgpower(Hdsp2,[0.9*fi,1.1*fi]);
plot(Hdsp2);

------------------------------------------------------------------


Here, I intended to calculate psd of this sinusoid of which the frequency is 100Meg Hz and amplitude is 1. I expected to see this 0.5*δ(w-100Meg) impulse on this one-sided PSD plot.
But instead, there is a impulse of which the amplitude is around -50dB, which I cannot explain it at all.

Can anyone tell me what's wrong with the m-file?
Thank in advance!!
 

psd calculation

There is function in matlab call psd().This will calculate the psd of any signal you pass to it and plot it.Try help psd and will get all the details.You can even check the code of that function.
 

Re: psd calculation

psd() there is no such function in matlab
 

yes, there is. Try help psd (no parenthesis).
 
  • Like
Reactions: safa.

    safa.

    Points: 2
    Helpful Answer Positive Rating
thanks mate i got it. :)
 

The following convertion leads to correct power value 0.5:

10^(-47/10)*(5e9/200001) = 0.5

-47: The dB value of PSD maximum point.
5e9: Sample Rate.
200001: Point in the PSD plot.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top