# How to get the MLSEEqualizer work with IFFT and FFT blocks in the communication system?

Matlab MLSEE equalizer works fine with the QPSK modulated signal when the signal is propagated over the multipath channel. However, if there are IFFT and FFT blocks used at TX and RX sides, respectively, the receiver in the modified code has worse BER results than the original code as shown in the following MATLAB codes.

I would like to ask for your help to investigate the failure in the modified code below.

% Original Code: Works fine and gives perfect BER results.
%   Equalize a QPSK signal transmitted through a dispersive channel
%   using MLSE

qpskMod = comm.QPSKModulator(0,'SymbolMapping','Binary');
qpskDemod = comm.QPSKDemodulator(0,'SymbolMapping','Binary');
% Channel coefficients
chCoeffs = [.986; .845; .237; .12345+.31i];
N=512; % Modulated signal length
mleq = comm.MLSEEqualizer('TracebackDepth',10,...
'Channel',chCoeffs, 'Constellation',[1 1i -1 -1i]);
% Create an error rate calculator
ber = comm.ErrorRate;
for n = 1:10
data= randi([0 3],N,1);
modSignal = qpskMod(data);
% Introduce channel distortion.
chanOutput = filter(chCoeffs,1,modSignal);
% Equalize the channel output and demodulate
eqSignal = mleq(chanOutput);
demodData = qpskDemod(eqSignal);
% Compute BER
a = ber(data, demodData);
b=a(1)
end

% Modified Code: IFFT and FFT blocks are used but the system shows worse BER results.
%   Equalize a QPSK signal transmitted through a dispersive channel using MLSE

qpskMod = comm.QPSKModulator(0,'SymbolMapping','Binary');
qpskDemod = comm.QPSKDemodulator(0,'SymbolMapping','Binary');
% Channel coefficients
chCoeffs = [.986; .845; .237; .12345+.31i];
N=512; % Modulated signal length
mleq = comm.MLSEEqualizer('TracebackDepth',10,...
'Channel',chCoeffs, 'Constellation',[1 1i -1 -1i]);
% Create an error rate calculator
ber = comm.ErrorRate;
for n = 1:10
data= randi([0 3],N,1);

% Modulate the data and convert it to time domain.
modSignalx = qpskMod(data);
modSignal=sqrt(N)*ifft(modSignalx);

% Introduce channel distortion
chanOutput = filter(chCoeffs,1,modSignal);

% Equalize the channel output and demodulate
eqSignalx = mleq(chanOutput);
eqSignal=(1/sqrt(N))*fft(eqSignalx);

demodData = qpskDemod(eqSignal);
% Compute BER
a = ber(data, demodData);
b(n)=a(1);
end


Many thanks in advance!

@Zeyad_Zeyad I have included the whole code here. It gives high error rate even the SNR is set to 30.

clear all;
close all;
qpskMod = comm.QPSKModulator(0,'SymbolMapping','Binary');
qpskDemod = comm.QPSKDemodulator(0,'SymbolMapping','Binary');
% Channel coefficients
chCoeffs = [.986; .845; .237; .12345+.31i];
N=512; % Modulated signal length
mleq = comm.MLSEEqualizer('TracebackDepth',10,...
'Channel',chCoeffs, 'Constellation',[1 1i -1 -1i]);
snr=30;
numiteration=10;
for n = 1:numiteration
data= randi([0 3],N,1);
dataIn(:,n)=data;

% Modulate the data and convert it to time domain.
modSignalx = step(qpskMod, data);
modSignal=sqrt(N)*ifft(modSignalx);

% Introduce channel distortion
chanOutputx = filter(chCoeffs,1,modSignal);

% Add awgn noise
chanOutput=awgn(chanOutputx,snr,'measured');

% Equalize the channel output and demodulate
eqSignalx = step(mleq, chanOutput);
eqSignal=(1/sqrt(N))*fft(eqSignalx);

demodData = step(qpskDemod, eqSignal);
demodDataOut(:,n)=demodData;
% Compute BER
end
a = biterr(dataIn(:), demodDataOut(:));
b=a/(N*numiteration)


Here is I modified it, and it's ok now:

% Modified Code: IFFT and FFT blocks are used but the system shows worse BER results.
%   Equalize a QPSK signal transmitted through a dispersive channel using MLSE

qpskMod = comm.QPSKModulator(0,'SymbolMapping','Binary');
qpskDemod = comm.QPSKDemodulator(0,'SymbolMapping','Binary');
% Channel coefficients
chCoeffs = [.986; .845; .237; .12345+.31i];
N=512; % Modulated signal length
mleq = comm.MLSEEqualizer('TracebackDepth',10,...
'Channel',chCoeffs, 'Constellation',[1 1i -1 -1i]);
% Create an error rate calculator
ber = comm.ErrorRate;
for n = 1:10
data= randi([0 3],N,1);

% Modulate the data and convert it to time domain.
modSignalx = step(qpskMod, data);
modSignal=sqrt(N)*ifft(modSignalx);

% Introduce channel distortion
chanOutput = filter(chCoeffs,1,modSignal);

% Equalize the channel output and demodulate
eqSignalx = step(mleq, chanOutput);
eqSignal=(1/sqrt(N))*fft(eqSignalx);

demodData = step(qpskDemod, eqSignal);
% Compute BER
a = biterr(data(n), demodData(n));

b(n)=a(1);
end
`
• Thank you Zeyad. Now I get correct BER results.I have tried to add Gaussian noise to the signal you've modified above but it still gives zero errors even I have run the code with zero SNR value as below. data= randi([0 3],N,1); % Modulate the data and convert it to time domain. modSignalx = step(qpskMod, data); modSignal=sqrt(N)*ifft(modSignalx); % Introduce channel distortion chanOutput = filter(chCoeffs,1,modSignal); %%add gaussian noise to the signal chanOutput chanOutput_noised=awgn(chanOutput,0,'measured'); – tuner Aug 23 '18 at 19:06
• @tuner could you please share the whole code, including the plots .. I'll check – Zeyad_Zeyad Aug 25 '18 at 7:12
• @tuner sorry for late response, I've seen your comments (which is in the question itself) right now.. I mean could you share the code including the plots? I need to check the results too – Zeyad_Zeyad Aug 27 '18 at 3:10