Home > WaveComBox > Example > CP_OFDM > ChannelEstimationAndEqualization.m

ChannelEstimationAndEqualization

PURPOSE ^

Channel estimation and equalization for MIMO CP-OFDM

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Channel estimation and equalization for MIMO CP-OFDM

 Example showing how to perform preamble-based channel estimation and
 equalize the channel of a MIMO CP-OFDM system under frequency selective
 channel.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Channel estimation and equalization for MIMO CP-OFDM
0002 %
0003 % Example showing how to perform preamble-based channel estimation and
0004 % equalize the channel of a MIMO CP-OFDM system under frequency selective
0005 % channel.
0006 
0007 % This file is part of WaveComBox: www.wavecombox.com and is distributed under
0008 % the terms of the MIT license. See accompanying LICENSE file.
0009 % Original author: François Rottenberg, May 8, 2018.
0010 % Contributors:
0011 % Change log:
0012 
0013 % Definition of general Parameters
0014 Para=InitializeChainParameters( 'CP-OFDM' ); % initialize parameters of the FBMC-OQAM chain
0015 Para.ActiveSubcarriers= 2:Para.nSubcarriers;
0016 Para.M_PAM=2;
0017 Para.Ns=1000;
0018 Para.N_T=2;
0019 Para.N_R=2;
0020 Para.S=min(Para.N_R,Para.N_T);
0021 Para.Es_N0_dB=15;
0022 Para
0023 
0024 % Parameters of the preamble
0025 Para.PreamblePilotSubcarriers=Para.ActiveSubcarriers;
0026 Para.PreambleLength=Para.N_T;
0027 A=sqrt(length(Para.ActiveSubcarriers)/(length(Para.PreamblePilotSubcarriers) ));
0028 d_TR=A.*((randi([0 1],Para.nSubcarriers,1))*2-1);
0029 
0030 
0031 %% Transmitter
0032 
0033 % Preamble generation
0034 d_preamble=GeneratePreamble(d_TR, Para);
0035 % Data payload
0036 d_data = GenerateData (Para); % Generate real PAM symbols
0037 % Synthesis filterbank
0038 d=MergePreambleData(d_preamble,d_data,Para);
0039 s = Modulator(d, Para ); % CP-OFDM modulation
0040 
0041 %% Channel
0042 C=GenerateRayleighChannelReal('ITU_VehA', Para);
0043 r = Channel_Multipath( s, C ); % Multipath channel
0044 r=Channel_AWGN( r, Para ); % AWGN channel, SNR fixed in Para
0045 
0046 %% Receiver
0047 z = Demodulator( r, Para ); % CP-OFDM demodulation
0048 [ z_preamble,z_data ] = SeparatePreambleData(z,Para);
0049 
0050 % Channel estimation (algorithm uses an a-priori on the channel impulse
0051 % response length in TD)
0052 L=length(C(1,1,:));
0053 C_est=ChannelEstimator(z_preamble,L,d_TR, Para);
0054 
0055 % Conventional single-tap equalizer
0056 ParaEqualizer.criterion='MMSE'; % Criterion chosen to design each equalizer
0057 [ d_hat, B ] = Equalizer( z_data, C_est, Para, 'SingleTap', ParaEqualizer );
0058 
0059 %% Compute performance metrics and plot results
0060 
0061 % Channel estimation
0062 figure
0063 plot(squeeze(real(fft(squeeze(C(1,1,:)),Para.nSubcarriers))),'-b')
0064 hold on
0065 Htemp=fft(squeeze(C_est(1,1,:)),Para.nSubcarriers);
0066 plot(real(Htemp),'xb')
0067 xlim([min(Para.ActiveSubcarriers) max(Para.ActiveSubcarriers)])
0068 xlabel('Subcarrier index')
0069 ylabel('Channel frequency response')
0070 legend('True', 'Estimated')
0071 
0072 
0073 % MSE of estimated symbols
0074 MSE = MSEComputes( d_data, d_hat, Para );
0075 
0076 figure
0077 plot(Para.ActiveSubcarriers, 10*log10(MSE),'-xb','markersize',8,'linewidth',1.5)
0078 xlabel('Subcarrier index')
0079 ylabel('MSE [dB]')
0080 xlim([min(Para.ActiveSubcarriers) max(Para.ActiveSubcarriers)])

Generated on Mon 14-Oct-2019 13:48:34 by m2html © 2005