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

📄 untitled3.m

📁 是关于通信仿真的几个程序
💻 M
字号:
echo on;
t0=0.15;
ts=1/1500;
fc=250;
fs=1/ts;
t=[0:ts:t0];
df=0.3;
m=[ones(1,t0/(3*ts)),-2*ones(1,t0/(3*ts)),zeros(1,t0/(3*ts)+1)];
c=cos(2*pi*fc.*t);
u=m.*c;
y=u.*c;
[M,m,df1]=fftseq(m,ts,df);
M=M/fs;
[U,u,df1]=fftseq(u,ts,df);
U=U/fs;
[Y,y,df1]=fftseq(y,ts,df);
Y=Y/fs;
f_cutoff=150;
n_cutoff=floor(150/df1);
f=[0:df1:df1*(length(y)-1)]-fs/2;
H=zeros(size(f));
H(1:n_cutoff)=2*ones(1,n_cutoff);
H(length(f)-n_cutoff+1:length(f))=2*ones(1,n_cutoff);
DEM=H.*Y;
dem=real(ifft(DEM))*fs;
pause;
clf;
subplot(3,1,1);
plot(f,fftshift(abs(M)));
title('Spectrum of the Message Signal');
xlabel('Frequency');
subplot(3,1,2);
plot(f,fftshift(abs(U)));
title('Spectrum of the Modulated Signal');
xlabel('Frequency');
subplot(3,1,3);
plot(f,fftshift(abs(Y)));
title('Spectrum of the Mixer Output');
xlabel('Frequency');
pause;
clf;
subplot(3,1,1);
plot(f,fftshift(abs(Y)));
title('Spectrum of the Mixer Output');
xlabel('Frequency');
subplot(3,1,2);
plot(f,fftshift(abs(H)));
title('Lowpass Filter Characteristics');
xlabel('Frequency');
subplot(3,1,3);
title('Spectrum of the Demodulator Output');
xlabel('Frequency');
pause;
clf;
subplot(2,1,1);
plot(f,fftshift(abs(M)));
title('Spectrum of the Message Signal');
xlabel('Frequency');
subplot(2,1,2);
plot(f,fftshift(abs(DEM)));
title('Spectrum of the Demodulator Output');
xlabel('Frequency');

⌨️ 快捷键说明

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