0% found this document useful (0 votes)
10 views5 pages

Ofdm Exp 2

The document outlines an experiment to analyze the Bit Error Rate (BER) performance of Orthogonal Frequency Division Multiplexing (OFDM) using MATLAB. It details the theoretical background of OFDM, including key concepts like FFT/IFFT operations, guard intervals, and modulation techniques, followed by various scenarios for BER analysis under different channel conditions. The experiment involves simulating the transmission of data through both AWGN and multipath fading channels, with results plotted to compare the performance of different guard interval techniques.

Uploaded by

shreya khatu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views5 pages

Ofdm Exp 2

The document outlines an experiment to analyze the Bit Error Rate (BER) performance of Orthogonal Frequency Division Multiplexing (OFDM) using MATLAB. It details the theoretical background of OFDM, including key concepts like FFT/IFFT operations, guard intervals, and modulation techniques, followed by various scenarios for BER analysis under different channel conditions. The experiment involves simulating the transmission of data through both AWGN and multipath fading channels, with results plotted to compare the performance of different guard interval techniques.

Uploaded by

shreya khatu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

EXPERIMENT 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.

Key Concepts in OFDM:

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.

2. Guard Interval (GI):

- 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.

3. Cyclic Prefix (CP):

- 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.

4. Zero Padding (ZP):

- 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.

BER Analysis in Different Scenarios:

1. AWGN Channel without Guard Interval:

- 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.

2. AWGN Channel with Cyclic Prefix:


- The system operates in an AWGN environment, but with a CP added to each OFDM symbol. The CP helps
maintain subcarrier orthogonality and reduces ISI, improving BER.

3. AWGN Channel with Zero Padding:

- 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.

4. Multipath Fading Channel with Cyclic Prefix:

- 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.

5. Multipath Fading Channel with Zero Padding:

- 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.

Bit Error Rate (BER):

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

Set Parameters: Nfft, Ng_cp, Ng_zp, Nframe, M, Eb/N0, Channel Coefficients

Initialize BER Arrays

Loop over each Eb/N0 value:


1. Calculate Es/N0
2. Initialize error counters

Loop over each OFDM frame:


1. Generate random data
2. Perform 16-QAM modulation
3. IFFT to obtain time-domain signal
4. Add Cyclic Prefix (CP)
5. Add Zero Padding (ZP)

Transmit over AWGN Channel:


1. AWGN without Guard Interval (no GI)
2. AWGN with CP
3. AWGN with ZP
Transmit over Multipath Fading Channel:
1. Channel with CP
2. Channel with ZP

Receiver:
1. Remove CP/ZP
2. Perform FFT
3. 16-QAM Demodulation
4. Count Bit Errors

Calculate BER for each scenario

Loop back to next Eb/N0 value

Plot BER vs Eb/N0 for all scenarios

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;

% Pre-allocate BER arrays


BER_AWGN_noGI = zeros(length(EbN0_dB), 1);
BER_CP_AWGN = zeros(length(EbN0_dB), 1);
BER_ZP_AWGN = zeros(length(EbN0_dB), 1);
BER_CP_channel = zeros(length(EbN0_dB), 1);
BER_ZP_channel = zeros(length(EbN0_dB), 1);

for idx = 1:length(EbN0_dB)


EsN0 = 10^((EbN0_dB(idx) + 10*log10(log2(M)))/10);
noiseVar = 1/(2*EsN0);

% Error counters
numErr_AWGN_noGI = 0;
numErr_CP_AWGN = 0;
numErr_ZP_AWGN = 0;
numErr_CP_channel = 0;
numErr_ZP_channel = 0;

for frame = 1:Nframe


% Transmitter
data = randi([0 M-1], Nfft, 1);
modData = qammod(data, M, 'gray');
txSignal = ifft(modData, Nfft);
txSignal_CP = [txSignal(end-Ng_cp+1:end); txSignal];
txSignal_ZP = [txSignal; zeros(Ng_zp, 1)];

% 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)));

% Multipath Channel with CP and ZP


h = (randn(1, Ntap) + 1i*randn(1, Ntap)) .* sqrt(Power/2);
rxSignal_CP_channel = conv(h, txSignal_CP); rxSignal_CP_channel =
rxSignal_CP_channel(1:Nfft+Ng_cp) + noise_CP_AWGN;
rxSignal_ZP_channel = conv(h, txSignal_ZP); rxSignal_ZP_channel =
rxSignal_ZP_channel(1:Nfft+Ng_zp) + noise_ZP_AWGN;

% 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:

You might also like