两种OFDM系统信道估计算法的比较研究及MATLAB仿真-毕业论文 联系客服

发布时间 : 星期二 文章两种OFDM系统信道估计算法的比较研究及MATLAB仿真-毕业论文更新完毕开始阅读49a2c2d97cd184254a353589

齐鲁工业大学 2014 届本科毕业设计(论文)

[dlamda_sort,IN]=sort(dlamda);%按升序排列各特征值,dlamda_sort为排序结果,IN为各元素在原向量中的位置索引 for k=1:N

lamda_sort(k)=dlamda_sort(N-k+1);%按照降序排列各特征值 IN_new(k)=IN(N-k+1); end

%以下按照IN_new顺序排列U的各列 U_new=zeros(N,N); for k=1:N

U_new(:,k)=U(:,IN_new(k)); end

%以下只取前cp个特征值构成新的对角阵

delta=zeros(N,1); for k=1:N if k<=cp

delta(k)=lamda_sort(k)/(lamda_sort(k)+beta/snr); else

delta(k)=0; end end

D_new=diag(delta);

output=zeros(N,NL-pilot_num); i=1; count=0; while i<=NL

Hi=input(:,i)./pilot_sequence;

Hlr=U_new*D_new*(U_new')*Hi; count=count+1;

if count*pilot_inter<=(NL-pilot_num)

for p=((count-1)*pilot_inter+1):count*pilot_inter

output(:,p)=input(:,(i+p-(count-1)*pilot_inter))./Hlr; end else

for p=((count-1)*pilot_inter+1):(NL-pilot_num)

output(:,p)=input(:,(i+p-(count-1)*pilot_inter))./Hlr; end end

i=i+pilot_inter+1; end

...............................................ls_estimation.m.................................................................fu

34

齐鲁工业大学 2014 届本科毕业设计(论文)

nction output=ls_estimation(input,pilot_inter,pilot_sequence,pilot_num); [N,NL]=size(input);

output=zeros(N,NL-pilot_num); i=1; count=0;

while i<=NL

Hi=input(:,i)./pilot_sequence; count=count+1;

if count*pilot_inter<=(NL-pilot_num)

for j=((count-1)*pilot_inter+1):count*pilot_inter output(:,j)=input(:,(i+j-(count-1)*pilot_inter))./Hi; end else

for j=((count-1)*pilot_inter+1):(NL-pilot_num)

output(:,j)=input(:,(i+j-(count-1)*pilot_inter))./Hi; end end

i=i+pilot_inter+1; end

................................................map_16qam.m............................................. function output=map_16qam(input)%完成一个ofdm块的16QAM映射 [N,NL]=size(input); N=N/4;

output=zeros(N,NL); for j=1:NL for n=1:N

for ic=1:4

qam_input(ic)=input((n-1)*4+ic,j); %每次取4个bit end

output(n,j)=qam16(qam_input); %output每一列为一次FFT运算的信号,与一个ofdm符号结构相似

end

end

...........................................multipath_chann.m........................................................... function

output_sig=multipath_chann(input_sig,num,var_pow,delay,fd,t_interval,counter,count_begin)

%input_sig输入信号矩阵,加了cp后的信号,大小为NL×(子载波个数+cp长度lp);

35

齐鲁工业大学 2014 届本科毕业设计(论文)

%num多径数;

%var_pow各径相对主径的平均功率,单位dB; Tlay各径延时,单位s; y最大dopple频率;

%t_interval为离散信道抽样时间间隔,等于OFDM符号长度/(子载波个数+cp长度lp);

%output_sig为经过多径信道的输出信号矢量 %counter各径间隔记录

%count_begin本次产生信道开始记录的初始位置 t_shift=floor(delay/t_interval);%归一化各径延时 %theta_shift=2*pi*fc*delay; [nl,l]=size(input_sig);

output_sig=zeros(size(input_sig));

chann_l=nl*l;%信道采样点数,若一个调制符号采样一个信道点,则信道采样点数等于输入信号中的调制符号个数

selec_ray_chan=zeros(num,chann_l);%初始化频率选择性信道,径数=num pow_per_channel=10.^(var_pow/10);%各径功率线性化,从dB转变成线性 total_pow_allchan=sum(pow_per_channel);%各径功率之和 %以下for循环产生相互独立的num条rayleigh信道

for k=1:num

atts=sqrt(pow_per_channel(k));

selec_ray_chan(k,:)=atts*rayleighnew(chann_l,t_interval,fd,count_begin+k*counter)/sqrt(total_pow_allchan); end

for k=1:l

input_sig_serial(((k-1)*nl+1):k*nl)=input_sig(:,k).';%输入信号矩阵转变成串行序列 end

delay_sig=zeros(num,chann_l);%初始化延时后的送入各径的信号,每径所含符号数为chann_l

%以下for循环为各径的输入信号做延迟处理

for f=1:num

if t_shift(f)~=0

delay_sig(f,1:t_shift(f))=zeros(1,t_shift(f)); end

delay_sig(f,(t_shift(f)+1):chann_l)= input_sig_serial(1:(chann_l-t_shift(f))); end

36

齐鲁工业大学 2014 届本科毕业设计(论文)

output_sig_serial=zeros(1,chann_l);%初始化输出信号串行序列 %得到各径叠加后的输出信号序列

for f=1:num

output_sig_serial= output_sig_serial+selec_ray_chan(f,:).*delay_sig(f,:); end

for k=1:l

output_sig(:,k)=output_sig_serial(((k-1)*nl+1):k*nl).';

%输出信号串行序列转变成与输入信号相同的矩阵形式,做为本函数输出 end

%注意,在本函数中没有为信号叠加白噪声

......................................................rayleighnew.m............................................. function ray_chann=rayleighnew(nsamp,tstp,fd,counter)

%****************** variables ************************* % idata : input Ich data % qdata : input Qch data % iout : output Ich data % qout : output Qch data

% ramp : Amplitude contaminated by fading % rcos : Cosine value contaminated by fading % rsin : Cosine value contaminated by fading

% nsamp : Number of samples to be simulated % tstp : Minimum time resolution % fd : maximum doppler frequency % no : number of waves in order to generate fading % counter : fading counter % flat : flat fading or not

% (1->flat (only amplitude is fluctuated),0->nomal(phase and amplitude are fluctutated) %****************************************************** no=25;

if fd ~= 0.0

ac0 = sqrt(1.0 ./ (2.0.*(no + 1))); % power normalized constant(ich) as0 = sqrt(1.0 ./ (2.0.*no)); % power normalized constant(qch) %ic0 = counter; % fading counter pai = 3.14159265; wm = 2.0.*pai.*fd; n = 4.*no + 2; ts = tstp;

wmts = wm.*ts;

paino = pai./no; xc=zeros(1,nsamp);

37