资源简介
可直接运行的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_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论