0% found this document useful (0 votes)
39 views

Communication Manual

Uploaded by

Abinav anil
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)
39 views

Communication Manual

Uploaded by

Abinav anil
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/ 47

ECE Department, VAST ECL332 COMMUNICATION LAB

EXPERIMENT 1

GENERATION & DETECTION OF BPSK

AIM: To design and setup a circuit for BPSK and detect the same.

COMPONENTS AND EQUIPMENT REQUIRED: IC LM741, IC CD4066, resistors,


capacitors, function generator, DC power supply, DSO, breadboards, connecting wires.

THEORY:
Phase shift keying (PSK) is a digital modulation scheme that conveys data by changing or
modulating, the phase of a reference signal (the carrier wave).
Any digital modulation scheme uses a finite number of digital signals to represent digital data.
PSK uses a finite number of phases, each assigned a unique pattern of binary bits. Usually
each phase encodes an equal number of bits. Each pattern of bits form the symbol that is
represented by the particular phase. The demodulator which is designed specifically for the
symbol set used by the modulator, determines the phase of the received signal and maps it
back to the symbol it represents, thus recovering the original data. This requires the receiver
to be able to compare the phase of the received signal to a reference signal. Such a system is
termed coherent.

DESIGN:
Astable Multivibrator:
Take β = 1/2
R1/(R1 + R2) = 1/2
Take R1 = 10K, then R2 = 10K
Frequency of i/p data, fc = 1KHz
Therefore, T = 1ms
T = T1 + T2
T1 = T2 = 1.1RC = 0.5ms
Take C = 0.01μf, then R = 47K

Reconstruction filter:
Take R1 = R2 = R3 = 10K for unity gain
1/2πRC = 1/T = 1/1ms => fi = 1KHz
Take C = 0.01μf, then R = 15K

1
ECE Department, VAST ECL332 COMMUNICATION LAB

CIRCUIT DIAGRAM:

2
ECE Department, VAST ECL332 COMMUNICATION LAB

SAMPLE WAVEFORM:

PROCEDURE:
1. Setup the astable multivibrator circuit on breadboard and obtain the digital signal from it.
2. Feed the digital signal to pin 13 and its inverted version to pin 5 of IC CD 4066 switch
IC.
3. Feed 2Vpp, 10KHz sine wave as the analog input to pin 1 and its inverted version to pin
3 of
4. CD 4066.
5. Observe the BPSK output.
6. Set up the demodulator circuit and feed the BPSK signal as well as carrier signal as
inputs.
7. Vary the potentiometer if required and compare the reconstructed output with the
original data signal.

RESULT:
Circuit for generation and detection of BPSK was designed, set up and outputs verified.

3
ECE Department, VAST ECL332 COMMUNICATION LAB

EXPERIMENT 2

GENERATION & DETECTION OF DM

AIM: To design and setup a circuit for Delta modulation and demodulate the same.

COMPONENTS AND EQUIPMENT REQUIRED: IC LM741, IC 7474, resistors,


capacitors, potentiometer, function generator, DC power supply, DSO, breadboards,
connecting wires.

