comp_exam3_1.m

来自「the source code of Ziemer s book Digital」· M 代码 · 共 15 行

M
15
字号
fs = 1000;													% sampling frequency
delt = 1/fs;												% sampling increment
t = 0:delt:1-delt;										% time vector
npts = length(t);											% number of points
fn = (0:npts)-(fs/2);									% frequency vector for plot
m = 3*cos(2*pi*25*t);									% modulation
xc = sin(2*pi*200*t+m);									% modulated carrier
asxc = (1/npts)*abs(fft(xc));							% amplitude spectrum

evenf = [asxc((npts/2):npts) asxc(1:npts/2)];	% even amplitude spectrum

stem(fn,evenf,'.k');
xlabel('Frequency - Hz')
ylabel('Amplitude')

⌨️ 快捷键说明

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