实验3 FSK (ASK)调制解调实验 下载本文

通信工程实验教学中心 通信系统原理实验报告

原始信号和恢复信号

ASK的Matlab仿真结果

6

通信工程实验教学中心 通信系统原理实验报告

实验室演示的图形

ASK的基带信号和调制信号

实验心得

通过两个不同频率的载波信号可以对调制信号进行2FSK调制;通过想干解调,可以较好的实现2FSK调制信号的解调;解调出来的波形与调制信号相比会有一定的延时。2FSK信号频谱是看成由两个不同频率的2ASK信号频谱组成。

7

通信工程实验教学中心 通信系统原理实验报告

附录

FSK的Matlab程序

主程序

close all clear all n=16;

f1=18000000; f2=6000000;

bitRate=1000000; N=50; noise=10;

signal=source(n,N);

transmittedSignal=fskModu(signal,bitRate,f1,f2,N); signal1=gussian(transmittedSignal,noise);

configueSignal=demoFSK(signal1,bitRate,f1,f2,N);

子程序

function bitstream=demoFSK(receivedSignal,bitRate,f1,f2,N) load num

signal1=receivedSignal;

signal2=filter(gaotong,1,signal1); %通过HPF,得到高频分量 signal3=abs(signal2); %整流

signal3=filter(lowpass,1,signal3); %通过LPF,形成包络 bitstream=[];

IN1=fix(length(lowpass)/2)+fix(length(gaotong)/2); %延迟时间 bitstream1=[];

LL=N; %每个bit的抽样点数 i=IN1 +LL/2;

while (i<=length(signal3)) %判决

bitstream1=[bitstream1,signal3(i)>=0.5]; i=i+LL; end

bitstream1 figure(5)

subplot(3,1,1);

plot(1:length(signal1),signal1);

title('Waveof receivingterminal(including noise)'); grid on;

subplot(3,1,2);

plot(1:length(signal2),signal2);title('After Passing HPF');grid on; subplot(3,1,3);

plot(1:length(signal3),signal3);title('After Passing LPF');grid on;

8

通信工程实验教学中心 通信系统原理实验报告

signal4=filter(daitong,1,signal1); %通过BPF,得到低频分量 signal5=abs(signal4); %整流

signal5=filter(lowpass,1,signal5); %通过LPF,形成包络

IN2=fix(length(lowpass)/2)+fix(length(daitong)/2); %延迟时间 bitstream2=[];

LL=N; %每个bit的抽样点数 i=IN2 +LL/2;

while (i<=length(signal5)) %判决

bitstream2=[bitstream2,signal5(i)>=0.5]; i=i+LL; end

bitstream2 figure(6)

subplot(3,1,1);

plot(1:length(signal1),signal1);

title('Wave of receiving terminal(including noise)');grid on; subplot(3,1,2);

plot(1:length(signal4),signal4);title('After Passing BPF');grid on; subplot(3,1,3);

plot(1:length(signal5),signal5);title('After Passing LPF');grid on;

for i=1:min(length(bitstream1),length(bitstream2)) %判决 if(bitstream1(i)>bitstream2(i)) bitstream(i)=1; else

bitstream(i)=0; end end

bitstream

bit=[]; %接收端波形 for i=1:length(bitstream) if bitstream(i)==0 bit1=zeros(1,N); else

bit1=ones(1,N); end

bit=[bit,bit1]; end

figure(7)

plot(bit),title('binary of receiving terminal'),grid on; axis([0,N*length(bitstream),-2.5,2.5]); end

function transmittedSignal=fskModu(signal,bitRate,f1,f2,N)

9

通信工程实验教学中心 通信系统原理实验报告

t=linspace(0,1/bitRate,N); c1=sin(2*pi*t*f1); c2=sin(2*pi*t*f2); transmittedSignal=[]; for i=1:length(signal) if signal(i)==1

transmittedSignal=[transmittedSignal,c1]; else

transmittedSignal=[transmittedSignal,c2]; end end figure(2)

plot(1:length(transmittedSignal),transmittedSignal); title('Modulation of FSK');grid on; figure(3)

m=0:length(transmittedSignal)-1; F=fft(transmittedSignal);

plot(m,abs(real(F))),title('ASK_frequency-domain analysis real'); grid on; end

FSK的Matlab程序

clc; clear;

N=30; xn=[];

x=[1 0 1 1 0 0 1 0 1 0 1 0 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0]; t=0.01:0.01:N; y=cos(2*pi*2*t); for i=1:N

if x(i)==1

xn(i*100-99:i*100)=ones(1,100); else

xn(i*100-99:i*100)=zeros(1,100); end end

subplot(5,2,1) plot(xn);

title('原始二进制信号'); axis([0 3000 -1 2])

y=cos(2*pi*2*t);

10

subplot(5,2,2) plot(y);

title('载波波形'); axis([0 3000 -2 2])

z=xn.*y;

subplot(5,2,3) plot(z)

title('已调信号')

axis([0 3000 -1.5 1.5])

%对已调信号进行频谱分析 ba=fft(z,512); ba=abs(ba); subplot(5,2,4) plot(ba);

title('已调信号频谱') axis([-200 600 0 150])

%加入高斯噪声

a=0.1;%noise 系数,控制噪声功率 noise=a*(2*rand(1,100*N)-1);