CE LAB MANUAL FINAL
CE LAB MANUAL FINAL
COMMUNICATION ENGINEERING
LAB
2019 SCHEME
LABORATORY MANUAL
PREPARED BY REVIEWED
BY
APPROVED BY
KASARAGOD- 671542
PART A
EXPERIMENT NO.1
FM GENERATION AND DEMODULATION USING PLL
AIM
To design and set up a frequency modulator and demodulator circuit using PLL IC 565
COMPONENTS REQUIRED
IC 565, resistors, capacitors, signal generator, DC supply
THEORY
In FM, frequency of the carrier signal is varied in accordance with the instantaneous
amplitude of the modulating signal. PLL is widely used for FM generation. A Phase-locked
loop(PLL) has a voltage-controlled oscillator(VCO).The VCO signal and an input signal are
sent to a phase comparator which generates an error voltage part to any difference in
frequency between two signals. The error voltage adjusts the VCO frequency to match that of
the input signal. Thus, the PLL can track an input signal or only the VCO function can be
used. Thus, the frequency generated by the VCO of PLL is varied by the input signal applied.
For the demodulation, another 565 IC is used. The centre frequency of the VCO of the
demodulator is made the same as that of the modulator. The variation of the input frequency
from the centre frequency is converted into the variation of the voltage by the phase detector
of the demodulator.
DESIGN
Let V+=10 v and V-=-10 v
Let the centre frequency of the FM be fo=1.2/(4 R1C1)=2.5kHz
Take C1=0.01µF .Then,R1=12 KΩ
The value of R1 satisfies the required condition 2k<R2 <20k
Take C3=0.01µF and C2=10µF.
PROCEDURE
1.Set up the FM generator circuit and feed 5 VPP,1 kHz sine wave input and observe the
output.
2. Set up the demodulator circuit and feed the FM signal to it. Observe the demodulated
output.
CIRCUIT DIAGRAM
RESULT
The circuit for the FM modulation and demodulation has been set up and output obtained.
Experiment No.2
Generation and Detection of BPSK
AIM:
To design and set up a Binary Phase Shift Keying(BPSK) circuit.
COMPONENTS REQUIRED:
Resistors, ICs CD 4016,741 and bread board
THEORY
In the BPSK system, out of phase signals are transmitted corresponding to the binary input.
When modulation input signal is at logic 1, a finite number of cycles of a sinusoidal signals
are transmitted and when the input signal is at logic 0, phase of thesinusoidal signal is
changed. Op-amp functioning as inverting amplifier provides 180° phase shift and unity gain.
BPSK signal has constant amplitude. Therefore the noise can be removed easily.
CIRCUIT DIAGRAM
WAVEFORMS
The circuit for the BPSK modulation and demodulation has been set up and output obtained.
PART B
EXPERIMENT NO.1
PERFORMANCE OF WAVEFORM CODING USING PCM
AIM
Pulse code modulation is a process of converting ananalog signal into digital. The voice or
any data input is first sampled using a sampler (which is a simple switch) and then quantized.
Quantization is the process of converting a given signal amplitude to an equivalent binary
number with fixed number of bits. This quantization can be either midtread or mid-raise and
MATLAB PROGRAM
clc;
close all;
clear all;
n=input('Enter for n-bit PCM system : '); %Encodebook Bit Length
fs=input('Enter Sampling Frequency : '); %Sampling Frequency
L = 2^n; %Number of Quantisation Levels
%% Here we pllot the Analog Signal and its Sampled form
Vmax = 8;
x = 0:pi/fs:4*pi; %Construction of Signal
ActualSignl=(Vmax*sin(x)); %Actual input
subplot(3,1,1);
plot(x,ActualSignl);
title('Analog Signal');
subplot(3,1,2); %Sampled Version
stem(x,ActualSignl);grid on; title('Sampled Sinal');
%% Now perform the Quantization Process
Vmin=-Vmax; %Since the Signal is sine
StepSize=(Vmax-Vmin)/L; % Diference between each quantisation level
QuantizationLevels=Vmin:StepSize:Vmax; % Quantisation Levels - For comparison
codebook=Vmin-(StepSize/2):StepSize:Vmax+(StepSize/2); % Quantisation Values -
As Final Output of qunatiz
[ind,q]=quantiz(ActualSignl,QuantizationLevels,codebook); % Quantization process
NonZeroInd = find(ind ~= 0);
ind(NonZeroInd) = ind(NonZeroInd) - 1;
% MATLAB gives indexing from 1 to N.But we need indexing from 0, to convert it
into binary codebook
BelowVminInd = find(q == Vmin-(StepSize/2));
q(BelowVminInd) = Vmin+(StepSize/2);
%This is for correction, as signal values cannot go beyond Vmin
EXPERIMENT No.2
Pulse Shaping and Matched Filtering
AIM
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.
THEORY
Pulse shaping is the process of changing the waveform of transmitted pulses. Its purpose is
to make the transmitted signal better suited to the channel by limiting the
effective bandwidth of the transmission. By filtering the transmitted pulses this way,
the intersymbol interference caused by the channel can be kept in control. The signal's
spectrum is determined by the modulation scheme and data rate used by the transmitter, but
can be modified with a pulse shaping filter. Pulse shaping makes the spectrum smooth.
Sender side pulse shaping is often combined with a receiver side matched filter to achieve
optimum tolerance for noise in the system. In this case the pulse shaping is equally
distributed between the sender and receiver filters.
Root Raised Cosine Filter (RRC)
PROGRAM
RESULT
Amplitude
An effective way to study the effects of ISI is the Eye Pattern. The name Eye Pattern was
given from its resemblance to the human eye for binary waves. The interior region of the eye
pattern is called the eye opening. Jitter is the short-term variation of the instant of digital
signal, from its ideal position, which may lead to data errors.When the effect of ISI increases,
traces from the upper portion to the lower portion of the eye opening increases and the eye
gets completely closed, if ISI is very high.
An eye pattern provides the following information about a particular system.
Actual eye patterns are used to estimate the bit error rate and the signal-to-noise ratio.
The width of the eye opening defines the time interval over which the received wave can
be sampled without error from ISI.
The instant of time when the eye opening is wide, will be the preferred time for sampling.
The rate of the closure of the eye, according to the sampling time, determines how
sensitive the system is to the timing error.
The height of the eye opening, at a specified sampling time, defines the margin over
noise.
The rolloff factor is a measure of the excess bandwidth of the filter, i.e., the bandwidth
occupied beyond the Nyquist bandwidth of 1/2T, where 1/T is symbol rate
● As rolloff increases eye in the eye diagram opens up. This means that if there were no
bandwidth restrictions it would be easier on the receiver if one used a large rolloff. (However,
for bandwidth efficiency rolloff should be smaller.)
● Smaller rolloff gives narrower bandwidth. However, its side lobes increases so attenuation
in stop band is reduced.
PROGRAM
clc
clear all
close all
fs=20;%sampling rate
fd=1;%doppler shift
pd=500;%Total number of message bits
x=randint(pd,1,2);
a=length(x);
delay=3;
%rolloff factor 0.2
Amplitude
Amplitude
Or
Where ‘E’ is the symbol energy, ‘T’ is the symbol time period, f is the frequency of the
carrier.
There are only two in-phase components and no quadrature component.
PROGRAM
clc
clear all
close all
N=10000;% number of bits
msg=randi([0 1],1,N);% Generation of message bits
EbNodb=1:1:7;
R=1;% Uncoded signal is given so the rate is 1
fori=1:1:7
EbNo=10^(EbNodb(i)/10);
sigma=sqrt(1/(2*R*EbNo));% calculation of varience
s=2*msg-1;%Bits to symbol conversion
r=s+sigma*randn(1,N);% AWGN noise addition
msgcap=(r>0);% Detection process
error=0;
for j=1:N
error=error+sum(abs(msg(j)-msgcap(j)));
end
RESULT
BER
EXPERIMENT NO.5
ERROR PERFORMANCE OF QPSK
AIM
1. Generate a string of message bits.
2. Encode using QPSK with energy per symbol Es and represent it using
points in a signal-space.
3. Simulate transmission of the QPSK modulated signal via an AWGN
channel with variance N0/2 in both I-channel and Q-channel.
4. Detect using an ML decoder and plot the probability of error as a function
of SNR per bit Eb/N0 where Es = 2Eb.
THEORY
Quadrature Phase Shift Keying (QPSK) is a form of Phase Shift Keying in which two bits are
modulated at once, selecting one of four possible carrier phase shifts (0, 90, 180, or 270 degrees).
RESULT
PART C
EXPERIMENT NO.1
FAMILIARIZATION WITH SOFTWARE DEFINED RADIO (HARDWARE AND
CONTROL SOFTWARE)
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
SDRhardware.
4. Familiarize available blocks in GNU Radio. Study how signals can be generated and
spectrum (or power spectral density) of signals can be analysed. Study how filtering can be
performed.
HARDWARES REQUIRED
RTL2832U Software Defined Radio(RTL-SDR),RF coaxial SMA cable, telescopic
antenna,Computer
SOFTWARES REQUIRED
GNU Radio Companion,gqrx
THEORY
Once you finish the installation,typelsusbcommand which lists all usb devices
connected.Now connect the SDR hardware to the usb port and then again type
lsusbcommand in terminal which lists the RTL2838 SDR device also.
Finally below window will appear in which you can type the frequency of a station from the
available FM frequencies to heara particular FM station.
3. Double click on the Options block. This block sets some general parameters for the
flow graph. Change the id to lesson1, Type in a project title (such as lesson_demo1)
and author. Set Generate Options to QT GUI, Output language to Python. Then close
the properties window. The other block that is present is the Variable block. It is used
to set the sample rate.
4. On the right side of the window is a list of the blocks that are available. By expanding
any of the categories (click on triangle to the left) you can see the blocks available.
Explore each of the categories so that you have an idea of what is available.
5. Open the Waveform generators category and double click on the Signal Source. Note
that aSignal Source block will now appear in the main window. Double click on the
block and theproperties window will open. Adjust the settings to match those as
shown in the figurebelow and close the window. This Signal Source is now set to
6. In order to view this wave we need one of the graphical sinks, choose
Core→Instrumentation→ QT →QT GUI Time sink and then double click on it.
Change the type to float. This sink will act as an oscilloscope. If you want multiple
channel, increase the number of inputs to 2. Explore various parameter such as labels
7. In order to connect these two blocks, click once on the “out” port of the Signal
Source, and then once on the “in” port of the Scope Sink. The following flow graph
should be displayed.
8. In order to observe the operation of this simple system we must generate the flow
graph and then execute it. Click first on the “Generate the flow graph” icon. A box
will come up in which you enter the name of the file. Name this file: tutorial1.grc and
save. Click the “Execute the flow graph” icon. A scope plot should open displaying
several cycles of the sinusoid. Confirm that the frequency and amplitude match the
value that you expect.
Experiment with the controls on the scope plot.
10. Move the cursor over the curve you can see the actual sample values. Recall that the
Variable block set the sampling rate to 32000 samples/second or 32 samples/ms. Note
that there are in fact 32 samples within one cycle of the wave.
11. Add QT GUI frequency sink . Change the Type to Float and show control panel and
leave the remaining parameters at their default values.Connect this to the output of the
Signal Source by clicking on the out port of the SignalSource and then the in port of
the QT GUI Sink. Generate and execute the flow graph.You should observe the scope
as before along with an FFT plot correctly showing thefrequency of the input at
1KHz. Close the output windows.
14. Modify the flow graph to include a Low Pass Filter block as shown in the figure
below. This block is found in the Core→ Filters category. Recall that the Multiply
block outputs a 200Hz and a 1.8KHz sinusoid. We want to create a filter that will pass
15. Open a file browser in Ubuntu . Go to the directory that contains the GRC file that
you have been working on. If you are unsure as to where this is, the path to this file is
shown in the bottom portion of the GRC window. In addition to saving a “.grc” file
with your flow graph, note that there is also a file titled “demo1py”. Double click on
this block. You will be given the option to Run or Display this file. Select Display.
This is the Python file that is generated by GRC. It is this file that is being run when
you execute the flow graph. You can modify this file and run it from the terminal
window. This allows you to use features that are not included in GRC. Keep in mind
that every time you run your flow graph in GRC, it will overwrite the Python script
that is generated. So, if you make changes directly in the Python script that you want
to keep, save it under another name.
EXPERIMENT NO.2
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
Assume that your carrier frequency is fc an modulating signal frequency is
fm
FM can be generated by changing the phase of carrier.
FM TRANSMITTER
Now you can vary the frequency of the first Signal Source using the slider.Similarly we can
add range chooser for the other signal source(carrier) and for modulation index β. We can
control fm,fc and Beta with them. Complex to real extracts the real part.
FM RECEPTION
The RTL SDR source will provide I and Q signals from the FM station. We can directly
recover the message using a conjugate multiplier and delay as shown above. Complex to arg
takes in a complex stream and outputs each complex value's Arg(arctan).The output is a
Here used a file source in place RTL SDR block.This file source contains already recorded
I/Q data.