Home > WaveComBox > Toolbox > F_OFDM > ChannelEqualization > OFDM_EqualizerSingleTap.m

OFDM_EqualizerSingleTap

PURPOSE ^

Single-tap equalization of the demodulated OFDM symbols.

SYNOPSIS ^

function [ x, B ] = OFDM_EqualizerSingleTap( z, C, criterion, Para, B )

DESCRIPTION ^

 Single-tap equalization of the demodulated OFDM symbols.

 function [ x, B ] = OFDM_EqualizerSingleTap( z, C, criterion, Para )
 function [ x, B ] = OFDM_EqualizerSingleTap( z, C, criterion, Para, B )

 The function works for MIMO and SISO systems.

 Input arguments:

   z: demodulated OFDM symbols. Size: matrix [Para.nSubcarriers, Ns] if
   Para.N_R == 1, multidimensional array [Para.N_R, Para.nSubcarriers, Ns]
   if Para.N_R > 1.   

   C: channel impulse response. Multidimensional array [Para.N_R, Para.N_T, ~].

   criterion: determines the criterion to use. Several 
 options are possible: 
       'ZF': zero forcing. Error if Para.N_R < Para.N_T.

       'MMSE': minimum mean squared error. Error if Para.N_R < Para.N_T.

       'MF': matched filter. Error if Para.N_R < Para.N_T.

       'specific': the specific equalizing matrices given in the
 function argument B should be provided and will be used for equalization.
 Argument C is not regarded.

   Para: structure containing the modulation parameters.

   B: the equalizing matrices at each subcarrier should be provided if
   'specific' equalizer type is chosen. If not chosen, the matrix B is
   disregarded. Size: vector [Para.nSubcarriers ,1] if Para.N_T == 1 and multi-
   dimensional array [Para.S, Para.N_R, Para.nSubcarriers] otherwise.

 Ouput arguments:

   x: equalized symbols. Size: matrix [Para.nSubcarriers, Ns] if Para.S == 1,
   multidimensional array [para.S, Para.nSubcarriers, Ns] if Para.S > 1.   

   B: equalizing matrices used at each subcarrier. Size: vector 
   [Para.nSubcarriers ,1] if Para.N_T == 1 and multidimensional array [Para.S,
   Para.N_R, Para.nSubcarriers] otherwise.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ x, B ] = OFDM_EqualizerSingleTap( z, C, criterion, Para, B )
