Home > WaveComBox > Example > BERComparisonFBMC_OFDM.m

BERComparisonFBMC_OFDM

PURPOSE ^

BER comparison between 2x2 FBMC-OQAM and CP-OFDM systems

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 BER comparison between 2x2 FBMC-OQAM and CP-OFDM systems

 Example showing a basic bit error rate (BER) comparison of an FBMC-OQAM and
 CP-OFDM 2x2 MIMO system using WaveComBox. Parameters of the two modulations,
 defined in structures ParaFBMC and ParaOFDM are flexible. For more
 information, one can refer to the help of each functions.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % BER comparison between 2x2 FBMC-OQAM and CP-OFDM systems
0002 %
0003 % Example showing a basic bit error rate (BER) comparison of an FBMC-OQAM and
0004 % CP-OFDM 2x2 MIMO system using WaveComBox. Parameters of the two modulations,
0005 % defined in structures ParaFBMC and ParaOFDM are flexible. For more
0006 % information, one can refer to the help of each functions.
0007 
0008 % This file is part of WaveComBox: www.wavecombox.com and is distributed under
0009 % the terms of the MIT license. See accompanying LICENSE file.
0010 % Original author: François Rottenberg, May 8, 2018.
0011 % Contributors:
0012 % Change log:
0013 
0014 
0015 %% Modulation parameters
0016 
0017 % Parameters of the FBMC-OQAM modulation (see definition of
0018 % FBMC_OQAM_InitializeChainParameters() for a definition of all modulation
0019 % parameters)
0020 ParaFBMC=InitializeChainParameters( 'FBMC-OQAM' ); % initialize parameters by default of the FBMC-OQAM chain
0021 ParaFBMC.ActiveSubcarriers=(11:ParaFBMC.nSubcarriers-10);
0022 ParaFBMC.Ns=100;
0023 ParaFBMC.N_T=2;
0024 ParaFBMC.N_R=2;
0025 ParaFBMC.S=min(ParaFBMC.N_T,ParaFBMC.N_R);
0026 
0027 % Parameters of the CP-OFDM modulation (see definition of
0028 % OFDM_InitializeChainParameters() for a definition of all modulation
0029 % parameters)
0030 ParaOFDM=InitializeChainParameters( 'CP-OFDM' ); % initialize the general parameters by default of the CP-OFDM chain
0031 ParaOFDM.ActiveSubcarriers=(11:ParaOFDM.nSubcarriers-10);
0032 ParaOFDM.Ns=100;
0033 ParaOFDM.N_T=2;
0034 ParaOFDM.N_R=2;
0035 ParaOFDM.S=min(ParaOFDM.N_T,ParaOFDM.N_R);
0036 
0037 
0038 %% Transmitter
0039 % FBMC-OQAM
0040 d_FBMC = GenerateData (ParaFBMC); % Generate data symbols
0041 s_FBMC = Modulator(d_FBMC, ParaFBMC ); % FBMC-OQAM modulation
0042 
0043 % CP-OFDM
0044 d_OFDM = GenerateData (ParaOFDM); % Generate data symbols
0045 s_OFDM = Modulator(d_OFDM, ParaOFDM ); % CP-OFDM modulation
0046 
0047 
0048 %% Channel
0049 nChannelRealizations=10; % number of channel realizations
0050 nSNR=5; % number of SNR considered
0051 Es_N0_dB=linspace(0, 20, nSNR); % SNR range
0052 
0053 temp_SER_FBMC=zeros(nChannelRealizations,nSNR);
0054 temp_SER_OFDM=zeros(nChannelRealizations,nSNR);
0055 
0056 for indexSNR=1:nSNR
0057     ParaFBMC.Es_N0_dB=Es_N0_dB(indexSNR);
0058     ParaOFDM.Es_N0_dB=Es_N0_dB(indexSNR);
0059     
0060     for indexChannelRealizations=1:nChannelRealizations
0061         
0062         C=GenerateRayleighChannelReal('ITU_VehA', ParaFBMC); %
0063         
0064         r_FBMC = Channel_Multipath( s_FBMC, C ); % Multipath channel
0065         r_FBMC = Channel_AWGN( r_FBMC, ParaFBMC ); % AWGN channel, SNR fixed in Para
0066         
0067         r_OFDM = Channel_Multipath( s_OFDM, C ); % Multipath channel
0068         r_OFDM = Channel_AWGN( r_OFDM, ParaOFDM ); % AWGN channel, SNR fixed in Para
0069         
0070         %% Receiver
0071         % FBMC-OQAM demodulation and conventional single-tap equalization
0072         z_FBMC = Demodulator( r_FBMC, ParaFBMC ); % FBMC demodulation
0073         [ x, ~ ] = Equalizer( z_FBMC, C, ParaFBMC, 'SingleTap' ); % Single-tap equalization
0074         d_hat = real(x);
0075         
0076         mod_norm=sqrt(ParaFBMC.Es/(ParaFBMC.S)/(1./ParaFBMC.M_PAM^2.*sum(abs(qammod([0:ParaFBMC.M_PAM^2-1],ParaFBMC.M_PAM^2)).^2)));
0077         temp_SER_FBMC(indexChannelRealizations,indexSNR)=sum(sum(sum( pamdemod(d_hat/mod_norm,ParaFBMC.M_PAM)~=pamdemod(d_FBMC/mod_norm,ParaFBMC.M_PAM)  )))/(2*ParaFBMC.Ns*ParaFBMC.S*length(ParaOFDM.ActiveSubcarriers));
0078         
0079         % CP-OFDM demodulation and conventional single-tap equalization
0080         z_OFDM = Demodulator( r_OFDM, ParaOFDM ); % OFDM demodulation
0081         [ d_hat, ~ ] = Equalizer( z_OFDM, C, ParaOFDM, 'SingleTap'); % Single-tap equalization
0082         
0083         mod_norm=sqrt(ParaOFDM.Es/(ParaOFDM.S)/(1./ParaOFDM.M_QAM.*sum(abs(qammod([0:ParaOFDM.M_QAM-1],ParaOFDM.M_QAM)).^2)));
0084         temp_SER_OFDM(indexChannelRealizations,indexSNR)=sum(sum(sum( qamdemod(d_hat/mod_norm,ParaOFDM.M_QAM)~=qamdemod(d_OFDM/mod_norm,ParaOFDM.M_QAM)  )))/(ParaOFDM.Ns*ParaOFDM.S*length(ParaOFDM.ActiveSubcarriers));
0085         
0086     end
0087     indexSNR
0088 end
0089 BER_FBMC=mean(temp_SER_FBMC,1)/log2(ParaFBMC.M_PAM);
0090 BER_OFDM=mean(temp_SER_OFDM,1)/log2(ParaOFDM.M_QAM);
0091 
0092 %% Plot performance metrics
0093 figure
0094 semilogy(Es_N0_dB,BER_FBMC,'-xb','LineWidth',1.5,'MarkerSize',8,'MarkerEdgeColor','k','MarkerFaceColor','w')
0095 hold on
0096 semilogy(Es_N0_dB,BER_OFDM,'--xr','LineWidth',1.5,'MarkerSize',8,'MarkerEdgeColor','k','MarkerFaceColor','w')
0097 
0098 grid
0099 xlabel('E_S/N_0 [dB]')
0100 ylabel('Bit error rate')
0101 % xlim([10,2*M-1])
0102 % ylim([3*1e-4,1e0])
0103 legend('FBMC-OQAM','CP-OFDM','Location','SouthWest')
0104 
0105 
0106

Generated on Mon 24-Jun-2019 13:51:48 by m2html © 2005