THEORY:
The definition of Delta Modulation is the signal conversion technique from analog to
digital and digital to analog. This technique prefers where the signal quality is not an
important parameter. Differential pulse code modulation uses the predictive waveform
coding technique for signal conversion. The same technique also applied by using this
modulation process. In this modulation, the sampling rate is higher to reduce the
number of steps to decrease the bandwidth of the signal. It is a one form of the
differential pulse code modulation (DPCM) and can be called as 1-bit DPCM.
Delta modulation is a differential PCM scheme in which the difference signal is
encoded into a single bit. This single bit is transmitted per sample to indicate whether
the signal is larger or smaller than the previous sample. The modulating signal m(t)
and its quantized approximation m`(t) are applied to the comparator. Comparator
provides a high level output when m(t) > m`(t) and it provides low level output when
m(t) < m`(t).

DESIGN:
Take message frequency fm = 200Hz
Sampling frequency fs =10KHz

In modulator, Integrator:
R1C1 > 16T
R1C1 > 16 x 1/10KHz
Take C = 0.1μF, then R = 15K

4
ECE Department, VAST ECL332 COMMUNICATION LAB

In demodulator Low pass filter:


fm < 1/2πR2C2
Take C2 = 0.1μF, then R2 = 5.6K

CIRCUIT DIAGRAM:

5
ECE Department, VAST ECL332 COMMUNICATION LAB

SAMPLE WAVEFORM:

PROCEDURE:
1. Set up the circuit on breadboard.
2. Feed message signal and clock signal. Vary the message signal slightly, if
required.
3. Vary the potentiometer to get the correct variation in delta signal.
4. Observe the outputs of various sections.
5. Set up the demodulator circuit.
6. Verify the demodulated output with the message signal.

RESULT:
Circuit for Delta Modulation and demodulation was designed, set up and outputs
verified.

6
ECE Department, VAST ECL332 COMMUNICATION LAB

EXPERIMENT 3

PERFORMANCE OF WAVEFORM CODING USING


PCM

AIM
To implement the following in Octave:
1. Generate a sinusoidal waveform with a DC offset so that it takes only positive
amplitude value.
2. Sample and quantize the signal using an uniform quantizer with number of
representation levels L. Vary L. Represent each value using decimal to binary
encoder.
3. Compute the signal-to-noise ratio in dB.
4. Plot the SNR versus number of bits per symbol. Observe that the SNR increases
linearly.

REQUIREMENTS
PC

THEORY
Pulse code modulation is a method that is used to convert an analog signal into a
digital signal so that a modified analog signal can be transmitted through the digital
communication network. PCM is in binary form, so there will be only two possible
states: high and low(0 and 1). We can also get back our analog signal by
demodulation. The Pulse Code Modulation process is done in three steps Sampling,
Quantization, and Coding.

7
ECE Department, VAST ECL332 COMMUNICATION LAB

A low pass filter helps in removing the high-frequency components included in the
input of the analog signal. These frequency components are higher than the highest
frequency of the message signal. Hence, a low pass filter is added in the pulse code
modulation technique to avoid aliasing of the message signal.Sampler helps to collect
the sample data at any time of the message signal, in order to reform the original
signal. As per the sampling theorem, the sampling rate is greater than the highest
frequency component of the message signal. Quantizer helps to minimise the error
through the process known as quantizing. The sampled output when passed through a
quantizer, reduces the unnecessary bits and also helps in compressing the obtained
values.The encoder is used for digitising the analog signal. Encoder helps to allot each
quantised level through a binary code. The sample-and-hold process is adopted in this.
Low pass filter, sampler, and quantiser aids to convert analog to digital forms.
Encoding also aids in minimising the usage of bandwidth. Regenerative repeater is
used to compensate for the signal loss and also reform the signal. It also helps to
increase signal strength. Hence, the output of the channel is equipped with one
regenerative repeater circuit. The decoder helps to form the original signal by
decoding the pulse coded waveform. Decoder acts as the demodulator. The
reconstruction filter helps to obtain the original signal. In the pulse code modulator
circuit, the given analog signal is digitized, coded and sampled. The resultant signal is
transmitted in an analog form. In order to obtain the original signal, the whole process
is repeated in a reverse pattern .

8
ECE Department, VAST ECL332 COMMUNICATION LAB

PROGRAM:
clc;
close all;
clear all
fm=5; %message signal freq
A=5;% message signal amplitude
fs=50; % sampling frequency
n=4; % no. of bits for encoding
t=0:1/(100*fm):1;
x=A*cos(2*pi*fm*t); % message signal

%---Sampling-----
ts=0:1/fs:1;
xs=A*cos(2*pi*fm*ts); % sampled signal
%xs Sampled signal

%--Quantization---
x1=xs+A;
x1=x1/(2*A);
L=(-1+2^n); % Levels
x1=L*x1;
xq=round(x1);

%----Encoding---
y=[];
for i=1:length(xq)
d=dec2bin(xq(i),n)
y=[y double(d)-48];
end
%Calculations

figure(1)
plot(t,x,'linewidth',2)

9
ECE Department, VAST ECL332 COMMUNICATION LAB

title('Sampling')
ylabel('Amplitute')
xlabel('Time t(in sec)')
hold on
stem(ts,xs,'r','linewidth',2)
hold off
legend('Original Signal','Sampled Signal');

figure(2)
stem(ts,x1,'linewidth',2)
title('Quantization')
ylabel('Levels L')
hold on
stem(ts,xq,'r','linewidth',2)
plot(ts,xq,'--r')
plot(t,(x+A)*L/(2*A),'--b')
grid
hold off
legend('Sampled Signal','Quantized Signal');

figure(3)
stairs([y y(length(y))],'linewidth',2)
title('Encoding')
ylabel('Binary Signal')
xlabel('bits')
axis([0 length(y) -1 2])
grid

10
ECE Department, VAST ECL332 COMMUNICATION LAB

OUTPUT:

11
ECE Department, VAST ECL332 COMMUNICATION LAB

RESULT: Implemented PCM in octave

12
ECE Department, VAST ECL332 COMMUNICATION LAB

EXPERIMENT 4

PULSE SHAPING AND MATCHED FILTERING

AIM
The aim of this experiment is to write code in Octave for implementing the following:
1. Generate a string of message bits.
2. Use root raised cosine pulse p(t) as the shaping pulse, and generate the
corresponding baseband signal with a fixed bit duration Tb. Use roll-off factor as α =
0.4.
3. Simulate transmission of baseband signal via an AWGN channel
4. Apply matched filter with frequency response Pr(f ) = P ∗ (f ) to the received
signal.
5. Sample the signal at mTb and compare it against the message sequence.

REQUIREMENTS
PC

THEORY
In communication systems, data is transmitted as binary bits (ones and zeros). It is
easier to implement a binary system using switches, where turning on a switch
represents ‘1’ and turning it off represents ‘0’. Such simple binary systems essentially
represent ones and zeros as rectangular pulses of finite duration (say τ seconds).
In practical terms, signals will not extend infinitely forward and backward in time.
But it will definitely be non-zero after the time duration τ. This implies that the
residues of adjacent symbols/signals overlap with each other giving rise to Inter
Symbol Interference (ISI). If the residual energy from the adjacent symbol is very
strong, it becomes impossible to distinguish the present symbol and there is a
possibility of it being misinterpreted altogether. To avoid or reduce this effect, “Pulse
Shaping” techniques are used to make sure that the data carried by the symbols are
not affected by the overlapping effect of adjacent symbols.
In a band-limited system, when we try to increase the data rate, it may lead to Inter
Symbol Interference (ISI). There are two criteria that must be satisfied for a non-
interference system when pulse shaping is employed.

13
ECE Department, VAST ECL332 COMMUNICATION LAB

(1) The pulse shape exhibits a zero crossing at the sampling point of all pulse intervals
(2) The shape of the pulses is such that the amplitude decays rapidly outside of the
pulse interval.
Pulse shapes filters like raised cosine filters, square root raised cosine filters and
matched filters are employed to shape the transmitted pulses so that they will satisfy
the above two criteria of providing an ISI free system
Square Root Raised Cosine Filter

Instead of using a single Raised Cosine filter at the transmitter, a square root raised
cosine filter is used at both transmitter and receiver. Using a single raised cosine filter
at the transmitter or two separate SRRC filters (one at the transmitter and another at
the receiver) will have the same effect on ISI. But using SRRC filters at the
transmitter and receiver provides better matching characteristics and thereby improves
the overall SNR of the system considerably.
The impulse response of the SRRC filter is given by

PROGRAM

Function to implement Square Root Raised Cosine Filter:


function [response]=srrc(os_factor,roll_off)
a=roll_off;
t=-4:1/os_factor:4; %Limiting the response to -4T to 4T
%This can be increased or decreased according to the requirement

14
ECE Department, VAST ECL332 COMMUNICATION LAB

p=zeros(1,length(t));
for i=1:1:length(t)
if t(i)==0 p(i)= (1-a)+4*a/pi;
elseif t(i)==1/(4*a) || t(i)==-1/(4*a) p(i)=a/sqrt(2)*((1+2/pi)*sin(pi/(4*a)+(1-
2/pi)*cos(pi/(4*a))));
else p(i) = (sin(pi*t(i)*(1-a))+4*a*t(i).*cos(pi*t(i)*(1+a)))./(pi*t(i).*(1-(4*a*t(i)).^2));
end
end
end
response=p./sqrt(sum(p.^2)); %Normalization to unit energy
end

Simulation of Square Root Raised Cosine Filter:


clc;clear;close all;
overSampling_Factor=8;
Input_bit = [1]; %Bits to be transmitted
Input_bit_os=upsample(Input_bit,overSampling_Factor); %oversampling
alpha=0.1; % roll-off factor of Root Raised Cosine Filter
pt = srrc(overSampling_Factor,alpha); % impulse response of SRRC filter
output_of_srrc_filter = conv(Input_bit_os,pt);
stem(output_of_srrc_filter);
title('Response of SRRC Filter at Tx side')
xlabel('Samples')
ylabel('Amplitude')
output_of_srrc_filter=awgn(output_of_srrc_filter,100);
%Receiver side; using a matched filter (that is matched to the SRRC pulse in the
transmitter)
y = conv(output_of_srrc_filter,pt);
stem(y);
title('Matched filter (SRRC) response at Rx side');
xlabel('Samples');
ylabel('Amplitude');
midSample=length(-4:1/overSampling_Factor:4);
y_truncated=y(midSample-1:end);

15
ECE Department, VAST ECL332 COMMUNICATION LAB

%Remove unwanted portions(first few samples till the peak value)


%Now the first sample contains the peak value of the response. From here the
samples are %extracted depending on the oversampling factor
y_down = downsample(y_truncated,overSampling_Factor,1);
%here offset=1 means starting from 1st sample %retain every 8th sample
stem(y_down);
title('Down sampled output (ADC conversion and Sampling)');
xlabel('Samples');
ylabel('Amplitude');

OUTPUT

16
ECE Department, VAST ECL332 COMMUNICATION LAB

RESULT
Implemented pulse shaping and matched filter.

17
ECE Department, VAST ECL332 COMMUNICATION LAB

EXPERIMENT 5

EYE DIAGRAM

AIM
To implement the following:
1. Generate a string of message bits.
2. Use raised cosine pulse p(t) as the shaping pulse, and generate the corresponding
baseband signal with a fixed bit duration Tb. You may use the roll-off factor as α =
0.4.
3. Use various roll off factors and plot the eye diagram in each case for the received
signal. Make a comparison study among them.

REQUIREMENT
PC

THEORY
In communication systems, data is transmitted as binary bits (ones and zeros). It is
easier to implement a binary system using switches, where turning on a switch
represents ‘1’ and turning it off represents ‘0’. Such simple binary systems essentially
represent ones and zeros as rectangular pulses of finite duration (say τ seconds).
In practical terms, signals will not extend infinitely forward and backward in time.
But it will definitely be non-zero after the time duration τ. This implies that the
residues of adjacent symbols/signals overlap with each other giving rise to Inter
Symbol Interference (ISI). If the residual energy from the adjacent symbol is very
strong, it becomes impossible to distinguish the present symbol and there is a
possibility of it being misinterpreted altogether. To avoid or reduce this effect, “Pulse
Shaping” techniques are used to make sure that the data carried by the symbols are
not affected by the overlapping effect of adjacent symbols.
In a band-limited system, when we try to increase the data rate, it may lead to Inter
Symbol Interference (ISI). There are two criteria that must be satisfied for a non-
interference system when pulse shaping is employed.
(1) The pulse shape exhibits a zero crossing at the sampling point of all pulse intervals

18
ECE Department, VAST ECL332 COMMUNICATION LAB

(2) The shape of the pulses is such that the amplitude decays rapidly outside of the
pulse interval.
Pulse shapes filters like raised cosine filters, square root raised cosine filters and
matched filters are employed to shape the transmitted pulses so that they will satisfy
the above two criteria of providing an ISI free system
Raised Cosine Filters/Pulses:
A Raised Cosine looks more like a modified sinc pulse in time domain and is given by
the following function (This equation is apt for digital domain and Matlab simulation,
it is obtained from its analog form by substituting “t” by n*TS)

Here TS is the sampling period, n is the sample number, α is a parameter that governs
the bandwidth occupied by the pulse and the rate at which the tails of the pulse decay.
A value of α = 0 offers the narrowest bandwidth, but the slowest rate of decay in the
time domain. When α = 1, the bandwidth is 1/τ, but the time domain tails decay
rapidly.

PROGRAM
function [g]=rc(alpha,Ts,T)
L=41; %Filter Length
R=1E6; %Data Rate = 1Mbps
oversample=8
Fs=oversample*R; %Oversampling by 8
T=1/R;
Ts=1/Fs;
alpha =0.4; % Design Factor for Raised Cosine Filter
if mod(L,2)==0

19
ECE Department, VAST ECL332 COMMUNICATION LAB

M=L/2 ; % for even value of L


else
M=(L-1)/2; % for odd value of L
end
g=zeros(1,L); % Place holder for RC filter's transfer function
for n=-M:M
num=sin(pi*n*Ts/T)*cos(alpha*pi*n*Ts/T);
den=(pi*n*Ts/T)*(1-(2*alpha*n*Ts/T)^2);
g(n+M+1)=num/den;
if (1-(2*alpha*n*Ts/T)^2)==0
g(n+M+1)=pi/4*sin(pi*n*Ts/T)/(pi*n*Ts/T);
end
if n==0
g(n+M+1)=cos(alpha*pi*n*Ts/T)/(1-(2*alpha*n*Ts/T)^2);
end
End

Main Program
close all;
clear all
clc;
%Generate data of random 1s and 0s
data=2*(rand(1,1000)>=0.5)-1; %Polar encoding : 1= +1V, 0=-1V
output=upsample(data,Fs/R);
g=rc(alpha,Ts,T)% Plot the transfer function of RC filter
figure;
impz(g,1);
%y=conv(g,output); %Convolving the data signal with the Raised Cosine Filter
y=filter(g,1,output); %you can use either Conv function or filter function to obtain the
output
%Plot data and RC filtered Output
figure;
subplot(2,1,1);
stem(data);

20
ECE Department, VAST ECL332 COMMUNICATION LAB

title('Input data to the Raised Cosine Filter');


xlabel('Samples');
ylabel('Amplitude');
axis([0,20,-1.5,1.5])
subplot(2,1,2);
plot(y);
axis([0,160,-1.5,1.5])
title('Response of the Raised Cosine Filter for the given Input');
xlabel('Samples');
ylabel('Amplitude');
eyediagram(y,oversample)

OUTPUT

21
ECE Department, VAST ECL332 COMMUNICATION LAB

RESULT
Implemented raised cosine pulse shaping with roll off factor 0.4 and observed the eye
diagram for different roll off factors.

22
ECE Department, VAST ECL332 COMMUNICATION LAB

EXPERIMENT 6

ERROR PERFORMANCE OF BPSK

AIM
1. Generate a string of message bits.
2. Encode using BPSK with energy per bit Eb and represent it using points in a signal-
space.
3. Simulate transmission of the BPSK modulated signal via an AWGN channel with
variance N0/2.
4. Detect using an ML decoder

REQUIREMENTS
PC

THEORY
Binary Phase Shift Keying (BPSK) is a two phase modulation scheme, where the 0’s
and 1’s in a binary message are represented by two different phase states in the carrier
signal: for binary 1 and for binary 0.n BPSK, only one sinusoid is
taken as the basis function. Modulation is achieved by varying the phase of the
sinusoid depending on the message bits. Therefore, within a bit duration , the two
different phase states of the carrier signal are represented as,

where, is the amplitude of the sinusoidal signal, is the carrier frequency (Hz),
being the instantaneous time in seconds, is the bit period in seconds. The signal
stands for the carrier signal when information bit was transmitted and the
signal denotes the carrier signal when information bit was transmitted.
In order to get nice continuous curves, the oversampling factor in the simulation
should be appropriately chosen. If a carrier signal is used, it is convenient to choose
the oversampling factor as the ratio of sampling frequency ( ) and the carrier
frequency ( ). The chosen sampling frequency must satisfy the Nyquist sampling
theorem with respect to carrier frequency. For baseband waveform simulation, the
oversampling factor can simply be chosen as the ratio of bit period ( ) to the chosen

23
ECE Department, VAST ECL332 COMMUNICATION LAB

sampling period ( ), where the sampling period is sufficiently smaller than the bit
period.
A BPSK transmitter, shown in Figure 1, is implemented by coding the message bits
using NRZ coding ( represented by positive voltage and represented by negative
voltage) and multiplying the output by a reference oscillator running at carrier
frequency .

A correlation type coherent detector, shown in Figure 2, is used for receiver


implementation. In coherent detection technique, the knowledge of the carrier
frequency and phase must be known to the receiver. This can be achieved by using a
Costas loop or a Phase Lock Loop (PLL) at the receiver. For simulation purposes,
we simply assume that the carrier phase recovery was done and therefore we directly
use the generated reference frequency at the receiver – .

PROGRAM
clc;
clear all;
close all;
%variable declaration
b=[];

24
ECE Department, VAST ECL332 COMMUNICATION LAB

x1=[];
N=10000;%Number of symbols
vara=[];
BER=[];
Eb_NO2=[];
BERtheor2=[];
%--------------Message signal----------------------------------
t=0:.01:.49;
fc1=sin(2*pi*10*t);
fc11=(1/sqrt(sum(fc1.^2))).*fc1;
x=randint(1,N);
x2=(2*x)-1
%Modulation
%-------------------------------------------------------------------
for i=1:N
if (x(i)==0)
mod1=-fc11;
else
mod1=fc11;
end
b=[b,mod1];
end
t1=0:.02:9.98;
for j=1:10
x1=[x1 x2(j)*(ones(1,50)*5)];
end
%Plotting of Waveforms
%-------------------------------------------------------------------
figure(1)
subplot(2,1,1);
plot(t1,x1([1:500]));
title('Message');
xlabel('time in seconds');
ylabel('voltage');

25
ECE Department, VAST ECL332 COMMUNICATION LAB

axis([0 6 -6 6]);
subplot(2,1,2);
plot(t1,b([1:500]));
title('Modulated Waveform');
xlabel('time in seconds');
ylabel('voltage');
axis([0 5 -0.3 0.3]);
Eb=sqrt(sum(fc11.^2));%Energy of the signal
for h=0:.1:1
var=h^2;
vara=[vara var];
%Adding AWGN to the modulated signal
%-------------------------------------------------------------------
w=b + h.*randn(1,length(b));
w1=reshape(w,50,(length(b)/50));
g=w1'*fc11';
f=zeros(length(g),1);
%Demodulation
%-------------------------------------------------------------------
for i=1:N
if g(i)>0
s(i)=1;
else
s(i)=0;
end
end
%Finding the BER
%-------------------------------------------------------------------
u=xor(x,s);
ber=sum(u)/N;
BER=[BER ber];
BERtheor1=0.5*erfc(sqrt(Eb/(2*var)));
BERtheor2=[BERtheor2,BERtheor1];
Eb_NO1=(1/(2*var));

26
ECE Department, VAST ECL332 COMMUNICATION LAB

Eb_NO2=[Eb_NO2,Eb_NO1];
end
figure(2);
semilogy((10*log10(abs(Eb_NO2))),BER,'-.*g');
xlabel('SNR in dB');
ylabel('BER');
title('BER');
hold on
semilogy((10*log10(abs(Eb_NO2))),BERtheor2,'-ro');%Plotting BER
a=legend('BER','BER theoretical');
%a=legend("BER","BER theoretical",3);
set(a,'Interpreter','none');
axis([-5 20 .00001 1]);

OUTPUT

27
ECE Department, VAST ECL332 COMMUNICATION LAB

RESULT
Simulated BPSK using octave.

28
ECE Department, VAST ECL332 COMMUNICATION LAB

EXPERIMENT 7

ERROR PERFORMANCE OF QPSK

AIM
To set up a QPSK modulation and demodulation using Octave and evaluate the error
performance of modulation.

REQUIREMENTS
PC

THEORY

The Quadrature Phase Shift Keying QPSKQPSK is a variation of BPSK, and it is


also a Double Side Band Suppressed Carrier DSBSCDSBSC modulation scheme,
which sends two bits of digital information at a time, called as bigits.

Instead of the conversion of digital bits into a series of digital stream, it converts them
into bit pairs. This decreases the data bit rate to half, which allows space for the other
users.

The probability of bit-error for QPSK is the same as for BPSK

BER OF QPSK = Q[√(Es/No)] = Q[√(2Eb/No)]

The symbol error rate is given by

Ps =1 -(1 - Pb)2

= 2Q[√(Eb/No)] - Q2(√(Es/No)

PROGRAM

% QPSK MODULATION AND BER ESTIMATION IN AWGN CHANNEL


clc; clear all; close all;
N=1e6; % Number of bits transmited
SNRdB= 0:1:20; % SNR for simulation
SNRlin=10.^(SNRdB/10);

29
ECE Department, VAST ECL332 COMMUNICATION LAB

BER = zeros(1,length(SNRlin));% simulated BER


SER = zeros(1,length(SNRlin));% simulated SER
b1 = rand(1,N) > 0.5;
b2 = rand(1,N) > 0.5;
% QPSK symbol mapping
I = (2*b1) - 1;
Q = (2*b2) - 1;
S = I + 1j*Q;
N0 = 1./SNRlin; % Variance
for k = 1:length(SNRdB)
noise = sqrt(N0(k)/2)*(randn(1,N) + 1j*randn(1,N)); % AWGN noise
sig_Rx = S + noise; % Recived signal

% For BER calculation


sig_I = real(sig_Rx); % I component
sig_Q = imag(sig_Rx); % Q component
bld_I = sig_I > 0; % I decision
bld_Q = sig_Q > 0; % Q decision
b1_error = (bld_I ~= b1); % Inphase bit error
b2_error = (bld_Q ~= b2); % Quadrature bit error
Error_bit = sum(b1_error) + sum(b2_error); % Total bit error
BER(k) = sum(Error_bit)/(2*N); % Simulated BER

% For SER calculation


error_symbol = or(b1_error, b2_error); % if bit in I or bit in Q either
wrong than error
SER(k) = sum(error_symbol)/N;
End

BER_theo = 2*qfunc(sqrt(2*SNRlin)); % Theoretical BER


SER_theo = 2*qfunc(sqrt(2*SNRlin)) - (qfunc(sqrt(2*SNRlin))).^2;
% Theoretical SER
figure(1);
semilogy(SNRdB, BER_theo,'r-')
hold on
semilogy(SNRdB, BER,'k*')
xlabel('SNR[dB]')
ylabel('Bit Error Rate');

30
ECE Department, VAST ECL332 COMMUNICATION LAB

legend('Theoretical', 'Simulated');
title(['Probability of Bit Error for QPSK Modulation']);
grid on;
hold off;
figure(2);
semilogy(SNRdB, SER_theo,'r-')
hold on
semilogy(SNRdB, SER,'k*')
xlabel('SNR[dB]')
ylabel('Symbol Error Rate');
legend('Theoretical', 'Simulated');
title(['Probability of symbol Error for QPSK Modulation']);
grid on;
hold off;

OUTPUT

31
ECE Department, VAST ECL332 COMMUNICATION LAB

RESULT

Simulated QPSK using octave and evaluated the rror performance.

32
ECE Department, VAST ECL332 COMMUNICATION LAB

EXPERIMENT 8

FAMILIARIZATION WITH SOFTWARE DEFINED


RADIO

AIM
1. Familiarize with an SDR hardware for reception and transmission of RF signal.
2. Familiarize how it can be interfaced with computer.
3. Familiarize with GNU Radio that can be used to process the signals received
through the SDR hardware.
4. Familiarize available blocks in GNU Radio. Study how signals can be generated
and spectrum (or power spectral density) of signals can be analyzed. Study how
filtering can be performed.

REQUIREMENTS
PC, SDR ADALM-PLUTO

THEORY
The ADALM-PLUTO Active Learning Module (PlutoSDR) is an easy to use tool
available from Analog Devices Inc. The PlutoSDR allows students to better
understand the real-world RF around them, and is applicable for all students, at all
levels, from all backgrounds. The PlutoSDR Active Learning Module is a tool that
closes the relationship between theory and practical radio frequency activities of the
user.

Based on the AD9363, it offers one receive channel and one transmit channel which
can be operated in full duplex, capable of generating or measuring RF analog signals
from 325 to 3800 MHz, at up to 61.44 Mega Samples per Second (MSPS) with a
20 MHz bandwidth. The PlutoSDR is completely self-contained, handy, and is
entirely USB powered with the default firmware. With support for OS X™,
Windows™, and Linux™, it allows exploration and understanding of RF systems no
matter where the user is or when.

33
ECE Department, VAST ECL332 COMMUNICATION LAB

Features:

 Portable self-contained RF learning module

 Cost-effective experimentation platform


 Based on Analog Devices AD9363--Highly Integrated RF Agile Transceiver and
Xilinx® Zynq Z-7010 FPGA
 RF coverage from 325 MHz to 3.8 GHz
 Up to 20 MHz of instantaneous bandwidth
 Flexible rate, 12-bit ADC and DAC
 One transmitter and one receiver, half or full duplex
 MATLAB®, Simulink® support
 GNU Radio sink and source blocks
 libiio, a C, C++, C#, and Python API
 USB 2.0 Powered Interface with Micro-USB 2.0 connector

PROCEDURE
Note: Disconnect ADALM Pluto while installing and software or drivers related to
Analog devices.
1. Connect ADALM-Pluto via usb to system installed with GNU radio Companion
and ADALM Drivers
2. Cconnect Transmitter and receiver antenna
2. Open GNU radio Companion
 Windows search in start (click on GNU radio Companion or GRC)
 Linux Type gnuradio-companion in Terminal

34
ECE Department, VAST ECL332 COMMUNICATION LAB

3. Build flow graph or use existing examples to open project

35
ECE Department, VAST ECL332 COMMUNICATION LAB

4. Build and run project

5. Use GUI visualize to see frequency/Time/waterfall/constellation plots

RESULT
Familiarised with the SDR hardware and GNU radio interface.

36
ECE Department, VAST ECL332 COMMUNICATION LAB

EXPERIMENT 9

FM RECEPTION
AIM
1. Receive digitized FM signal (for the clearest channel in the lab) using the SDR
board.
2. Set up an LPF and FM receiver using GNU Radio.
3. Use appropriate sink in GNU Radio to display the spectrum of signal.
4. Resample the voice to make it suitable for playing on computer speaker.

THEORY
PlutoSDR Sink
IIO context URI
IP address of the unit, e.g. "ip:192.168.2.1" (without the quotes)
LO Frequency
Selects the TX local oscillator frequency.
Sample Rate
Sample rate in samples per second, this will define how much bandwidth your
SDR transmits (the RF bandwidth parameter below just defines the filter).
limits: >= 520833 and <= 61440000. A FIR filter needs to be loaded or set to
auto for values below 2.083 MSPS.
RF Bandwidth
Configures TX analog filters: TX BB LPF and TX Secondary LPF. limits: >=
200000 and <= 52000000
Buffer size
Size of the internal buffer in samples. The IIO blocks will only input/output
one buffer of samples at a time. To get the highest continuous sample rate,
try using a number in the millions.StarCom Information Technology Limited
TI-Solutions
9

Low Pass Filter:


FIR Type (R)
Specify whether input/output is real or complex

37
ECE Department, VAST ECL332 COMMUNICATION LAB

Decimation
Decimation rate of filter, must be an integer, and cannot change in
realtime.
Gain (R)
Scaling factor applied to output.
Sample Rate (R)
Input sample rate.
Cutoff Freq (R)
Cutoff frequency in Hz
Transition Width (R)
Transition width between stop-band and pass-band in Hz
Window (R)
Type of window to use
Beta (R)
The beta paramater only applies to the Kaiser window.

Wide Band Frequency Modulation Receiver (WBFM)


Channel Rate
Input sample rate of complex baseband input. (float)
Audio Decimation
How much to decimate Channel Rate to get to audio. (integer)
Deviation
FM modulation deviation. Standard broadcast FM uses 75kHz
Audio Pass
Low pass filter roll-off frequency
Audio Stop
Low pass filter cut-off frequency
Gain
Audio gain
Tau
Pre-emphasis time constant (float) - typically 75e

38
ECE Department, VAST ECL332 COMMUNICATION LAB

Multiply Const
Constant (R)
Scalar or vector constant. If the input is a vector, this parameter must be
a vector of the same size. To multiply all the input items by the same
value, use Fast_Multiply_Const.

Audio Sink
Allows a signal to be played through your speakers or other audio device
Sample Rate
To set the Audio sampling rate, click the drop-down menu to see popular
rates. Note: not all sampling rates will be supported by your hardware. For
typical applications, this should be set to 48kHz.

BLOCK DIAGRAM

39
ECE Department, VAST ECL332 COMMUNICATION LAB

OUTPUT GRAPHS

40
ECE Department, VAST ECL332 COMMUNICATION LAB

RESULT
Generated an FM receiver.

41
ECE Department, VAST ECL332 COMMUNICATION LAB

VIVA QUESTIONS
1)Which types of digital modulation techniques do you know?
The different types of digital modulation techniques are:
a. Amplitude shift Keying (ASK)
b. Frequency Shift Keying (FSK)
c. Phase Shift Keying (PSK)
d. Pulse Code Modulation (PCM)
e. Differential Pulse Code Modulation (DPCM)
f. Delta Modulation (DM)
2)What do you know about Nyquist Rate in the sampling process?
Nyquist rate is the sampling rate at which the sampling frequency is twice that of the
maximum frequency component of the continuous time signal.
fs = 2fm
3)How many types of analog pulse modulation methods do you know? List all?
The different types of analog pulse modulation methods are:
a.Pulse Amplitude Modulation (PAM)
b. Pulse Width Modulation (PWM)
c. Pulse Position Modulation (PPM)
4)What is bandwidth of BPSK signal?
The bandwidth of a BPSK signal is 2Fc, where Fc is the carrier frequency 5)What is
Sampling?
Converting a continuous time signal into discrete in time signal is called as
Sampling (similar to cutting a bread into slices)
6)What is the aliasing effect? How to overcome it?
Due to imperfect sampling, the signals will interfere in the frequency domain i.e
called aliasing effect in sampling. if the sampling theorem is satisfied in sampling or
first by passing the signal from the anti-aliasing filter before sampling then the
aliasing effect will be reduced.
7)What is Quadrature Phase shift Keying (QPSK)?
for each two bits of binary data (00,01,10 & 11) carrier phase will be changed
(four different shifts : 45, 135, -45, -135)
8)What is the difference between Bit Rate and Baud Rate?

42
ECE Department, VAST ECL332 COMMUNICATION LAB

Bit rate represents Bits per sec, Baud rate represents no. of symbols per second i.e. in
communications the no. of bits transmitted per sec is called as Bit Rate (units bps) and
The no. of times a signal (here carrier) changes its state (change in frequency, phase,
amplitude) per sec is called as Baud rate.

9)Define Pulse code modulation?


Each and every quantized sample will be encoded with a sequence of zeros and ones
with 'n' bits within the sampling interval (Ts), So the bit duration will be Ts/n. as no.
of bits (n) increases error decreases but bandwidth increases 10)Define Quantization
error?
It is the difference between sampled signal and Quantized signal.
11)Why DPCM is better than PCM?
Instead of encoding each sample, It’s better to encode the difference between samples
then Quantization error will be minimized with less no. of bits, and the bandwidth
also get decreased.
12) Define ISI (Inter symbol Interference)?
It is a Distortion in digital signal that one symbol interferes with other symbols.
13) What is Matched filter?
It is an optimal linear filter for maximizing the SNR (Signal to Noise Ratio) in the
presence of additive random noise.
14)Which modulation is used for video signals?
Amplitude modulation is used for video signals.
15)What are the types of amplitude modulation?
a. double sideband modulation (DSB-AM)
b. double sideband suppressed carrier modulation (DSB SC-AM)
c. single sideband carrier modulation(SSB AM)
d. single sideband suppressed carrier modulation (SSB SC-AM)
e. vestigial sideband modulation (VSB AM)
16) What are the applications of AM?
a. AM radio broadcasting.
b. AM video transmission.
17)What is meant by multiplexing?

43
ECE Department, VAST ECL332 COMMUNICATION LAB

Multiplexing is the process of simultaneously transmitting two or more individual


signals over a single communication channel.
18)What is meant by quantization?
Quantization is the process of converting the discrete-time continuous amplitude
signal into a discrete-time discrete amplitude signal.
19)What are the types of sampling?
a. Natural sampling b. Flat top sampling c. Ideal sampling
d. Sample and hold
20)What are the steps in PCM?
Sampling, Quantisation, and encoding

21)What is the need for modulation?


a. For placing the signal at low noise frequency.
b. For reducing the antenna size.
22) Give the comparison of ASK, PSK and FSK?
Bandwidth ASK< PSK < FSK
Power ASK <PSK = FSK
Probability of error ASK > PSK > FSK
Signal-to-Noise Ratio ASK < PSK < FSK

23) Define the modulation index of AM.


The modulation index indicates the amount of amplitude variation around the un-
modulated carrier. The modulation index, ℎ = M/A is the peak amplitude value of
modulating signal. A is the peak amplitude value of the carrier signal.
24)What are the types of frequency modulation?
•Narrow band FM (h<1)
• Wideband FM (h≥1)
25)What is meant by reconstruction?
The process of reconstructing the continuous time signal back from the
discrete time signal is called reconstruction
26)what do mean by FM?

44
ECE Department, VAST ECL332 COMMUNICATION LAB

Frequency modulation can be defined as the frequency of the carrier (Wc) being
varied according to the modulating signal about an unmodulated frequency.
27)What are the different types of FM?
a. Narrow band FM
b. Wideband FM
28) Define Modulation?
Modulation Is defined as the process in which some characteristics of the signal called
carrier are varied according to the modulating signal or baseband signal.
29) Define PAM.
In PAM, the amplitude of the pulse is proportional to the amplitude of modulating
signal. The width and position of the pulse remain unchanged.
30)What are the objectives met by modulation?
a. Length of an antenna is shortened.
b. Signal loss is reduced.
c. Adjustment of bandwidth.
d. Shifting signal frequency of the assigned value.
31) What is the relation between PAM and sampling operation?
PAM and sampling are the same.
32) What are the types of PAM?
Naturally sampled PAM, Ideally sampled PAM, Sample and hold PAM.
33) Define naturally sampled PAM signal.
The original shape of the input signal is retained on the top of the pulses.

34)State the advantages of super heterodyning?


The advantages are:
a. High selectivity and sensitivity.
b. No change in Bandwidth that is bandwidth remains the same all over the operating
range.
c. High adjacent channel rejection.
35) Name the types of multiplexing?
a.Frequency Division Multiplexing
b.Time Division Multiplexing

36) How can aliasing be avoided?

45
ECE Department, VAST ECL332 COMMUNICATION LAB

Aliasing can be avoided if:


a. Samplingfrequencymust be greater than the frequency of the modulating signal.
b. The frequency should be band limited to the maximum frequency of the signal(FM)
Hz.
c. If the pre-alias filter is used.
37)What is under sampling?
Undersampling is also known as the aliasing effect in which the sampling frequency
is less than the maximum frequency of the signal and therefore the successive cycles
of the spectrum overlap.
38) What is the reason to use delta modulation?
The data rate and bandwidth required are more in PCM.
39) What are the two types of errors present in DM?
Slope overload distortion and granular noise.
40) What are the two types of errors present in DM?
Slope overload distortion and granular noise.
41) What are the disadvantages of FM?
Bandwidth requirement is more in FM.
The Transmitter and receiver are very complex.

42)What are the applications of FM?


• For recording the luminance component of the video.
• Audio signal broadcasting
43) What is VCO?
In Voltage Controlled Oscillator, the frequency of the oscillator is varied according to
the applied voltage
45) What is the role of a limiter in the FM system?
To limit the amplitude variations in an FM signal. 46)
Q3. BPSK system modulates at the rate ofa) 1 bit/
symbol
b) 2 bit/ symbol
c) 4 bit/ symbol
d) None of the above

46
ECE Department, VAST ECL332 COMMUNICATION LAB

ANSWER: a) 1 bit/ symbol


47) In the Binary Phase Shift Keying system, the binary symbols 1 and 0 are
represented by the carrier with a phase shift ofa)Π/2
b) Π
c) 2Π
d) 0
ANSWER: Π
48) The probability of error of DPSK is ______________ than that of BPSK.a)
Higher
b) Lower
c) Same
d) Not predictable
ANSWER: a) Higher
49)The binary waveform used to generate BPSK signal is encoded in
a) Bipolar NRZ format
b) Manchester coding
c) Differential coding
d) None of the above
ANSWER: a) Bipolar NRZ format
50) The BPSK signal has +V volts and -V volts respectively to representa) 1
and 0 logic levels b) 11 and 00 logic levels
c) 10 and 01 logic levels d) 00 and 11 logic levels
ANSWER: a) 1 and 0 logic levels

47

You might also like