test.m

来自「使用matlab变成」· M 代码 · 共 16 行

M
16
字号
 t = 0:0.001:0.6;
x = 2*sin(2*pi*50*t)+sin(2*pi*120*t);
y = x ;
figure;
subplot(2,1,1);
plot(t,y)
title('Signal Corrupted with Zero-Mean Random Noise')
xlabel('time (milliseconds)')

 Y= fft(y,512);
Pyy = Y.* conj(Y) / 512;
f = 1000*(0:256)/512;
subplot(2,1,2);
plot(f,Pyy(1:257))
title('Frequency content of y')
xlabel('frequency (Hz)')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?