0002 % Single-tap equalization of the demodulated OFDM symbols.
0003 %
0004 % function [ x, B ] = OFDM_EqualizerSingleTap( z, C, criterion, Para )
0005 % function [ x, B ] = OFDM_EqualizerSingleTap( z, C, criterion, Para, B )
0006 %
0007 % The function works for MIMO and SISO systems.
0008 %
0009 % Input arguments:
0010 %
0011 %   z: demodulated OFDM symbols. Size: matrix [Para.nSubcarriers, Ns] if
0012 %   Para.N_R == 1, multidimensional array [Para.N_R, Para.nSubcarriers, Ns]
0013 %   if Para.N_R > 1.
0014 %
0015 %   C: channel impulse response. Multidimensional array [Para.N_R, Para.N_T, ~].
0016 %
0017 %   criterion: determines the criterion to use. Several
0018 % options are possible:
0019 %       'ZF': zero forcing. Error if Para.N_R < Para.N_T.
0020 %
0021 %       'MMSE': minimum mean squared error. Error if Para.N_R < Para.N_T.
0022 %
0023 %       'MF': matched filter. Error if Para.N_R < Para.N_T.
0024 %
0025 %       'specific': the specific equalizing matrices given in the
0026 % function argument B should be provided and will be used for equalization.
0027 % Argument C is not regarded.
0028 %
0029 %   Para: structure containing the modulation parameters.
0030 %
0031 %   B: the equalizing matrices at each subcarrier should be provided if
0032 %   'specific' equalizer type is chosen. If not chosen, the matrix B is
0033 %   disregarded. Size: vector [Para.nSubcarriers ,1] if Para.N_T == 1 and multi-
0034 %   dimensional array [Para.S, Para.N_R, Para.nSubcarriers] otherwise.
0035 %
0036 % Ouput arguments:
0037 %
0038 %   x: equalized symbols. Size: matrix [Para.nSubcarriers, Ns] if Para.S == 1,
0039 %   multidimensional array [para.S, Para.nSubcarriers, Ns] if Para.S > 1.
0040 %
0041 %   B: equalizing matrices used at each subcarrier. Size: vector
0042 %   [Para.nSubcarriers ,1] if Para.N_T == 1 and multidimensional array [Para.S,
0043 %   Para.N_R, Para.nSubcarriers] otherwise.
0044 %
0045 
0046 
0047 % This file is part of WaveComBox: www.wavecombox.com and is distributed under the terms of the MIT license. See accompanying LICENSE file.
0048 % Original author: François Rottenberg, May 1, 2018.
0049 % Contributors:
0050 % Change log:
0051 
0052 if Para.N_R==1
0053     Ns=length(z(1,:));
0054 else
0055     Ns=length(z(1,1,:));
0056 end
0057 
0058 if Para.N_R==1 && Para.N_T==1
0059     H=fft(C,Para.nSubcarriers);
0060     x=zeros(Para.nSubcarriers,Ns);
0061     switch criterion
0062         case 'ZF'
0063             B=1./H;
0064         case 'MMSE'
0065             % Noise power
0066             Es_N0=10.^(Para.Es_N0_dB/10);
0067             B=conj(H)./(abs(H).^2+1/Es_N0);
0068         case 'MF'
0069             B=1./H;
0070         case 'Specific'
0071             if exist('B','var')==0
0072                 error('Argument missing "B" for equalizer type "Specific"')
0073             end
0074         otherwise
0075             error('Equalizer type not existing')
0076     end
0077     for m=Para.ActiveSubcarriers
0078         x(m,:)=B(m).*z(m,:);
0079     end
0080 else
0081     H=zeros(Para.N_R,Para.N_T,Para.nSubcarriers);
0082     for index_N_R=1:Para.N_R
0083         for index_N_T=1:Para.N_T
0084             H(index_N_R,index_N_T,:)=fft(squeeze(C(index_N_R,index_N_T,:)),Para.nSubcarriers).';
0085         end
0086     end
0087     x=zeros(Para.S,Para.nSubcarriers,Ns);
0088     switch criterion
0089         case 'ZF'
0090             if Para.N_T>Para.N_R
0091                 error('Error: N_T>N_R')
0092             end
0093             B=zeros(Para.S, Para.N_R, Para.nSubcarriers);
0094             for m=Para.ActiveSubcarriers
0095                 H_m=H(:,:,m);
0096                 B(:,:,m)=(H_m'*H_m)\H(:,:,m)';
0097                 for l=1:Ns
0098                     x(:,m,l)=B(:,:,m)*z(:,m,l);
0099                 end
0100             end     
0101         case 'MMSE'
0102             if Para.N_T>Para.N_R
0103                 error('Error: N_T>N_R')
0104             end
0105             B=zeros(Para.S, Para.N_R, Para.nSubcarriers);
0106             for m=Para.ActiveSubcarriers
0107                 % Noise power
0108                 Es_N0=10.^(Para.Es_N0_dB/10);
0109                 H_m=H(:,:,m);
0110                 B(:,:,m)=eye(Para.N_T,Para.N_T)/(H_m'*H_m+1/Es_N0*Para.N_T*eye(Para.N_T,Para.N_T))*H_m';
0111                 for l=1:Ns
0112                     x(:,m,l)=B(:,:,m)*z(:,m,l);
0113                 end
0114             end
0115         case 'MF'
0116             if Para.N_T>Para.N_R
0117                 error('Error: N_T>N_R')
0118             end
0119             B=zeros(Para.S, Para.N_R, Para.nSubcarriers);
0120             for m=Para.ActiveSubcarriers
0121                 H_m=H(:,:,m);
0122                 B(:,:,m)= (diag(diag(H_m'*H_m)))\H_m';
0123                 for l=1:Ns
0124                     x(:,m,l)=B(:,:,m)*z(:,m,l);
0125                 end
0126             end
0127         case 'Specific'
0128             if exist('B','var')==0
0129                 error('Argument missing "B" for equalizer type "Specific"')
0130             end
0131             if Para.N_R==1
0132                 for m=Para.ActiveSubcarriers
0133                     for l=1:Ns
0134                         x(:,m,l)=B(:,:,m)*z(m,l);
0135                     end
0136                 end
0137             else
0138                 for m=Para.ActiveSubcarriers
0139                     for l=1:Ns
0140                         x(:,m,l)=B(:,:,m)*z(:,m,l);
0141                     end
0142                 end
0143             end
0144         otherwise
0145             error('Equalizer type not existing')
0146     end
0147     if Para.S==1
0148         x=squeeze(x);
0149     end
0150 end
0151 end
0152

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