Cyclic prefix length in baseband OFDM with ZF equalizer 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

    % --------------------&gt; 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

    % --------------------&gt; 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?
The channel which you have created is having 4-Taps and all taps are one after the other, meaning roughly there are 4 multi-paths and they are very close to each other. How close depends on what is the Sub-Carrier Spacing you would have assumed. Anyway, the point is only 3 samples of Cyclic Prefix would be enough and even with 0 or 2 samples of CP will not cause any noticeable degradation. The degradation is mostly due to AWGN which you are adding. 

If you want to see the impact of 4-Tap channel, then I will suggest you to have larger delays multiplied to the magnitude of the four taps. One way to do it is as follows:

h = [.7*exp(1i*pi/4) zeros(1,50) .4*exp(1i*pi/3) zeros(1,75) .2*exp(1i*pi/6) zeros(1,100) .1*exp(1i*pi/5)]; % 4-taps channel


This will create four paths channel with 2nd, 3rd and 4rth path coming at 50, 126 and 227 samples respectively and hence the 2nd, 3rd and 4rth copy of one OFDM symbol will interfere with next OFDM symbol more.

With your current h assignment, all you will have is intra-symbol interference which can be delt with no CP since the channel is just 4-taps with no delays in between.

Also, consider removing AWGN and varying the amount of zeros I have added in between 4-Taps of h, to actually notice the impact of multipath inter-symbol interference and advantage of 512 length CP over 0/2 length CP.