%* File Name: detectit.m
%* Function Name: detectit()
%* Description: one detection algorithm (hard decision at this version)
%*
%* Current Version: 0.1
%* Time: 27.3.2008
%* Programmer: Neo
function detected = detectit(bits_modu,modu)
% variables
Eucli_dis10 = zeros(1,2^(modu-1)); % vector for Euclidian distance
Eucli_dis11 = zeros(1,2^(modu-1));
Eucli_dis20 = zeros(1,2^(modu-1));
Eucli_dis21 = zeros(1,2^(modu-1));
Eucli_dis30 = zeros(1,2^(modu-1));
Eucli_dis31 = zeros(1,2^(modu-1));
Eucli_dis40 = zeros(1,2^(modu-1));
Eucli_dis41 = zeros(1,2^(modu-1));
Eucli_dis50 = zeros(1,2^(modu-1));
Eucli_dis51 = zeros(1,2^(modu-1));
Eucli_dis60 = zeros(1,2^(modu-1));
Eucli_dis61 = zeros(1,2^(modu-1));
constel = zeros(1,2^modu); % constellations
counter1 = 1; % counters
counter2 = 1;
counter3 = 1;
counter4 = 1;
counter5 = 1;
counter6 = 1;
counter7 = 1;
counter8 = 1;
counter9 = 1;
counter10 = 1;
counter11 = 1;
counter12 = 1;
if modu == 1
constel = exp(j*[0 -pi]);
constel = constel([1 0]+1);
elseif modu == 2
constel = exp(j*[-3/4*pi 3/4*pi 1/4*pi -1/4*pi]);
constel = constel([2 3 1 0]+1);
elseif modu == 4
counter_1 = 1;
for counter_2 = -3:2:3
for counter_3 = -3:2:3
constel(counter_1) = (counter_2+j*counter_3)/sqrt(10); % power normalization
counter_1 = counter_1 + 1;
end;
end;
constel = constel([0 1 3 2 4 5 7 6 12 13 15 14 8 9 11 10]+1);
elseif modu == 6
counter_1 = 1;
for counter_2 = -7:2:7
for counter_3 = -7:2:7
constel(counter_1) = (counter_2+j*counter_3)/sqrt(42); % power normalization
counter_1 = counter_1 + 1;
end;
end;
constel = constel([[ 0 1 3 2 7 6 4 5]...
8+[ 0 1 3 2 7 6 4 5]...
24+[ 0 1 3 2 7 6 4 5]...
16+[ 0 1 3 2 7 6 4 5]...
56+[ 0 1 3 2 7 6 4 5]...
48+[ 0 1 3 2 7 6 4 5]...
32+[ 0 1 3 2 7 6 4 5]...
40+[ 0 1 3 2 7 6 4 5]]+1);
else
error('Unimplemented modulation');
end
%-------------------------------computer first bit LLR value---------------
if modu == 2
for counter0 = 1:2^modu
if real(constel(1,counter0)) > 0
Eucli_dis10(1,counter1) = abs(bits_modu-constel(counter0));
counter1 = counter1+1;
else
Eucli_dis11(1,counter2) = abs(bits_modu-constel(counter0));
counter2 = counter2+1;
end
end
%-------------------------------computer second bit LLR value--------------
for counter0 = 1:2^modu
if imag(constel(1,counter0)) > 0
Eucli_dis20(1,counter3) = abs(bits_modu-constel(counter0));
counter3 = counter3+1;
else
Eucli_dis21(1,counter4) = abs(bits_modu-constel(counter0));
counter4 = counter4+1;
end
end
LLR0 = min( Eucli_dis10)/min( Eucli_dis11);
LLR1 = min( Eucli_dis20)/min( Eucli_dis21);
detected = [log(LLR0) log(LLR1)] ;
elseif modu == 4 %16QAM---LLR
for counter0 = 1:2^modu
%第一个比特
%--------------------find the first bit is 0 in the constel----------------------------------
if real(constel(1,counter0)*sqrt(10)) == -1
Eucli_dis10(1,counter1) = abs(bits_modu-constel(counter0));
counter1 = counter1+1;
end
if real(constel(1,counter0)*sqrt(10)) == -3
Eucli_dis10(1,counter1) = abs(bits_modu-constel(counter0));
counter1 = counter1+1;
end
%------------------find the first bit is 1 in the constel---------------------------------------
if real(constel(1,counter0)*sqrt(10)) == 1
Eucli_dis11(1,counter2) = abs(bits_modu-constel(counter0));
counter2 = counter2+1;
end
if real(constel(1,counter0)*sqrt(10)) == 3
Eucli_dis11(1,counter2) = abs(bits_modu-constel(counter0));
counter2 = counter2+1;
end
end
%----------------------computer the first bit------------------------------------------------
LLR1 = min(Eucli_dis10)/min(Eucli_dis11);
%--------------------------------------------------------------------------------------------
%第二个比特
for counter0 = 1:2^modu
%--------------------find the second bit is 0 in the constel--------------------------------------
if real(constel(1,counter0)*sqrt(10)) == 3
Eucli_dis20(1,counter3) = abs(bits_modu-constel(counter0));
counter3 = counter3+1;
end
if real(constel(1,counter0)*sqrt(10)) == -3
Eucli_dis20(1,counter3) = abs(bits_modu-constel(counter0));
counter3 = counter3+1;
end
%--------------------find the second bit is 1 in the constel------------------------------------
if real(constel(1,counter0)*sqrt(10)) == 1
Eucli_dis21(1,counter4) = abs(bits_modu-constel(counter0));
counter4 = counter4+1;
end
if real(constel(1,counter0)*sqrt(10)) == -1
Eucli_dis21(1,counter4) = abs(bits_modu-constel(counter0));
counter4 = counter4+1;
end
end
%----------------------computer the second bit-------------------------------------------
LLR2 = min(Eucli_dis20)/min(Eucli_dis21);
%----------------------------------------------------------------------------------------
%第三个比特
for counter0 = 1:2^modu
%--------------------find the third bit is 0 in the constel---------------------------------
if imag(constel(1,counter0)*sqrt(10)) == -1
Eucli_dis30(1,counter5) = abs(bits_modu-constel(counter0));
counter5 = counter5+1;
end
if imag(constel(1,counter0)*sqrt(10)) == -3
Eucli_dis30(1,counter5) = abs(bits_modu-constel(counter0));
counter5 = counter5+1;
end
%--------------------find the third bit is 1 in the constel--------------------------------
if imag(constel(1,counter0)*sqrt(10)) == 1
Eucli_dis31(1,counter6) = abs(bits_modu-constel(counter0));
counter6 = counter6+1;
end
if imag(constel(1,counter0)*sqrt(10)) == 3
Eucli_dis31(1,counter6) = abs(bits_modu-constel(counter0));
counter6 = counter6+1;
end
end
%----------------------computer the third bit--------------------------------------------
LLR3 = min(Eucli_dis30)/min(Eucli_dis31);
%----------------------------------------------------------------------------------------
%第四个比特
for counter0 = 1:2^modu
%--------------------find the fouth bit is 0 in the constel------------------------------
if imag(constel(1,counter0)*sqrt(10)) == 3
Eucli_dis40(1,counter7) = abs(bits_modu-constel(counter0));
counter7 = counter7+1;
end
if imag(constel(1,counter0)*sqrt(10)) == -3
Eucli_dis40(1,counter7) = abs(bits_modu-constel(counter0));
counter7 = counter7+1;
end
%--------------------find the fouth bit is 0 in the constel---------------------------
if imag(constel(1,counter0)*sqrt(10)) == 1
Eucli_dis41(1,counter8) = abs(bits_modu-constel(counter0));
counter8 = counter8+1;
end
if imag(constel(1,counter0)*sqrt(10)) == -1
Eucli_dis41(1,counter8) = abs(bits_modu-constel(counter0));
counter8 = counter8+1;
end
end
LLR4 = min(Eucli_dis40)/min(Eucli_dis41);
detected = [log(LLR1) log(LLR2) log(LLR3) log(LLR4)];
else %64QAM软比特信息
%------------------the first bit------------------------------
for counter0 = 1:2^modu
if real(constel(counter0)*sqrt(42)) < 0
Eucli_dis10(1,counter1) = abs(bits_modu-constel(counter0));
counter1 = counter1+1;
else
Eucli_dis11(1,counte
没有合适的资源?快使用搜索试试~ 我知道了~
Matlab实现SC-FDMA 上传版本.zip
共119个文件
m:64个
mat:25个
asv:20个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 195 浏览量
2022-06-28
21:28:57
上传
评论
收藏 206KB ZIP 举报
温馨提示
Matlab实现SC-FDMA 上传版本.zip
资源详情
资源评论
资源推荐
收起资源包目录
Matlab实现SC-FDMA 上传版本.zip (119个子文件)
papr_pro6.5dB16qam 2KB
ber_pro6.5dB16qam 426B
papr_pro_6.5dB_16qam 2KB
ber_pro_6.5dB_16qam 426B
detectit_new.asv 12KB
detectit(new).asv 11KB
channel_esti0.asv 10KB
channel_esti.asv 8KB
detectit.asv 7KB
bandpass_filter.asv 5KB
curr_channel_esti.asv 3KB
hdb3.asv 3KB
transmit.asv 3KB
dd_esti_method.asv 2KB
channel_fade.asv 2KB
awgn_channel.asv 2KB
sim.asv 2KB
cp_rs.asv 952B
rx_qam16_demod.asv 833B
gonglvpu.asv 666B
gen_pre_sym.asv 374B
diff_pro.asv 293B
dopp_shift.asv 233B
sim_depart.asv 197B
papr-16qam-k4A6dB.eps 37KB
ber-16qam-k4A6dB.eps 28KB
papr-16qam-k=4A6dB.fig 29KB
ber-16qam-k4A6dB.fig 25KB
detectit_new.m 12KB
channel_esti0.m 10KB
detectit.m 7KB
transmit_data.m 7KB
main.m 6KB
fd_esti.m 5KB
bandpass_filter.m 5KB
receive.m 5KB
tx_modulate.m 4KB
logmapo.m 4KB
bandpass_filter(备份).m 4KB
curr_channel_esti.m 3KB
hdb3.m 3KB
set_channel_parameters.m 3KB
add_gnoise.m 3KB
channel_ray.m 3KB
channel_esti_time.m 2KB
rx_decode.m 2KB
hst_channel.m 2KB
channel_fade.m 2KB
encoderm.m 2KB
dd_esti_method.m 2KB
awgn_channel.m 2KB
trellis.m 2KB
channel_fade_mobile.m 2KB
channel_fade1.m 2KB
channel.m 2KB
bandpass_filter_1.m 1KB
perform_compare.m 1KB
rx_qam64_demod.m 1KB
viterbi_decode.m 1KB
rx_equalize.m 1KB
iir_bandpass_filter.m 1KB
depart_mod.m 1KB
demultiplex.m 1KB
rsc_encode.m 1KB
gonglvpu.m 1KB
Turbo_decode.m 1KB
channel_esti.m 1KB
rs_estimate.m 1KB
cp_rs.m 1KB
conv_code.m 1005B
rscp_mod.m 943B
rx_deinterleaver.m 827B
tx_interleaver.m 807B
performance_16qam.m 756B
init_viterbi.m 753B
rx_demodu.m 668B
encode_bit.m 653B
tx_encode.m 650B
16qam.m 601B
gen_fade_wave.m 580B
set_consts.m 548B
diff_pro.m 479B
rx_qam16_demod.m 452B
bin_state.m 437B
cp_rs_time.m 310B
remove_cp.m 302B
my_g.m 299B
gen_pre_sym.m 293B
int_state.m 281B
dopp_shift.m 256B
ifft_mod.m 213B
sim_depart.m 197B
papr_pro_65dB_16qam_v5.mat 2KB
papr_pro_65dB_16qam_640.mat 2KB
papr_pro_65dB_16qam.mat 2KB
papr_pro_65dB_16qam_645.mat 2KB
papr_pro.mat 2KB
papr_pro_65dB_16qam_v5_MMSE.mat 2KB
papr_pro_65dB_16qam2.mat 2KB
papr_cl.mat 1KB
共 119 条
- 1
- 2
天天Matlab科研工作室
- 粉丝: 2w+
- 资源: 7252
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1