📄 10t.m
字号:
clear;
clc;
N=128;
n=0:1:N-1;
t=0.01*n;
x=2*sin(4*pi*t)+5*cos(16*pi*t);
y=x+0.8*randn(1,length(t));
x1=fft(x);
magx1=abs(x1);
w=2*pi/N*n;
subplot(2,1,1); plot((w*100)/(2*pi),magx1);title('DFT幅度');
axis([0,40,0,400]);
y1=fft(y);
magy1=abs(y1);
w=2*pi/N*n;
subplot(2,1,2);plot((w*100)/(2*pi),magy1);title('被噪声污染后DFT幅度')
axis([0,100,0,400]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -