필터 지우기
필터 지우기

I want to represent the PSD of three signals on a waterfall plot. How can this be done?

조회 수: 6 (최근 30일)
I want to represent 3 signals on a waterfall plot to see how the signal changes over time
fs = 1000; % Sampling frequency
t = (0:fs)/fs; % One second worth of samples
A = [1 2]; % Sinusoid amplitudes (row vector)
A1 = [3 4];
A2 = [5 6];
f = [150;140]; % Sinusoid frequencies (column vector)
f1 = [120;100];
f2 = [100;90];
xn = A*sin(2*pi*f*t) + 0.1*randn(size(t));
xn1=A1*cos(2*pi*f1*t) + 0.8*randn(size(t));
xn2=A2*cos(2*pi*f2*t) + 0.5*randn(size(t));
Hs = spectrum.periodogram;
psd=psd(Hs,xn,'Fs',fs,'NFFT',1024,'SpectrumType','onesided')
Hs1 = spectrum.periodogram;
psd1=psd(Hs1,xn,'Fs',fs,'NFFT',1024,'SpectrumType','onesided')
Hs2 = spectrum.periodogram;
psd2=psd(Hs2,xn,'Fs',fs,'NFFT',1024,'SpectrumType','onesided')
waterfall(psd,psd1,psd2)

채택된 답변

bym
bym 2012년 12월 9일
First of all, do not name a variable the same as a function! Change the the first psd variable to
psd0 = psd(Hs,xn,'Fs',fs,'NFFT',1024,'SpectrumType','onesided');
then make the call to waterfall like this:
waterfall([psd0.data psd1.data psd2.data]')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by