📄 receiver.m
字号:
rfunction out_bits_H = receiver(in_bits_freq, channel_H, index);
% this function is to do decoding job
% the input date is a vblast symbel & the channel of frequency field
% here I will first do the simulation by the paper of M<N
% input parameter "in_bits_freq " is in_bits_freq is the frequency field symbols after
% V_blast-OFDM
% input parameter "channel_H " channel_H is the Channel MAtrix of
% Frequency field
% input parameter "index " is the mapping parameter,such as 64QAM etc..
%----------------------------------------------------------------
% Channel
%----------------------------------------------------------------
if 0
%function channel = firChannel(m_transmitter, n_receiver, n_fir);
chan_h = firChannel(m_transmitter, n_receiver, fir_len);
channel_H = gen_freq_H(chan_h, N_point_FFT);
save channel_H channel_H;
% first load the channel of frequency field
load Channel_H;
end
%----------------------------------------------------------------
%----------------------------------------------------------------
%----------------------------------------------------------------
% Receiver side
%----------------------------------------------------------------
% as the receiver side,here we use the
% a(m) = [a_m(1) a_m(2) ... a_m(G)]
% a_tag = [a_tag_1 ......a_tag_M 1: MG
% Y = S * H + N_f;
Y_out = in_bits_freq * Channel_H;
signal_level_Y = mean(abs(in_bits_freq).^2);
signal_level_Y_dB = 10*log10(signal_level_Y);
decoder_input_Y = awgn(Y_out,(SNR_dB + 10*log10(index)),signal_level_Y_dB); % step 1
% Z = S * A * H + N_f;
% a_tag = gen_tag(m_transmitter, N_point_FFT);
A_tag = diag(gen_tag(m_transmitter, N_point_FFT));
save A_tag A_tag;
%load A_tag;
Z_out = in_bits_freq * A_tag * Channel_H;
signal_level_Z = mean(abs(in_bits_freq).^2);
signal_level_Z_dB = 10*log10(signal_level_Z);
decoder_input_Z = awgn(Z_out,(SNR_dB + 10*log10(index)),signal_level_Z_dB);
R_YY = decoder_input_Y * decoder_input_Y';
R_ZY = decoder_input_Z * decoder_input_Y';
[V,D] = eig(R_YY); % step 2
sigma2 = sum(mju(1,M*G+1:K));
if SNR_dB < 50
% Y = S .* H + N_f;
decoder_input = awgn(channel_output,(SNR_dB + 10*log10(index)),signal_level_dB);
else
decoder_input = channel_output;
end
Y = S .* H + N_f;
sigma_2 = (K - M * G) * sum(mju( M * G + 1 : K);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -