资源简介
可直接运行的matlab dpsk仿真代码,通过awgn信道
代码片段和文件信息
clc
clear all
close all
% DPSK system
% assuming to have ideal channel H(z)=1
% AWGN
% initiate variances
symbol_num0=14;
symbol_num=symbol_num0+1;
b_d=zeros(1symbol_num0); % relative code
Rs=1200; % symbol rate
T=10; % oversampling 7 points per symbol
s_t=zeros(1symbol_num*T);
f_C=1800; % the carrier frequence is 1800 Hz
fs=Rs*T;
ts=1/fs;
Eb=1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Tx %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% carrier generate
t=0:1/fs:(symbol_num*T-1)/fs;
carrier_sig= sin(2*pi*f_C*t);
% code exchanger (absolute to differential)
b_org=unifrnd(-111symbol_num0)>0; % the absolute sequence b_n
%b_org=[1 0 0 1 0 0 1 1];
b_d(1)=1; % initiate the d_(n-1)‘s d(1)=1
for i=2:1:symbol_num % get the d_(n-1)
b_d(i)=xor(b_org(i-1)b_d(i-1));
end
% generate the square series with message
for n=1:symbol_num*T
n_temp=ceil(n/T);
s_t(n)=b_d(n_temp);
end
% another way to generate the dpsk
s1=s_t.*carrier_sig;
s2=(ones(1symbol_num*T)-s_t).*(-carrier_sig);
%(-carrier means phase shift in pi)
s_t=s1+s2; % transmition signal is s_t
EbN0=20;
%%%%%%%%%%%%%%%%%%% creating the AWGN %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
mu=0;
N0=Eb/(10^(EbN0/10));
sigma=sqrt(N0*2);
gs_noise=normrnd(musigma[1 symbol_num*T]);
%another way: awgn(xsnr)
%gs_noise=zeros(1symbol_num*T);
%gs_noise=awgn(gs_noiseEbN0);
s_t1=s_t+gs_noise;
%s_t1=awgn(s_tEbN0‘measured‘);
%%%%%%%%%%%%%%%%%%%% Rx DPSK demodulation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% pass a bandpass filter to get R_temp
lowpassband=f_C-Rs;
highpassband=f_C+Rs;
order=40; % expecially the time of T
wn=[lowpassband highpassband]/(fs/2);
Filter_coefficient=fir1(orderwn);
R_temp=filter(Filter_coeffi
相关资源
- Matlab构造三角型脉冲和脉冲串
- GLRT_AMF_ACE程序源码matlab
- matlab的WEB方案
- 基于matlab的遗传算法源代码
- DCT图像压缩Matlab
- 基于小波阈值对语音信号降噪处理M
- MATLAB的voicebox工具箱
- 支持向量机非线性回归通用matlab程序
- 基于云模型的花卉特征提取matlab源代
- matlab仿真IMM算法
- 混合高斯建模加meanshift算法matlab代码
- matlab软件gossiping仿真
- FIR数字滤波器的设计和实现
- matlab2012a 破解license文件,亲测有效
- 基于meanshift的图像分割matlab代码
- MATLAB 2017a的licence文件,证书文件
-
matlab simuli
nk zigbee信号仿真 - KPCA(经典的MATLAB程序)
- AP聚类Matlab程序
- 贝叶斯方法matlab画图GUI界面
- matlab进行CRC编解码
- matlab图像修复
- matlab实现m-rife算法
- Matlab在系统辨识中的应用
- matlab 动态规划的实现
- MATLAB版超级玛丽源代码
- AODV MATLAB 实现
- 粒子滤波算法实现的目标被动跟踪m
- 模糊控制器的matlab设计步骤
- HSV查找颜色特征代码MATLAB
评论
共有 条评论