此博客供信息类专业的同学借鉴,搜集整理了网络上的资料,已经过调试。
题目要求:自己构造一时间函数-增量调制-Miller码-汉明码-PSK-AWGN
使用工具:MATLAB R2014a
1、主程序
%empty the processing-----------------------
close all;
clear all;
%original signal-----------------------------
Ts=1e-3;
t=0:Ts:20*Ts;
x=sin(2*pi*50*t)+0.5*sin(2*pi*150*t);
figure(1)
plot(t,x,'-o');axis([0 20*Ts,-2 2]);
title('源信号');
%delta modulation-----------------------------
y_DM = DM_coding(x,t) ;
figure(2)
stairs(t,y_DM);axis([0 20*Ts,-2 2]);
title('DM调制输出');
%Miller modulation----------------------------
y_Miller = Miller_coding(y_DM) ;
t2 = 0:Ts:41*Ts;
figure(3)
stairs(t2,y_Miller);axis([0 40*Ts -2 2]);
title('Miller编码信号');
%Hamming modulation----------------------------
y_Hamming=encode(y_Miller,7,4,'hamming') ;
figure(4)
stairs(y_Hamming);axis([0 length(y_Hamming) -2 2]);
title('Hamming编码');
%2PSK modulaiton----------------------------
y_PSK = PSK_coding(y_Hamming);
figure(5)
plot(y_PSK);
axis([0 length(y_PSK) -2 2]);
title('2PSK调制信号');
%AWGN-------------------------------------------
y_AWGN=awgn(y_PSK,30);
figure(6);
plot(y_AWGN);axis([0 length(y_AWGN) -2 2]);
title('加高斯白噪声');
%PSK demodulation------------------------------------
y_psk_d = PSK_decoding(y_AWGN);
figure(7)
stairs(y_psk_d);axis([0 length(y_psk_d) -2 2]);
title('PSK解调信号(Hamming)');
%Hamming demodulation--------------------------------
y_Hamming_d=decode(y_psk_d,7,4,'hamming');
figure(8)
stairs(y_Hamming_d);axis([0 length(y_Hamming_d) -2 2]);
title('Hamm