资源简介
用MATLAB(BPSK仿真+直接扩频)
代码片段和文件信息
%*********************BINARY PHASE SHIFT KEYING *******************
%
% Simulation of BPSK system in presence of Additive White Guassian Noise
% and Rayleigh fading and Dopper shift and using SPREAD SPECTRUM TECH
%
%******************DIRECT SEQUENCE SPREAD SEQUENCE******************
clear all
clc
f_data=1; % DATA FREQUENCY
f_chip=11; % LENGTH OF CHIP SEQUENCE
fc=220; % RELATIVE CARRIER FREQUENCY
fs=fc*3; % SAMPLING FREQUENCY
N=fs/f_chip; % CODING RATE
data_length=1000;
M=2; % BINARY LEVEL CODING
matches=0;
errors=0;
count=1;
SNRpbit=0;
SNR=SNRpbit;
rand(‘state‘12345); % INITIALISATION ‘SEED‘
randn(‘state‘54321);
numplot=100;
msg_unspread=randsrc(data_length1[0:M-1]); % GENERATION OF RANDOM DATA
PN_sequence=randsrc(111[0:1]); % GENERATION OF PN SEQUENCE
% GENERATION OF SPREADED MESSAGE
j=1;
for i = 1:data_length
for k = j:j+f_chip
msg_orig(k) = msg_unspread(i);
end;
msg_orig(j:(j+f_chip-1)) = xor(msg_orig(j:(j+f_chip-1))‘PN_sequence(1:f_chip));
j = f_chip*i+1;
end;
len_of_orig=length(msg_orig);
% MODULATING THE SPREAD MESSAGE
msg_tx=dmod(msg_origfcf_chipfs‘psk‘M);
len_of_tx=length(msg_tx);
% % RAYLEIGH COEFFICIENTS
% magT=abs(T);
%
% % ADDING RAYLEGH FADING COEFFICIENTS
% k=1;
% for i=1:len_of_tx
% msg_tx(1i)=msg_tx(1i)*10*magT(1k);
% if(mod(ik))
% k=k+300;
% end ;
% end;
% PERFORMANCE ANALYSIS FOR VARYING SNR‘S
for SNRpbit=0:1:7
SNR=SNRpbit;
rand(‘state‘12345);
randn(‘state‘54321);
% ADDING AWGN TO THE SIGNAL
msg_rx_data=awgn(msg_txSNR-10*log10(N)‘measured‘‘dB‘);
% plot(tmsg_rx(1:length(t))‘b-‘);
msg_rx= msg_rx_data ;
msg_rx=msg_tx;
% DEMODULATING THE RECEIVED SIGNAL
msg_demod=ddemod(msg_rxfcf_chipfs‘psk‘M);
% CORRELATING WITH THE PN SEQUENCE
j=1;
for i = 1:data_length
msg_demod(j:(j+f_chip-1)) = xor(msg_demod(j:(j+f_chip-1))‘PN_sequence(1:f_chip));
j = f_chip*i+1;
end;
% DESPREADING THE RECEIVED SIGNAL
j=1;
for i = 1:data_length
sum=0;
for k = j:j+f_chip
sum=sum+msg_demod(k);
end;
if (sum >=7)
msg_demod_rec(i)=1;
else
msg_demod_rec(i)=0;
end;
j = f_chip*i+1;
end;
% CALCULATION OF ERRORS
for i=1:data_length;
if (msg_demod_rec(1i)== msg_unspread(i1))
matches=matches+1;
else
errors=errors+1;
end ;
end;
% BER_ray(count)=errors/data_length;
BER_awgn(count)=errors/data_length;
%BER_theo(count)=0.07*erfc(SNR^0.5);
count=count+1;
errors=0;
end;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 698 2003-05-14 20:38 read_me.txt
文件 2855 2006-05-04 19:40 bpsk_spread.m
文件 1485 2003-04-28 15:10 jakesmodel.m
----------- --------- ---------- ----- ----
5038 3
- 上一篇:最小二乘法曲线拟合(MATLAB)
- 下一篇:实例matlab 编程100个常用程序
相关资源
- 实例matlab 编程100个常用程序
- 最小二乘法曲线拟合(MATLAB)
- 基于BP神经网络对几种字体0-9的数字识
- 多用户检测MATLAB程序
- MATLAB实现的BPSK调制解调
- 基于区域生长的图像分割MATLAB
- 龚纯《精通MATLAB最优化计算》随书源
- 基于matlab 的图像处理100实例
- FNN MATLAB实现
- 实现2ask.4ask.2fsk.4fsk.qam16.qam8调制的m
- 8领域边界跟踪 图像处理 matlab
- GPS卫星轨道动态仿真MATLAB
- 细胞图像分割matlab代码
- 图像的二进小波分解matlab源码(保证
- 基于MATLAB的线性控制系统分析与设计
- matlab 计算矩阵中不同元素个数的函数
- 基于MP的时频分析MATLAB代码
- matlab版的车牌识别程序
- 工程优化问题的Matlab实现代码
- 数字信号处理 matlab实验源程序吴镇扬
- matlab编写的susan算法程序
- 用MATLAB编写的离散余弦变换编码
- Matlab图像二值化和逆向二值化
- matlab-图像处理算法
- GaussJordan解线性方程组-matlab
- vc下实现的分段线性插值、二次多项式
- matlab 手动画图 描点画图
- p文件,MATLAB的
- MATLAB_dct
- 战胜MATLAB必做的50道题
评论
共有 条评论