如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
实验十2ASK调制与解调实验
一.实验目的
1.掌握2ASK的调制与解调原理;
2.掌握利用MATLAB实现2ASK调制与解调的仿真方法。
二.实验内容及要求
利用MATLAB仿真平台,完成下列任务:
(1)产生二进制随机信号源,绘制信号源波形图;
(2)实现2ASK调制,绘制相应的信号波形图;
(3)利用awgn函数实现2ASK信号通过加性高斯白噪声信道,其中SNR=10dB;
(4)采用相干解调实现2ASK信号解调,并绘制各阶段信号波形图。(选做)
三.实验过程及结果
functionaskdigital(s,f)
t=0:2*pi/99:2*pi;
m1=[];
c1=[];
forn=1:length(s)
ifs(n)==0;
m=zeros(1,100);
elses(n)==1;
m=ones(1,100);
end
c=sin(f*t);
m1=[m1m];
c1=[c1c];
end
ask=c1.*m1;
y=awgn(ask,10);
subplot(311);
plot(m1)
title('原始信号');
axis([0100*length(s)-0.11.1]);
subplot(312);
plot(ask)
title('ASK信号');
subplot(313);
plot(y)
title('加噪信号');
s=round(rand(1,8))
%stem(s);holdon
f=1;
askdigital(s,f)
s=
11011010
★2ASK调制与解调示例:
clearall;
closeall;
clc;
max=8;
s=randint(1,max);%长度为max的随机二进制序列
cp=[];
f=1;%载波频率
tc=0:2*pi/99:2*pi;
nsamp=100;
cm=[];
mod=[];
forn=1:length(s);
ifs(n)==0;
m=zeros(1,nsamp);
b=zeros(1,nsamp);
elses(n)==1;
m=ones(1,nsamp);
b=ones(1,nsamp);
end
c=sin(f*tc);
cm=[cmm];
cp=[cpb];
mod=[modc];
end
tiaoz=cm.*mod;%2ASK调制
t=linspace(0,length(s),length(s)*nsamp);
figure;
subplot(2,1,1);
plot(t,cp);
gridon;
axis([0length(s)-0.11.1]);
title('二进制信号序列');
subplot(2,1,2);
plot(t,tiaoz);
gridon;
axis([0length(s)-1.11.1]);
title('2ASK调制信号');
%加性高斯白噪声信道
tz=awgn(tiaoz,10);%信号tiaoz中加入白噪声,信噪比为SNR=10dB
figure;
subplot(2,1,1);
plot(t,tz);
gridon
axis([0length(s)-1.51.5]);title('通过高斯白噪声信道后的信号');
jiet=mod.*tz;%相干解调
subplot(2,1,2);
plot(t,jiet);
gridon
axis([0length(s)-1.51.5]);
title('乘以相干载波后的信号波形')
%%%%%%%%%%%%%低通滤波%%%%%%%%%%%%%%%%%%%%%%%%
[f,af]=FFT_SHIFT(t,jiet);
B=2;
[t,dpsk]=RECT_LPF(f,af,B);
figure
subplot(2,1,1);
plot(t,dpsk);
gridon
title('通过低通滤波器后的信号波形');
%抽样判决,因为未修正幅度,所以判决门限为0.25
depsk=zeros(1,nsamp*length(s));
form=nsamp/2:nsamp:nsamp*length(s);
ifdpsk(m)<0.25;
fori=1:nsamp
depsk((m-50)+i)=0;
end
elsedpsk(m)>=0.25;
fori=1:nsamp
depsk((m-50)+i)=1;
end
end
end
subplot(2,1,2);
plot(t,depsk);
gridon
axis([0length(s)-0.11.1]);
title('抽样判决后的信号波形')
王子****青蛙
实名认证
内容提供者
最近下载