Home > WaveComBox > Example > W_OFDM > SISO_commun_W_OFDM_OFDM.m

SISO_commun_W_OFDM_OFDM

PURPOSE ^

SISO W_OFDM and CP-OFDM

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 SISO W_OFDM and CP-OFDM

 Example showing how to setup a simple SISO W_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 W_OFDM and CP-OFDM
0002 %
0003 % Example showing how to setup a simple SISO W_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 W-OFDM modulation (see definition of
0013 % W_OFDM_InitializeChainParameters() for a definition of all modulation
0014 % parameters)
0015 
0016 clear all
0017 close all
0018 
0019 ParaW_OFDM=InitializeChainParameters( 'W-OFDM' ) % initialize parameters of the W-OFDM chain
0020 ParaW_OFDM.Ns=20; % number of multicarrier symbols
0021 
0022 % Parameters of the CP-OFDM modulation (see definition of
0023 % OFDM_InitializeChainParameters() for a definition of all modulation
0024 % parameters)
0025 Para_OFDM=InitializeChainParameters( 'CP-OFDM' ) % initialize the general parameters by default of the CP-OFDM chain
0026 Para_OFDM.nSubcarriers = ParaW_OFDM.nSubcarriers;
0027 Para_OFDM.Ns=ParaW_OFDM.Ns;
0028 Para_OFDM.Es_N0_dB=ParaW_OFDM.Es_N0_dB;
0029 Para_OFDM.ActiveSubcarriers=ParaW_OFDM.ActiveSubcarriers;
0030 Para_OFDM.CP=ParaW_OFDM.CP;
0031 
0032 
0033 
0034 %% Transmitter
0035 
0036 % W-OFDM
0037 
0038 % Data payload
0039 d_data = GenerateData (ParaW_OFDM); % Generate data symbols
0040 % Synthesis filterbank
0041 sW_OFDM = Modulator(d_data, ParaW_OFDM ); % W-OFDM modulation
0042 
0043 % OFDM
0044 
0045 sOFDM = Modulator(d_data, Para_OFDM ); % W-OFDM modulation
0046 
0047 %% Channel
0048 
0049 C=GenerateRayleighChannelReal('ITU_VehA', ParaW_OFDM);
0050 
0051 % W-OFDM
0052 rW_OFDM=Channel_Multipath( sW_OFDM, C ); % Multipath channel
0053 rW_OFDM=Channel_AWGN( rW_OFDM, ParaW_OFDM ); % AWGN channel, SNR fixed in Para
0054 
0055 % OFDM
0056 rOFDM=Channel_Multipath( sOFDM, C ); % Multipath channel
0057 rOFDM=Channel_AWGN( rOFDM, Para_OFDM ); % AWGN channel, SNR fixed in Para
0058 
0059 %% Receiver
0060 
0061 % F_OFDM demodulator
0062 z_dataW_OFDM = Demodulator( rW_OFDM, ParaW_OFDM ); % W-OFDM demodulation
0063 
0064 % OFDM demodulator
0065 z_dataOFDM = Demodulator( rOFDM, Para_OFDM ); % W-OFDM demodulation
0066 
0067 % F_OFDM Equalizer
0068 ParaEqualizer.criterion='ZF';
0069 %Channel equalizer
0070 [ d_hatW_OFDM, B ] = Equalizer( z_dataW_OFDM, C, ParaW_OFDM, 'SingleTap', ParaEqualizer );
0071 d_hatW_OFDM = d_hatW_OFDM(ParaW_OFDM.ActiveSubcarriers, :);
0072 
0073 % OFDM Equalizer
0074 ParaEqualizer.criterion='ZF';
0075 [ d_hatOFDM, B ] = Equalizer( z_dataOFDM, C, ParaW_OFDM, 'SingleTap', ParaEqualizer );
0076 d_hatOFDM = d_hatOFDM(ParaW_OFDM.ActiveSubcarriers, :);
0077 
0078 d_data = d_data(ParaW_OFDM.ActiveSubcarriers, :);
0079 
0080 %% MSE on the received symbols
0081 EVM_dB_W_OFDM = 10*log10(mean(abs(d_hatW_OFDM(:)-d_data(:)).^2))
0082 EVM_dB_OFDM = 10*log10(mean(abs(d_hatOFDM(:)-d_data(:)).^2))
0083 figure, 
0084 hold on, plot(d_hatW_OFDM,'b.'); axis([-1 1 -1 1]),grid on,
0085 plot(d_data,'ro'); box
0086 title (['F-OFDM received constellation, EVM = ', num2str(EVM_dB_W_OFDM), 'dB'])
0087 %% PSD
0088 N_fft = 1e4;
0089 psd_W_OFDM = 10*log10(abs(1/sqrt(N_fft).*fft(sW_OFDM,N_fft)).^2);
0090 psd_OFDM = 10*log10(abs(1/sqrt(N_fft).*fft(sOFDM,N_fft)).^2);
0091 frequency = ParaW_OFDM.nSubcarriers/N_fft*(0:N_fft-1).';
0092 figure
0093 plot(frequency+1,(psd_OFDM),'-b'), hold on, 
0094 plot(frequency+1,(psd_W_OFDM),'--r'), hold on, 
0095 legend('OFDM', 'W-OFDM'), xlabel('sub-carrier index')
0096 title('PSD of transmitted signal'), grid 
0097 axis([ min(frequency), max(frequency), min(psd_W_OFDM), max(psd_W_OFDM)])

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