how to take psd

4 visualizaciones (últimos 30 días)
Mohammed Al-Hasani
Mohammed Al-Hasani el 7 de Abr. de 2019
Respondida: David Wilson el 8 de Abr. de 2019
i want to take psd for following signal.
x=sin(2*pi*19000*t)+cos(2*pi*2000*t)+randn(size(t))+tan(2*f);
Can someone help me please?

Respuestas (2)

David Wilson
David Wilson el 8 de Abr. de 2019
Bit hard to help since you haven't given us some key information, but assuming you are sampling at a reasonable sampling rate, and forthe moment we will drop the noise term, then
Ts = 1e-5; % sample time
Fs = 1/Ts; % sampling frequency
t = [0:Ts:0.001]';
f = 1000; % ??? (who knows?)
x=sin(2*pi*19000*t)+cos(2*pi*2000*t)+ 0*randn(size(t))+tan(2*f);
plot(t,x,'.-')
This will give a time plot ofthe signal. Always a good idea to look at that.
Now you were asked for a PSD, and typing
help psd
indicates we should use periodgram. Have a look at the help file, and you will see
periodogram(x,[],'twosided',512,Fs)
two clear peaks; one at 2 kHz and one at 19 kHz, just like in your original generating formula. What a coincidence!

David Wilson
David Wilson el 8 de Abr. de 2019
If you want, the noise term will simply smudge the results.

Categorías

Más información sobre Spectral Estimation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by