
实验四 ASK 调制与解调
1.实验目的和要求
用 MATLAB 实现二进制序列的调制与解调
2.实验内容
用角频率为 2 的载波信号实现序列[1 0 1 1 0 1 0 1]的调制。
3.软件部分源代码
clear,close all,
g=[1 0 1 1 0 1 0 1];
f=2;
t=0:2*pi/99:2*pi;
cp=[];sp=[];
mod=[];bit=[];
for n=1:length(g);
if g(n)==0;
die=ones(1,100);
se=zeros(1,100);
else g(n)==1;
die=2*ones(1,100);
se=ones(1,100);
end
c=sin(f*t);
cp=[cp die];
mod=[mod c];
bit=[bit se];
end
ask=cp.*mod;
subplot(2,1,1);plot(bit,'LineWidth',1.5);grid on;
title('Binary Signal');
axis([0 100*length(g) -2.5 2.5]);
subplot(2,1,2);plot(ask,'LineWidth',1.5);grid on;
title('ASK modulation');
axis([0 100*length(g) -2.5 2.5]);