Home > WaveComBox > Example > F_OFDM > SISO_commun_F_OFDM_OFDM.m

SISO_commun_F_OFDM_OFDM

PURPOSE ^

SISO F_OFDM and CP-OFDM

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 SISO F_OFDM and CP-OFDM

 Example showing how to setup a simple SISO F-OFDM system under frequency selective
 channel and compare it to CP-OFDM.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % SISO F_OFDM and CP-OFDM
0002 %
0003 % Example showing how to setup a simple SISO F-OFDM system under frequency selective
0004 % channel and compare it to CP-OFDM.
0005 
0006 % This file is part of Wavecom: www.wavecom.org and is distributed under
0007 % the terms of the MIT license. See accompanying LICENSE file.
0008 % Original author: François Rottenberg, May 8, 2018.
0009 % Contributors: Mathieu Van Eeckhaute, September 26, 2018.
0010 % Change log:
0011 
0012 % Parameters of the OFDM modulation (see definition of
0013 % F_OFDM_InitializeChainParameters() for a definition of all modulation
0014 % parameters)
0015 
0016 clear 
0017 close all
0018 
0019 ParaF_OFDM=InitializeChainParameters( 'F-OFDM' ) % initialize parameters of the F-OFDM chain
0020 ParaF_OFDM.Ns=20; % number of multicarrier symbols
0021 ParaF_OFDM.Es_N0_dB=20;
0022 
0023 % Parameters of the CP-OFDM modulation (see definition of
0024 % OFDM_InitializeChainParameters() for a definition of all modulation
0025 % parameters)
0026 Para_OFDM=InitializeChainParameters( 'CP-OFDM' ) % initialize the general parameters by default of the CP-OFDM chain
0027 Para_OFDM.nSubcarriers = ParaF_OFDM.nSubcarriers;
0028 Para_OFDM.Ns=ParaF_OFDM.Ns;
0029 Para_OFDM.Es_N0_dB=ParaF_OFDM.Es_N0_dB;
0030 Para_OFDM.ActiveSubcarriers=ParaF_OFDM.ActiveSubcarriers;
0031 Para_OFDM.CP=ParaF_OFDM.CP;
0032 
0033 
0034 
0035 %% Transmitter
0036 
0037 % F-OFDM
0038 
0039 % Data payload
0040 d_data = GenerateData (ParaF_OFDM); % Generate data symbols
0041 % Synthesis filterbank
0042 sF_OFDM = Modulator(d_data, ParaF_OFDM ); % F-OFDM modulation
0043 
0044 % OFDM
0045 
0046 sOFDM = Modulator(d_data, Para_OFDM ); % F-OFDM modulation
0047 
0048 %% Channel
0049 
0050 C=GenerateRayleighChannelReal('ITU_VehA', ParaF_OFDM);
0051 
0052 % F-OFDM
0053 rF_OFDM=Channel_Multipath( sF_OFDM, C ); % Multipath channel
0054 rF_OFDM=Channel_AWGN( rF_OFDM, ParaF_OFDM ); % AWGN channel, SNR fixed in Para
0055 
0056 % OFDM
0057 rOFDM=Channel_Multipath( sOFDM, C ); % Multipath channel
0058 rOFDM=Channel_AWGN( rOFDM, Para_OFDM ); % AWGN channel, SNR fixed in Para
0059 
0060 %% Receiver
0061 
0062 % F_OFDM demodulator
0063 z_dataF_OFDM = Demodulator( rF_OFDM, ParaF_OFDM ); % F-OFDM demodulation
0064 
0065 % OFDM demodulator
0066 z_dataOFDM = Demodulator( rOFDM, Para_OFDM ); % F-OFDM demodulation
0067 
0068 % F_OFDM Equalizer
0069 ParaEqualizer.criterion='ZF';
0070 %Channel equalizer
0071 [ d_hatF_OFDM, B ] = Equalizer( z_dataF_OFDM, C, ParaF_OFDM, 'SingleTap', ParaEqualizer );
0072 d_hatF_OFDM = d_hatF_OFDM(ParaF_OFDM.ActiveSubcarriers, :);
0073 
0074 % OFDM Equalizer
0075 ParaEqualizer.criterion='ZF';
0076 [ d_hatOFDM, B ] = Equalizer( z_dataOFDM, C, ParaF_OFDM, 'SingleTap', ParaEqualizer );
0077 d_hatOFDM = d_hatOFDM(ParaF_OFDM.ActiveSubcarriers, :);
0078 
0079 d_data = d_data(ParaF_OFDM.ActiveSubcarriers, :);
0080 
0081 %% MSE on the received symbols
0082 EVM_dB_F_OFDM = 10*log10(mean(abs(d_hatF_OFDM(:)-d_data(:)).^2))
0083 EVM_dB_OFDM = 10*log10(mean(abs(d_hatOFDM(:)-d_data(:)).^2))
0084 figure, 
0085 hold on, plot(d_hatF_OFDM,'b.'); axis([-1 1 -1 1]),grid on,
0086 plot(d_data,'ro'); box
0087 title (['F-OFDM received constellation, EVM = ', num2str(EVM_dB_F_OFDM), 'dB'])
0088 %% PSD
0089 N_fft = 1e4;
0090 psd_F_OFDM = 10*log10(abs(1/sqrt(N_fft).*fft(sF_OFDM,N_fft)).^2);
0091 psd_OFDM = 10*log10(abs(1/sqrt(N_fft).*fft(sOFDM,N_fft)).^2);
0092 frequency = ParaF_OFDM.nSubcarriers/N_fft*(0:N_fft-1).';
0093 figure
0094 plot(frequency+1,(psd_OFDM),'-b'), hold on, 
0095 plot(frequency+1,(psd_F_OFDM),'--r'), hold on, 
0096 legend('OFDM', 'F-OFDM'), xlabel('sub-carrier index')
0097 title('PSD of transmitted signal'), grid 
0098 axis([ min(frequency), max(frequency), min(psd_F_OFDM), max(psd_F_OFDM)])

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