📄 9t.m
字号:
clear;
clc;
N1=40;
n=0:1:N1-1;
t=0.01*n;
x=2*sin(4*pi*t)+5*cos(16*pi*t);
x1=fft(x);
magx1=abs(x1);
w=2*pi/N1*n;
subplot(3,1,1);
plot((w*100)/(2*pi),magx1);title('DFT幅度');
axis([0,25,0,200]);
N2=60;
n=0:1:N2-1;
t=0.01*n;
x=2*sin(4*pi*t)+5*cos(16*pi*t);
x2=fft(x);
magx2=abs(x2);
w=2*pi/N2*n;
subplot(3,1,2);
plot((w*100)/(2*pi),magx2);title('DFT幅度');
axis([0,25,0,200]);
N3=128;
n=0:1:N3-1;
t=0.01*n;
x=2*sin(4*pi*t)+5*cos(16*pi*t);
x3=fft(x);
magx3=abs(x3);
w=2*pi/N3*n;
subplot(3,1,3);
plot((w*100)/(2*pi),magx3);title('DFT幅度');
axis([0,25,0,400]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -