My question is about baseband OFDM. I try to plot the BER according to the SNR. I noticed that changing cyclic prefix length does not affect the performances. I.e., following the code below, gi = n_sp/1024
or n_sp/4
or even 0
, gives the same performance (always the same BER curve). Is there a mistake somewhere?
NB: At the receiver I use ZF-equalizer. The full Matlab code is:
clear
close all
clc
n_subc = 2^11; % # of subcarriers
n_ofdm_sym = 10; % # of OFDM symbols
n_data_sym = n_subc*n_ofdm_sym; % # of data symbols to transmit
gi = n_subc/4; % CP length
dqpskmod = comm.DQPSKModulator;
dqpskdemod = comm.DQPSKDemodulator;
h = [.7*exp(1i*pi/4) .4*exp(1i*pi/3) .2*exp(1i*pi/6) .1*exp(1i*pi/5)]; % 4-taps channel
SNR = -10:2:30;
for i = 1:length(SNR)
for j = 1:100 % Monte Carlo iterations
d_symb = randi([0 3],1,n_data_sym);
x_mod = step(dqpskmod, d_symb').'; % DQPSK modulated symbols
x_mod_s2p = reshape(x_mod,n_subc,[]); % serial to parallel
x_ifft = ifft(x_mod_s2p,n_subc);
x_cp = [x_ifft(end-gi+1:end,:); x_ifft]; % add CP
x_ifft_p2s = reshape(x_cp,1,[]); % parallel to serial
% --------------------> Channel mixing and adding noise
y = conv(x_ifft_p2s,h,'same'); % Linear convolution
% y = ifft(fft(h,length(x_ifft_p2s)).*fft(x_ifft_p2s)); % OR circular convolution
y = awgn(y,SNR(i),'measured'); % add noise
% --------------------> Receiver
y_s2p = reshape(y,n_subc+gi,[]); % S2P
y_cp = y_s2p(gi+1:end,:); % Removing CP
y_fft = fft(y_cp,n_subc); % FFT
y_p2s = reshape(y_fft,1,[]); % P2S
pilotX = x_mod(1:4:end); % Pilot extraction from the DQPSK transmitted data
pilotY = y_p2s(1:4:end); % Pilot extraction from the DQPSK received data
H_est = pilotY./pilotX; % Channel estimation
H_est_interp = interp1(1:4:n_data_sym,H_est,1:n_data_sym); % Linear interpolation
H_est_interp(end) = H_est_interp(end-1); % To avoid the last NaN
X_est = y_p2s./H_est_interp; % ZF equalizer
y_demod = step(dqpskdemod,X_est.')'; % DQPSK demapping
d_symb(1:4:end) = []; % Pilot suppression from the original data
y_demod(1:4:end) = []; % Pilot suppression from the received data
[~,ber(j)] = biterr(d_symb,y_demod);
end
BER(i)=mean(ber)
end
figure
semilogy(SNR,BER)
The figure below gives the results for gi = n_sp/1024
, n_sp/4
, and 0
:
Additional question: why BER saturates for SNR above 22dB? There is no saturation for QAM modulation, is it specific to the DQPSK?
x_ifft_p2s
through channelh
by linear convolution. $\endgroup$rayleighchan
for generatingh
, thenfilter
for filtering. $\endgroup$