0% found this document useful (0 votes)
52 views8 pages

Digital Communication PDF

digital communication pdf

Uploaded by

soumojit048
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)
52 views8 pages

Digital Communication PDF

digital communication pdf

Uploaded by

soumojit048
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
You are on page 1/ 8

Dept.

of Electronics and Electrical Communication


Engineering
Indian Institute of Technology, Kharagpur
Digital Communication Laboratory (EC 39002)

Experiment No: 7
Title: CHANNEL CODING
Date of submission: 24/03/2024

Name: Soumojit Bhattacharya


Roll No: 21EC10071
Group No: 29
BPSK
Binary Phase Shift Keying (BPSK) is a modulation technique employed in communication
systems to transmit information via a communication channel. In BPSK the carrier signal is
modified by altering its phase by 180 degrees, for each symbol. A phase shift of 180 degrees
denotes a binary 0 while no phase shift represents a binary 1. The BPSKs modulation process
is straightforward and efficient making it suitable for scenarios where the communication
channel suffers from noise and interference.
Importance of BPSK
BPSK holds significance in communication systems like Wi-Fi, Bluetooth and satellite
communication. Its simplicity and robustness make it an excellent choice for applications where
the quality of the communication channel isn’t optimal. Using a basic phase shift to convey
symbols BPSK can reliably transmit data, over channels guaranteeing dependable
communication.
Advantages of BPSK
There are multiple advantages of Binary Phase Shift Keying process including all signals form,
such as:
● Simplicity: BPSK, which stands for Binary Phase Shift Keying is a modulation scheme. It
simplifies implementation, in hardware and software by utilizing two phase states; 0
degrees and 180 degrees.
● Effective Operation with Reliability: It has ability to operate effectively in the presence of
noise or interference from signals ensuring reliable performance.
● Less Power Consumption: BPSK consumes power compared to alternative methods
making it advantageous for battery powered devices.
● Easy Detection: Receivers find it easy to comprehend BPSK accurately determining the
frequency and phase of the transmitted signal.
● Compatible: BPSK serves as a building block for complex modulation schemes like
QPSK (Quadrature Phase Shift Keying) and higher order Quadrature Amplitude
Modulation (QAM).
Disadvantages of BPSK
Some of the disadvantages of Binary Phase Shift Keying process includes:
● Low Data Sending Rate: However when it comes to data transmission speed, BPSK has
limitations as it can only send one piece of data at a time.
● Less Efficient: It inefficiently uses the signal space, same like using a whole road for just
one small car.
● Can be Tricky: In situations such as communication, signal bouncing can pose
challenges, for BPSK as it weakens the signal strength and leads to potential issues.
● Limited Error Correction: BPSK does not provide as much inherent error correction
capability as more complex modulation schemes, therefore, error correction needs to be
added separately, which can increase system complexity.
● Not for Huge Data: If you need to send a lot of data fast then BPSK might not be the
best choice.

BPSK Reciever
The BPSK receiver uses a detector of correlation type to demodulate the received signal.
Coherent detection requires knowledge of carrier frequency and phase at the end. This
information can be obtained through either the Costas loop or the Phase Lock Loop (PLL).
Here we assumed prior knowledge of the carrier signal.
Methodology
Function to get BPSK from input
def get_bpsk(arr):
samplerate = 441000; fs = 1.0; k=1/len(arr)
t = np.linspace(0., 10., samplerate)
data = np.cos(2. * np.pi * fs * t)
for i in range(len(arr)):
if arr[i]==0:

data[int(k*i*samplerate):int(k*(i+1)*samplerate)]=-data[int(k*i*samplerate
):int(k*(i+1)*samplerate)]
return data
#write("example.wav", samplerate, data.astype(np.int16))

Function to get array from wav file


samplerate = 4410; fs = 100; k=0.25
t = np.linspace(0., k*len(arr)*fs, samplerate)
data = np.sin(2. * np.pi * fs * t)

write("example.wav", samplerate, bpsk.astype(np.int16))


from scipy.io import wavfile
samplerate, data = wavfile.read("example.wav")

Function to add noise


def add_noise(x_watts, target_snr_db):
target_snr_db=target_snr_db-10
sig_avg_watts = np.mean(x_watts)
sig_avg_db = 10 * np.log10(sig_avg_watts)
noise_avg_db = sig_avg_db - target_snr_db
noise_avg_watts = 10 ** (noise_avg_db / 10)
mean_noise = 0
noise_volts = np.random.normal(mean_noise, np.sqrt(noise_avg_watts),
len(x_watts))
y_volts = x_watts + noise_volts
return y_volts
To get a sin wave and multiply with signal after BPSK
fs = 1.0
samplerate = 441000
t = np.linspace(0., 10., samplerate)
sin=np.cos(2. * np.pi * fs * t)
final=bpsk
final[:]=bpsk[:]*sin[:]

Get bit values from the final signal.


Sampled at the middle of each time step
farr=[]
i=0
while (i+0.5)*samplerate/len(arr)<len(final1):
farr.append(int((1+final1[int((i+0.5)*samplerate/len(arr))])/2))
i=i+1

Find bits which have error and rate of error


error_bits=0
for i,j in zip(arr,farr):
if i != j:
error_bits += 1

error=error_bits/len(arr)
Finally Function to plot SNR vs error
def plot_err_snr(snr):
bpsk=add_noise(bpsk1,snr)
final=bpsk
final[:]=bpsk[:]*sin[:]
final2=np.zeros(len(final)+9)
final2[5:-4]=final
final1=np.convolve(final2, np.ones(10)/10, mode='valid')
final1=np.sign(final1)
farr=[]
i=0
while (i+0.5)*samplerate/len(arr)<len(final1):
farr.append(int((1+final1[int((i+0.5)*samplerate/len(arr))])/2))
i=i+1
error_bits=0
for i,j in zip(arr,farr):
if i != j:
error_bits += 1
error=error_bits/len(arr)
return error

Plotting
plt.plot(snrs, error_rate)
DIscussion
-In this experiment we were supposed to read an audio file,
encode it using -BPSK and then pass it through a hardware or
software channel to finally decode it.
-Using hardware channel was not possible for our group so we
decided to use a software channel.
-We were able to implement the modulation on hardware and see
the signal but were unable to take it as input to our laptops.
-I designed the channel to add white gaussian noise to the input.
-For reading and writing data I used a sample rate of 441000. I
decided to keep it high to prevent losing any data while reading
the audio file.
-BPSK is a modulation scheme where the phase of the carrier
signal is varied to represent binary data. In BPSK, the carrier
signal undergoes a 180-degree phase shift to represent the two
binary states (0 and 1).
-Demodulation was done by multiplying the signal after BPSK with
the sin wave used for modulation and taking its sign, which
happens using this operation:
int((1+final1[int((i+0.5)*samplerate/len(arr))])/2)
-I also sampled from the middle of each timestep corresponding
to each bit.
-The SNR vs error plot remains almost 0 while SNR is positive,
although it is not completely zero at SNR=0.
-The SNR then rises and saturates at 0.5 which is the error rate
that we would expect when guessing randomly indicating a
complete loss of data.
-This modulation technique is robust and relatively simple, making
it widely used in various communication systems.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy