Ofdm Exp 2
Ofdm Exp 2
AIM: To analyze the Bit Error Rate (BER) performance of an Orthogonal Frequency
Division Multiplexing (OFDM).
SOFTWARE: MATLAB
DATE : 13/08/24
THEORY:
Orthogonal Frequency Division Multiplexing (OFDM):
OFDM is a digital multi-carrier modulation technique that divides the data stream into multiple smaller sub-
streams, each modulated onto a separate orthogonal subcarrier. This division of data into parallel streams
reduces the data rate of each subcarrier, making the system more resilient to frequency-selective fading and
inter-symbol interference (ISI). OFDM is widely used in wireless communication systems, including Wi-Fi,
LTE, and DVBT.
1. FFT/IFFT Operations:
- The Inverse Fast Fourier Transform (IFFT) is used at the transmitter to convert frequency-domain symbols
into time-domain signals. The Fast Fourier Transform (FFT) is used at the receiver to revert the signal back to
the frequency domain for demodulation.
- To combat ISI caused by multipath propagation, a guard interval is inserted between OFDM symbols. This
guard interval can be a Cyclic Prefix (CP), where a portion of the end of the OFDM symbol is copied and
appended to the beginning, or Zero Padding (ZP), where zeros are added.
- CP is commonly used in OFDM systems to mitigate ISI. By copying the last part of the OFDM symbol and
appending it at the start, CP ensures that delayed signals still align with the FFT window, preserving
orthogonality among subcarriers.
- ZP involves adding a sequence of zeros at the end of the OFDM symbol as a guard interval. Unlike CP, ZP
does not repeat any part of the symbol, and its effectiveness depends on the channel delay spread.
5. 16-QAM Modulation:
- Quadrature Amplitude Modulation (QAM) is a modulation technique where both amplitude and phase are
varied to represent data. In 16-QAM, 16 different symbols are used, each representing 4 bits. This allows higher
data rates but requires higher Signal-to-Noise Ratio (SNR) for reliable communication.
- The OFDM system is exposed to AWGN without any guard interval. This scenario highlights the effects of
noise on the system's BER without any additional protection against ISI.
- Similar to the CP scenario, but with ZP as the guard interval. ZP helps mitigate ISI but may perform
differently than CP under varying channel conditions.
- The system is subjected to a multipath fading channel characterized by different tap delays and powers. The
CP helps combat ISI caused by delayed multipath components, making the system more robust.
- This scenario tests the system's performance under multipath fading with ZP as the guard interval. The
effectiveness of ZP in preserving the OFDM signal's integrity under multipath conditions is evaluated.
BER is a critical metric that quantifies the number of bit errors in a received signal compared to the transmitted
signal. It is a function of the Signal-to-Noise Ratio (SNR) and the modulation scheme used. The lower the BER,
the better the system's performance.
FLOWCHART:
Start
Receiver:
1. Remove CP/ZP
2. Perform FFT
3. 16-QAM Demodulation
4. Count Bit Errors
End
CODE:
% Parameters
Nfft = 64; Ng_cp = Nfft/4; Ng_zp = 3; Nframe = 1000; M = 16;
EbN0_dB = 0:5:30; Nbits = Nfft * Nframe * log2(M);
Power = 10.^([0 -8 -17 -21 -25]/10); Delay = [0 3 5 6 8];
Ntap = length(Power); Lch = Delay(end) + 1;
% Error counters
numErr_AWGN_noGI = 0;
numErr_CP_AWGN = 0;
numErr_ZP_AWGN = 0;
numErr_CP_channel = 0;
numErr_ZP_channel = 0;
% AWGN Channel
noise_AWGN_noGI = sqrt(noiseVar) * (randn(size(txSignal)) + 1i*randn(size(txSignal)));
noise_CP_AWGN = sqrt(noiseVar) * (randn(size(txSignal_CP)) + 1i*randn(size(txSignal_CP)));
noise_ZP_AWGN = sqrt(noiseVar) * (randn(size(txSignal_ZP)) + 1i*randn(size(txSignal_ZP)));
% Receiver
rxData_AWGN_noGI = qamdemod(fft(txSignal + noise_AWGN_noGI, Nfft), M, 'gray');
rxData_CP_AWGN = qamdemod(fft(rxSignal_CP_AWGN(Ng_cp+1:end), Nfft), M, 'gray');
rxData_ZP_AWGN = qamdemod(fft(rxSignal_ZP_AWGN(1:Nfft), Nfft), M, 'gray');
rxData_CP_channel = qamdemod(fft(rxSignal_CP_channel(Ng_cp+1:end), Nfft), M, 'gray');
rxData_ZP_channel = qamdemod(fft(rxSignal_ZP_channel(1:Nfft), Nfft), M, 'gray');
% Error calculation
numErr_AWGN_noGI = numErr_AWGN_noGI + sum(data ~= rxData_AWGN_noGI);
numErr_CP_AWGN = numErr_CP_AWGN + sum(data ~= rxData_CP_AWGN);
numErr_ZP_AWGN = numErr_ZP_AWGN + sum(data ~= rxData_ZP_AWGN);
numErr_CP_channel = numErr_CP_channel + sum(data ~= rxData_CP_channel);
numErr_ZP_channel = numErr_ZP_channel + sum(data ~= rxData_ZP_channel);
end
% Calculate BER
BER_AWGN_noGI(idx) = numErr_AWGN_noGI / Nbits;
BER_CP_AWGN(idx) = numErr_CP_AWGN / Nbits;
BER_ZP_AWGN(idx) = numErr_ZP_AWGN / Nbits;
BER_CP_channel(idx) = numErr_CP_channel / Nbits;
BER_ZP_channel(idx) = numErr_ZP_channel / Nbits;
end
% Plot results
figure;
semilogy(EbN0_dB, BER_AWGN_noGI, '-o', 'DisplayName', 'AWGN, no guard interval');
hold on;
semilogy(EbN0_dB, BER_CP_AWGN, '-s', 'DisplayName', 'AWGN, CP: 16');
semilogy(EbN0_dB, BER_ZP_AWGN, '-d', 'DisplayName', 'AWGN, ZP: 3');
semilogy(EbN0_dB, BER_CP_channel, '-x', 'DisplayName', 'Channel, CP: 16');
semilogy(EbN0_dB, BER_ZP_channel, '-^', 'DisplayName', 'Channel, ZP: 3');
semilogy(EbN0_dB, berawgn(EbN0_dB, 'qam', M), '--', 'DisplayName', 'AWGN analytic');
semilogy(EbN0_dB, berfading(EbN0_dB, 'qam', M, 1), ':', 'DisplayName', 'Rayleigh fading analytic');
grid on;
legend('show');
xlabel('Eb/N0 (dB)');
ylabel('BER');
title('BER performance for OFDM system with 16-QAM');
Output:
Conclusion: