program_8_10.m
来自「这是国外一本经典教材附带的程序」· M 代码 · 共 13 行
M
13 行
% Program 8_10
% Spectral Analysis Using the DFT
%
N = input('Type in the length of DFT = ');
T = input('Type in the sampling period = ');
freq = input('Type in the sinusoid's frequency = ');
k = 0:N-1;
f = sin(2*pi*freq*k*(1/T));
F = fft(f);
stem(k,abs(F));grid
xlabel('k');
ylabel('|X[k]|');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?