how to take psd
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (2)
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!
0 comentarios
David Wilson
el 8 de Abr. de 2019
If you want, the noise term will simply smudge the results.
0 comentarios
Ver también
Categorías
Más información sobre Spectral Estimation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!