⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comp_exam3_2.m

📁 the source code of Ziemer s book Digital communication. This code is related to the exercise part.
💻 M
字号:
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/2))*(fs/npts);					% frequency vector for plot
m1 = 2*cos(2*pi*50*t);							% modulation signal 1
m2 = 2*cos(2*pi*50*t)+1*cos(2*pi*5*t);		% modulation signal 2
xc1 = sin(2*pi*250*t+m1);						% modulated carrier 1
xc2 = sin(2*pi*250*t+m2);						% modulated carrier 2
asxc1 = (2/npts)*abs(fft(xc1));				% amplitude spectrum 1
asxc2 = (2/npts)*abs(fft(xc2));				% amplitude spectrum 2
ampspec1 = asxc1(1:((npts/2)+1));			% positive frequency portion 1
ampspec2 = asxc2(1:((npts/2)+1));			% positive frequency portion 2
subplot(211)
stem(fn,ampspec1,'.k');
xlabel('Frequency - Hz')
ylabel('Amplitude')
subplot(212)
stem(fn,ampspec2,'.k');
xlabel('Frequency - Hz')
ylabel('Amplitude')
subplot(111)

⌨️ 快捷键说明

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