discretesignals.m
来自「Self devrloped Demos for beginners of Ma」· M 代码 · 共 43 行
M
43 行
%%
N=8192;
f0=0.1;
f1=0.2;
f2=0.3;
f3=0.5;
n=[0:8*pi];
x0=cos(2*pi*f0*n);
x1=cos(2*pi*f1*n);
x2=cos(2*pi*f2*n);
x3=cos(2*pi*f3*n);
X0=fft(x0,N);
X1=fft(x1,N);
X2=fft(x2,N);
X3=fft(x3,N);
F=[0:N-1]*1/N;
subplot(421)
stem(n,x0)
subplot(422)
plot(F,abs(X0))
subplot(423)
stem(n,x1)
subplot(424)
plot(F,abs(X1))
subplot(425)
stem(n,x2)
subplot(426)
plot(F,abs(X2))
subplot(427)
stem(n,x3)
subplot(428)
plot(F,abs(X3))
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?