Home > WaveComBox > Toolbox > Receiver > MSEComputes.m

MSEComputes

PURPOSE ^

Computes the mean squared error (MSE) of estimated symbols.

SYNOPSIS ^

function [ MSE ] = MSEComputes( d, d_hat, Para )

DESCRIPTION ^

 Computes the mean squared error (MSE) of estimated symbols.

 function [  MSE ] = MSE_simu( d, d_hat, Para )

 The function works for SISO and MIMO systems. If more than one spatial
 stream is considered, the MSE is aggregated over all streams.

 Input arguments:

   d: transmitted symbols. Size: matrix if Para.S == 1, multidimensional
   array if Para.S > 1

   d_hat: estimated symbols. Size: matrix if Para.S == 1, multidimensional
   array if Para.S > 1

   Para: structure containing the modulation parameters.

 Outputs arguments:

   MSE: per-subcarrier MSE. Size: vector [length(Para.ActiveSubcarriers), 1]

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [  MSE ] = MSEComputes( d, d_hat, Para )
0002 % Computes the mean squared error (MSE) of estimated symbols.
0003 %
0004 % function [  MSE ] = MSE_simu( d, d_hat, Para )
0005 %
0006 % The function works for SISO and MIMO systems. If more than one spatial
0007 % stream is considered, the MSE is aggregated over all streams.
0008 %
0009 % Input arguments:
0010 %
0011 %   d: transmitted symbols. Size: matrix if Para.S == 1, multidimensional
0012 %   array if Para.S > 1
0013 %
0014 %   d_hat: estimated symbols. Size: matrix if Para.S == 1, multidimensional
0015 %   array if Para.S > 1
0016 %
0017 %   Para: structure containing the modulation parameters.
0018 %
0019 % Outputs arguments:
0020 %
0021 %   MSE: per-subcarrier MSE. Size: vector [length(Para.ActiveSubcarriers), 1]
0022 %
0023 
0024 
0025 % This file is part of WaveComBox: www.wavecombox.com and is distributed under
0026 % the terms of the MIT license. See accompanying LICENSE file.
0027 % Original author: François Rottenberg, May 3, 2018.
0028 % Contributors:
0029 % Change log:
0030 
0031 MSE=zeros(length(Para.ActiveSubcarriers),1);
0032 nPilotSymbol=length(Para.ScatteredPilotSymbols);
0033 nActiveSubcarriers=length(Para.ActiveSubcarriers);
0034 if Para.S==1
0035     switch Para.Modulation
0036         case 'FBMC-OQAM'
0037             d(Para.ScatteredPilotSubcarriers,Para.ScatteredPilotSymbols)=0;
0038             d(Para.ScatteredPilotSubcarriers,Para.ScatteredPilotSymbols+1)=0;
0039             d_hat(Para.ScatteredPilotSubcarriers,Para.ScatteredPilotSymbols)=0;
0040             d_hat(Para.ScatteredPilotSubcarriers,Para.ScatteredPilotSymbols+1)=0;
0041             for m=1:nActiveSubcarriers
0042                 if ismember(Para.ActiveSubcarriers(m),Para.ScatteredPilotSubcarriers)
0043                     MSE(m)= sum( abs(d(Para.ActiveSubcarriers(m),:)-d_hat(Para.ActiveSubcarriers(m),:)).^2, 2)./(Para.Ns-nPilotSymbol)/2 ;
0044                 else
0045                     MSE(m)= mean( abs(d(Para.ActiveSubcarriers(m),:)-d_hat(Para.ActiveSubcarriers(m),:)).^2, 2) ;
0046                 end
0047             end
0048         case 'CP-OFDM'
0049             d(Para.ScatteredPilotSubcarriers,Para.ScatteredPilotSymbols)=0;
0050             d_hat(Para.ScatteredPilotSubcarriers,Para.ScatteredPilotSymbols)=0;
0051             for m=1:nActiveSubcarriers
0052                 if ismember(Para.ActiveSubcarriers(m),Para.ScatteredPilotSubcarriers)
0053                     MSE(m)= sum( abs(d(Para.ActiveSubcarriers(m),:)-d_hat(Para.ActiveSubcarriers(m),:)).^2, 2)./(Para.Ns-nPilotSymbol) ;
0054                 else
0055                     MSE(m)= mean( abs(d(Para.ActiveSubcarriers(m),:)-d_hat(Para.ActiveSubcarriers(m),:)).^2, 2) ;
0056                 end
0057             end
0058         case 'UFMC'
0059             MSE= mean( abs(d(Para.ActiveSubcarriers,:)-d_hat(Para.ActiveSubcarriers,:)).^2, 2) ;
0060         otherwise
0061             error('Modulation not implemented')
0062     end
0063 else
0064     SE=squeeze(sum(abs(d(:,Para.ActiveSubcarriers,:)-d_hat(:,Para.ActiveSubcarriers,:)).^2,1));
0065     MSE= mean( SE, 2) ;
0066 end
0067 
0068 
0069 end
0070

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