0% found this document useful (0 votes)
7 views4 pages

BPSK BER Simulation with ZF Equalizer

research assistant help

Uploaded by

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

BPSK BER Simulation with ZF Equalizer

research assistant help

Uploaded by

Ali Akkas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Electronics and Communication Engineering Discipline

Khulna University
Assignment

Course No. : ECE 4209


Course Title : Mobile Communication Engineering

Submitted By
Ali Akkas
Student ID: 200934
Year: 4th
Term: II

Submitted To

Professor Dr. Mohammad Ismat Kadir

ECE Discipline
Khulna University

Date Of Submission: 28-11-2024


Name Of the assignment: Implementation of Zero-Forcing Equalizer.

Python Code:

import numpy as np
import [Link] as plt

def bpsk_modulation(binary_data):
"""Modulates binary data into BPSK symbols."""
return 2 * binary_data - 1 # Map 0 -> -1, 1 -> 1

def bpsk_demodulation(received_signals):
"""Demodulates received BPSK symbols back into binary data."""
return (received_signals.real > 0).astype(int)

def run_bpsk_ber_simulation():
ebno_dB_range = [Link](1, 11) # SNR range in dB
total_bit_count = int(1e5) # Number of bits to simulate
ber_values = np.zeros_like(ebno_dB_range, dtype=float)

for idx, ebno_dB in enumerate(ebno_dB_range):


# Generate random binary data
random_bits = [Link](0, 2, total_bit_count)

# Perform BPSK modulation


modulated_signal = bpsk_modulation(random_bits)

# Apply Rayleigh fading


channel_coeff = (1 / [Link](2)) *
([Link](len(modulated_signal)) +
1j * [Link](len(modulated_signal)))
channel_coeff /= [Link]([Link]([Link](channel_coeff)**2))
# Normalize power

# Add noise
ebno_linear = 10 ** (ebno_dB / 10) # Convert SNR from dB to
linear
noise_power = 1 / (2 * ebno_linear)
noise_samples = [Link](noise_power) *
([Link](len(modulated_signal)) +
1j *
[Link](len(modulated_signal)))

received_signal = channel_coeff * modulated_signal +


noise_samples

# Perform Zero Forcing equalization


zf_equalizer = 1 / channel_coeff
equalized_signal = zf_equalizer * received_signal

# Demodulate BPSK symbols back into binary data


decoded_bits = bpsk_demodulation(equalized_signal)

# Calculate Bit Error Rate (BER)


ber_values[idx] = [Link](random_bits != decoded_bits) /
len(random_bits)

# Plot BER vs SNR


[Link](figsize=(10, 6))
[Link](ebno_dB_range, ber_values, 'ro-', linewidth=2,
label='BPSK with ZF Equalizer')
[Link](True)
[Link]('SNR (dB)')
[Link]('Bit Error Rate (BER)')
[Link]('BER Performance for BPSK with ZF Equalizer')
[Link]()
[Link]()

if __name__ == "__main__":
run_bpsk_ber_simulation()
Output: Bit Error Rate vs SNR (up to 20 dB) -

You might also like