资源简介
OFDM调制解调程序 MATLAB源代码
详细注释
代码片段和文件信息
%用m语言编制主程序如下:
clear all;
clc;
%----------------------preparation part -----------------------------
sr=256000.0; % symboll rate
ml=2; % number of modulation levels
br=sr*ml; % bit rate
nd=100; % number of symbol
ebno=8; % Ebno
%-----------------------------------------------Filter initialization-----------------
irfn=21;
IPOINT=8;
alfs=0.5;
[xh]=hrollfcoef(irfnIPOINTsralfs1); % Transmitting Filter
[xh2]=hrollfcoef(irfnIPOINTsralfs0); % Received Filter
%------------------------------ Spreading code initialization--------------------
user=1; % number of users
seq=1; % 1:m-sequence 2:Gold 3:orthogonal Gold
stage=3;
ptap1=[1 3];
ptap2=[2 3];
regi1=[1 1 1];
regi2=[1 1 1];
% ----------------------------- Generation of the spreading code --------
switch seq
case 1
code=mseq(stageptap1regi1user);
case 2
m1=mseq(stageptap1regi1);
m2=mseq(stageptap2regi2);
code=goldseq(m1m2user);
case 3
m1=mseq(stageptap1regi1);
m2=mseq(stageptap2regi2);
code=[goldseq(m1m2user)zeros(user1)];
end
code=code*2-1;
clen=length(code);
% ---------------------------------- Fading initialization ---------------
rfade=0; % Rayleigh fading 0:nothing 1:consider
itau=[08]; % delay time
dlvl1=[0.040.0]; % attenuation level
n0=[67];
th1=[0.00.0];
itnd1=[30014004];
now1=2;
tstp=1/sr/IPOINT/clen; % time resolution
fd=160;
flat=1;
itnde1=nd*IPOINT*clen*30;
% ----------------------------- Start calculation -------------
nloop=1000;
noe=0;
nod=0;
for ii=1:nloop
% -------------------------- Transmitter ---------------------
data=rand(usernd*ml)>0.5;
[ichqch]=qpskmod(datauserndml);
[ich1qch1]=spread(ichqchcode);
[ich2qch2]=compoversamp2(ich1qch1IPOINT);
[ich3qch3]=compconv2(ich2qch2xh);
if user==1
ich4=ich3;
qch4=qch3;
else
ich4=sum(ich3);
qch4=sum(qch3);
end
% -------------------------- Fading channel -------------------
if rfade==0
ich5=ich4;
qch5=qch4;
else
[ich5qch5]=sefade(ich4qch4itaudlvl1th1n0itnd1...
now1length(ich4)tstpfdflat);
itnd1=itnd1+itnde1;
end
% ---------------------------------- Receiver -----------------------------
spow=sum(rot90(ich3.^2+qch3.^2))/nd;
attn=sqrt(0.5*spow*sr/br*10^(-ebno/10));
[ich6qch6]=comb2(ich5qch5attn);
[ich7qch7]=compconv2(ich6qch6xh2); % filter
samp1=irfn*IPOINT+1;
ich8=ich7(:samp1:IPOINT:IPOINT*nd*clen+samp1-1);
qch8=qch7(:samp1:IPOINT:IPOINT*nd*clen+samp1-1);
[ich9 qch9]=despread(ich8qch8code);
demodata=qpskdemod(ich9qch9userndml); % QPSK demodulation
%--
- 上一篇:简单的声音滤波 matlab
- 下一篇:粒子滤波算法 matlab
相关资源
- 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
- k近邻算法matlab实现
评论
共有 条评论