Usiddique
Newbie level 3
Hi,
I am trying to implement OFDM system using 64 point FFT and the following equation. I am trying to transmit 64 OFDM symbols, each containing 64 qpsk symbols.
Y = HS + W;
where,
Y = 64x64 matrix of received signal
H = 64 x 64 matrix of channel coefficient
W = 64x64 matrix of noise
I have done the following steps in beginning,
1) I multiplied tx-block with Fourier Matrix (64 x 64).
2) on Rx side I just try to recover the transmitted bits, BER is constant for all SNR values i.e 0:1:10 dB even in the absence of channel and noise.
But when I done the same exercise by transmitting a single OFDM symbol, multiplied it with channel coefficient and add noise, I got fine BER.
Following is code:-
nFFT = 64; % fft size
bits_symbol = 2; % Bits per qpsk symbols
nSym = 10^2; %10^4; % number of symbols
bits_number = nFFT*bits_symbol*nSym; % Total number of bits to be generated
EbN0dB = 0:1:10; % Bit to Noise Ratio
SNR = EbN0dB + 10*log10(bits_symbol);
h = [1 1 1];
% Generate N-Point FFT matrix
N = nFFT;
for K_ind = 1:nFFT
for L_ind = 1:nFFT
F(K_ind,L_ind)=1/sqrt(N)*exp(-1j*((2*pi)/N)*(K_ind-1)*(L_ind-1));
end
end
for ii = 1:length(EbN0dB)
snr = 10.^(SNR (ii)/10); % SNR/link spectral efficiency(bits/s/Hz) = Eb/ N0 --> SNR = 2 Eb/N0 -> 10log10(SNR) = 2 Eb/N0 -> snr = 10^((2Eb/N0)/10)=10^(SNR/10)
% Transmitter
uncoded_bits = rand(1,bits_number)>0.5; % random 1's and 0's
s_mod_serial = qpsk_mod(uncoded_bits); % QPSK modulation
sn = reshape(s_mod_serial,nSym,nFFT);
no_Run = round(length(sn)/nFFT)-1;
err_bit = 0;
for kkk = 1:no_Run
tx_symbols_block = sn(((kkk-1)*nFFT+1:kkk*nFFT),(1:nFFT)); % 64 QPSK symbols for transmission
uncoded_bits0 = uncoded_bits(1,(kkk-1)*nFFT*bits_symbol*nFFT+1:kkk*nFFT*bits_symbol*nFFT); % 128 bits for transmissio in a single Run
% Serial to Parallel conversion
XF = tx_symbols_block.';
% Imposed onto orthogonal sub-carriers by means of IFFT
xt =F'*XF;
r = xt;
% Receiver
% FFT operation. conversion from time Domain Frequency Domain
yF = F*r;
yF = reshape(yF,1,nFFT*nFFT);
% Demodulation of qpsk symbols
decoded_bits = qpsk_dem(yF);
% Error bits calculation
err_bit = err_bit + sum(uncoded_bits0~=decoded_bits);
end %end of no_Run
% Bit Error Rate Calculation
BER(ii)= err_bit/length(uncoded_bits);
end
simBer=BER;
I would appreciate help or comment for the said problem.
Thanks,
Regards,
usman
I am trying to implement OFDM system using 64 point FFT and the following equation. I am trying to transmit 64 OFDM symbols, each containing 64 qpsk symbols.
Y = HS + W;
where,
Y = 64x64 matrix of received signal
H = 64 x 64 matrix of channel coefficient
W = 64x64 matrix of noise
I have done the following steps in beginning,
1) I multiplied tx-block with Fourier Matrix (64 x 64).
2) on Rx side I just try to recover the transmitted bits, BER is constant for all SNR values i.e 0:1:10 dB even in the absence of channel and noise.
But when I done the same exercise by transmitting a single OFDM symbol, multiplied it with channel coefficient and add noise, I got fine BER.
Following is code:-
nFFT = 64; % fft size
bits_symbol = 2; % Bits per qpsk symbols
nSym = 10^2; %10^4; % number of symbols
bits_number = nFFT*bits_symbol*nSym; % Total number of bits to be generated
EbN0dB = 0:1:10; % Bit to Noise Ratio
SNR = EbN0dB + 10*log10(bits_symbol);
h = [1 1 1];
% Generate N-Point FFT matrix
N = nFFT;
for K_ind = 1:nFFT
for L_ind = 1:nFFT
F(K_ind,L_ind)=1/sqrt(N)*exp(-1j*((2*pi)/N)*(K_ind-1)*(L_ind-1));
end
end
for ii = 1:length(EbN0dB)
snr = 10.^(SNR (ii)/10); % SNR/link spectral efficiency(bits/s/Hz) = Eb/ N0 --> SNR = 2 Eb/N0 -> 10log10(SNR) = 2 Eb/N0 -> snr = 10^((2Eb/N0)/10)=10^(SNR/10)
% Transmitter
uncoded_bits = rand(1,bits_number)>0.5; % random 1's and 0's
s_mod_serial = qpsk_mod(uncoded_bits); % QPSK modulation
sn = reshape(s_mod_serial,nSym,nFFT);
no_Run = round(length(sn)/nFFT)-1;
err_bit = 0;
for kkk = 1:no_Run
tx_symbols_block = sn(((kkk-1)*nFFT+1:kkk*nFFT),(1:nFFT)); % 64 QPSK symbols for transmission
uncoded_bits0 = uncoded_bits(1,(kkk-1)*nFFT*bits_symbol*nFFT+1:kkk*nFFT*bits_symbol*nFFT); % 128 bits for transmissio in a single Run
% Serial to Parallel conversion
XF = tx_symbols_block.';
% Imposed onto orthogonal sub-carriers by means of IFFT
xt =F'*XF;
r = xt;
% Receiver
% FFT operation. conversion from time Domain Frequency Domain
yF = F*r;
yF = reshape(yF,1,nFFT*nFFT);
% Demodulation of qpsk symbols
decoded_bits = qpsk_dem(yF);
% Error bits calculation
err_bit = err_bit + sum(uncoded_bits0~=decoded_bits);
end %end of no_Run
% Bit Error Rate Calculation
BER(ii)= err_bit/length(uncoded_bits);
end
simBer=BER;
I would appreciate help or comment for the said problem.
Thanks,
Regards,
usman