MATLAB Answers

# delay spread rayleigh channel for OFDM

21 views (last 30 days)
Ala Gouissem on 21 Nov 2011
Answered: Rahul Gulia on 11 Sep 2020
Hello, To simulate an OFDM transmission I'm supposing that the delay spread is less than the cyclic prefix , so I define a signal matrix S where the columns represents the OFDM symbols and the rows represent the subcarriers (16 subcarriers) . so that the received signal in frequency domain will be Y=S.*H +N where H is the channel matrix (in frequency domain) and N the gaussian noise matrix, My problem is that I have to use a Rayleigh channel with a delay spread=0.01*T where T is the OFDM symbl duration so how can I create this channel ?
##### 1 CommentShowHide None
Ala Gouissem on 21 Nov 2011
to make things more simple , you can suppose that I'm transmitting only one OFDM symbol ,
so I have a modulated signal composed from 16 symbols and I want to multiply it by a certain rayleigh channel h with a dely spread =0.01*T
so how to create this h

Sign in to comment.

### Answers (1)

Rahul Gulia on 11 Sep 2020
Hi Ala.
I just came across your question. Just answering, so that people in the future can get help from.
Here is a MATLAB code to model a Rayleigh channel.
% Final code
% Simulation of Rayleigh channel
clc;
clear all;
close all;
warning off;
% Parameters
nobpc = 10^6;
Es = 1;
SNRdb = 0:20;
M = 4;
Rm = log2(M);
% Transmitting data generation
Tx_bits = round(rand(1,nobpc));
oddData = Tx_bits(1:2:end);
evenData = Tx_bits(2:2:end);
Tx_symb = sqrt(1/2)*(1i*(2*oddData-1)+(2*evenData-1)); %QPSK Mapping
figure, polar(angle(Tx_symb),abs(Tx_symb),'*');
BER = zeros(1,length(SNRdb));
index = 1;
for i =SNRdb
SNR = 10.^(i/10);
noiseSigma = sqrt(1./(2*Rm*SNR));
errors = 0;
%Creating a complex noise for adding with QPSK modulated signal
noise = noiseSigma*(randn(1,length(Tx_symb))+1i*randn(1,length(Tx_symb)));
% Creating a Rayleigh channel with variance 0.5
h = sqrt(0.5*((randn(1,length(Tx_symb))).^2+(randn(1,length(Tx_symb))).^2));
% Transmitted signal
Rx_symb = Tx_symb.*h + noise;
% Equalizer
Rx_symb = Rx_symb./h;
%ML Detector
detected_real = real(Rx_symb)>=0;
detected_img = imag(Rx_symb)>=0;
Rx_bits=reshape([detected_img;detected_real],1,nobpc);
%Bit Error rate Calculation
BER(index) = sum(xor(Tx_bits,Rx_bits))/nobpc;
index=index+1;
end
% Theoretical BER for Rayleigh channel
SNR1 = 10.^(SNRdb/10);
theoreticalBER =0.5*(1 - sqrt(SNR1./(SNR1+1)));
figure,semilogy(SNRdb,BER,'r--'),title('SNR vs BER for Rayleigh channel');
grid on;
hold on;
semilogy(SNRdb,theoreticalBER,'b*');
xlabel("SNRdb");
ylabel("BER");
legend('Simulated','Theoretical-QPSK');
grid on;
figure, semilogy(SNRdb,theoreticalBER,'b'), title("Theoretical curve of SNR Vs BER for Rayleigh Channel"), xlabel("SNRdb"),ylabel("BER");
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!