Lab Manual
Lab Manual
Lab Manual
AIM: -
To generate amplitude modulated wave and demodulate the AM wave using Envelope
Detector
APPARATUS REQUIRED: -
THEORY:
Amplitude Modulation is defined as a process in which the amplitude of the carrier
wave c(t) is varied linearly with the instantaneous amplitude of the message signal m(t).
The demodulation circuit is used to recover the message signal from the incoming AM
wave at the receiver. An envelope detector is a simple and yet highly effective device that is well
suited for the demodulation of AM wave, for which the percentage modulation is less than
100%.Ideally, an envelope detector produces an output signal that follows the envelop of the input
signal wave form exactly; hence, the name.
PROCEDURE: -
Message Signal
Carrier Signal
Demodulated wave
Tabular Column:
5. Finally the amplitude modulated output is observed from the output of amplitude
modulator stage and the amplitude and time duration of the AM wave are noted down.
6. Calculate the modulation index by using the formula and verify them. The final
demodulated signal is viewed using an CRO at the output. Also the amplitude and time
duration of the demodulated wave are noted down.
Calculation:
Modulation Index:
The modulation index m is calculated that indicates by how much the modulated variable varies
around its unmodulated level. It relates to the variations in the amplitude of the carrier signal.
RESULT: -
Thus the amplitude modulated wave was generated and the modulation index is
verified. Also, the modulated wave is demodulated by passing through the envelope detector
circuit.
Fig.2.1Circuit Diagram
Fig.2.1Pin Diagram
AIM: -
To construct a frequency modulation circuit using a sinusoidal input waveform and to
measure the Modulation Index.
APPARATUS REQUIRED: -
THEORY:
Frequency modulation (FM) is a method of impressing data onto an alternating-current
(AC) wave by varying the instantaneous frequency of the wave.
The NE/SE566 Function Generator is a general purpose voltage-controlled oscillator designed for
highly linear frequency modulation. The circuit provides simultaneous square wave and triangle
wave outputs at frequencies up to 1MHz. A typical connection diagram is shown in Figure 2.1 The
control terminal (Pin 5) must be biased externally with a voltage (Vc) in the range
Where VCC is the total supply voltage. In Figure 2, the control voltage is set by the voltage divider
formed with R2 and R3. The modulating signal is then AC coupled with the capacitor C2. The
modulating signal can be direct coupled as well, if the appropriate DC bias voltage is applied to
the control terminal. The frequency is given approximately by
and R1 should be in the range 2k< R1<20k. A small capacitor (typically 0.001uF) should be
connected between Pins 5 and 6 to eliminate possible oscillation in the control current source. The
value of C1 is 1nF.
Tabular Column:-
PROCEDURE: -
Calculation:
The Frequency modulation experiment demonstrates some of the principles of VCO operation
using the NE566 integrated circuit by implementing a Frequency Modulation Circuit.
Bandwidth:
𝑩𝑾 = 𝟐 ∗ (∆𝒇 + 𝒇𝒎 )
RESULT: -
Thus the FM modulation wave were generated and the obtained
Modulation index :
Bandwidth :
Fig.3.1Circuit Diagram
AIM: -
To study the process of time division multiplexing and to perform multiplex of two
set of signals.
APPARATUS REQUIRED: -
THEORY:
The Sampling Theorem provides the basis for transmitting the information contained in a
band limited message signal m (t) as a sequence of samples of m(t) taken uniformly at a rate that
is usually slighter higher than the nyquist rate. An important feature of the sampling process is a
conservation of time. That is, the transmission the message samples engages the communication
channel s for only a fraction of the sampling interval on a periodic basis, and in this way some of
the time interval between adjacent samples is cleared for use by other independent message sources
on a time shared basis. We there by obtain a time division multiplexing (TDM) system, which
enables the joint utilization of a common communication channel by a plurality of independent
message sources without mutual interference among them.
The TDM system is highly sensitive to dispersion in the common channel, that is, to variations
of amplitude with frequency or lack of proportionality of phase with frequency. Accordingly,
accurate equalization of both magnitude and phase response of a channel is necessary to ensure a
satisfactory operation of the system. Unlike FDM, TDM is immune to nonlinearities in the
Tabular Column:-
channel as a source of cross talk. The reason for this is, the different message signals are not
simultaneously applied to the channel. The primary advantage of TDM is that several channels of
information can be transmitted simultaneously over a single cable.
PROCEDURE: -
1. Connect the circuit as per the diagram
2. Give two different amplitudes inputs from function generated to the emitters of both the
transistors
3. Connect the common clock signal to the back of both the transistors and observed in the
CRO, we can see the wave form.
4. The output is taken from the collector of both the transistors and the waveform is plotted
in graph.
5. Their positions and identification can be highlighted by reducing the other signal
amplitudes to zero and then gradually increasing them to observe them occupying their
positions.
RESULT: -
Thus, the two different signals are interleaved in their respective time slots without
overlapping each other using a single channel.
EX. NO. 4 SIGNAL SAMPLING AND RECONSTRUCTION
Fig.4.1Circuit Diagram
RECONSTRUCTION FILTER
AIM: -
To analyze an implementation of a sample and hold (S/H) circuit..
APPARATUS REQUIRED: -
THEORY:
The analog signal can be converted to a discrete time signal by a process called sampling.
The sampling theorem for a band limited signal of finite energy can be stated as,
‘’A band limited signal of finite energy, which has no frequency component higher than W
Hz is completely described by specifying the values of the signal at instants of time separated by
1/2W seconds.’’
It can be recovered from the knowledge of samples taken at the rate of 2W per second.
In the Circuit, the switching rate is controlled by a clock signal whose frequency should satisfy the
Nyquist sampling criterion. The switch is a FET whose gate is controlled by the clock pulse.
Buffers are placed at the input and output to isolate the circuit.
When the switch S is closed, the capacitor C is charged to the value of the input voltage,
the sample stage. Afterwards the switch is opened and the capacitor retains its charge, the hold
stage. Signal is reconstructed after passing the sampled signal into the low pass filter.
Tabular Column:-
PROCEDURE: -
RESULT: -
Thus the continuous-time signals are sampled and then signals are reconstructed from the samples
at the receiver side.
Formula:
Symbol error rate = No. of symbols in error after detection / No. of symbols transmitted
AIM:
To study the SNR performance of Pulse Code Modulation (PCM)
APPARATUS REQUIRED: -
THEORY
Pulse code modulation (PCM) is a digital scheme for transmitting analog data. The
signals in PCM are binary; that is, there are only two possible states, represented by logic 1
(high) and logic0 (low). Using PCM, it is possible to digitize all forms of analog data, including
full-motion video, voices, music, telemetry, and virtual reality. To obtain PCM from an analog
waveform at the source of a communications circuit, the analog signal amplitude is sampled at
regular time intervals. The sampling rate, or number of samples per second, is several times
the maximum frequency of the analog waveform in cycles per second or hertz. The
instantaneous amplitude of the analog signal at each sampling is rounded off to the nearest of
several specific, predetermined levels. This process is called quantization. The number at each
level can be represented by three, four, five, or six binary digits (bits) respectively. The output
of a pulse code modulator is thus a series of binary numbers, each represented by some power
of 2bits.
At the destination of the communications circuit, a pulse code demodulator converts the
binary numbers back into pulses having the same quantum levels as those in the modulator.
These pulses are further processed to restore the original analog waveform.
PROGRAM:
for ii=1:Mlen
M=MM(ii)
nbit(ii)=ceil(log(M)/log(2)); % number of bits used for quantisation
t=n/fs;
figure;
plot(t,x,'r-'); %ploting analog signal
title('Input and Sampled signals'); xlabel('time in seconds'); ylabel('amplitude');
axis([t(1), t(end), -1.1*Am, 1.1*Am])
hold on;
stairs(t,y,'b-') % ploting staircase signal- sampled signal
legend('Original Signal ','PCM wave')
qe=x-y;
snr(ii)=10*log10((x*x')/(qe*qe'));
end
Nbits=0:log10(max(MM))/log10(2)
snr_ideal=6*Nbits+1.72
figure;
plot(nbit, snr,'b',Nbits, snr_ideal,'r');
legend('Measured','Theoritical ')
title('SNR Vs No. of bits used for quantisation');
xlabel('No. of bits'); ylabel('SNR in dB');
ALGORITHM:
1. Generate a sinusoidal wave with higher sampling rate and estimate the signal power
2. Identify the quantization values and their boundaries of quantization levels with
respect to number of levels
3. Using above, quantise the samples of the sinusoidal wave
4. Find the error between quantised signal and the original signal
5. Find error power and calculate the SNR for the respective number of output levels
6. Change the number of levels and repeat the steps 2-5.
7. Estimate theoretical SNR
8. Plot SNR vs number of bits and compare the results
Observation:
No. of bits:
SNR:
RESULT:
Thus SNR performance of Pulse Code Modulation (PCM) was studied using Matlab
software.
EX.NO.6 DELTA MODULATION AND DEMODULATION
AIM:
To design and simulate the delta modulation and demodulation process using Matlab
software.
APPARATUS REQUIRED: -
THEORY
A 1-bit DPCM coder is known as a delta modulator (DM). In other words, DM codes the
differences in the signal amplitude instead of the signal amplitude itself. Yet another name for DM
is pulse width modulation. A delta-modulation encoder is shown in Figure 1; it is known as a single
integration modulator.
The input signal is compared to the integrated output pulses and the delta (difference)
signal is applied to the quantizer. The quantizer generates a positive pulse when the difference
signal is negative, and a negative pulse when the difference signal is positive. This difference
signal moves the integrator step by step closer to the present value input, tracking the derivative
of the input signal.
A delta modulation decoder has to integrate the modulated signal and low pass filter the
output of the integrator as shown in figure 6.1
PROGRAM:
% Delta Modulation
delta=0.2;
xn=0;
for i=1:L
if x(i)>xn(i)
d(i)=1;
xn(i+1)=xn(i)+delta;
else
d(i)=0;
xn(i+1)=xn(i)-delta;
end
end
subplot(4,1,2); plot(x,'r'); axis([0 L -3 3]);
hold on; stairs(xn);
grid on;
legend('Message signal','Stair case approximated signal');
% Delta DeModulation
yn=0;
for i=1:length(d)
if d(i)==0
yn(i+1)=yn(i)-delta;
else
yn(i+1)=yn(i)+delta;
end
end
subplot(4,1,3); stairs(d,'black'); axis([0 L -3 3]); grid on;
legend('Delta Modulation');
title('Delta Modulation');
subplot(4,1,4); plot(yn,'b'); axis([0 L -3 3]); grid on;
legend('Demodulation Signal');
title('Delta Demodulation');
ALGORITHM:
RESULT:
Thus, the Delta modulation and demodulation process was simulated and executed.
Program:
%% Message
output=[];
for i=1:1:binarysize
if binary(i) == 1
output=[output ones(1,sample)];
else
output=[output zeros(1,sample)];
end
end
subplot(3,3,1)
plot(output);
axis([0 binarysize*sample -2 2]);
grid on;
xlabel(' samples');
ylabel('amplitude');
title(' Message');
%% NRZ Unipolar
output=[];
for i=1:1:binarysize
if binary(i) == 1
output=[output ones(1,sample)];
else
output=[output zeros(1,sample)];
end
end
subplot(3,3,2)
plot(output);
axis([0 binarysize*sample -2 2]);
grid on;
xlabel(' samples');
ylabel('amplitude');
title(' NRZ Unipolar');
%% NRZ polar
output=[];
for i=1:1:binarysize
if binary(i) == 1
output=[output ones(1,sample)];
else
output=[output -1*ones(1,sample)];
end
end
AIM:
To write a MATLAB program to study the different types of line encoding schemes.
APPARATUS REQUIRED: -
THEORY:
UNIPOLAR:
In unipolar format (also known as on-off signaling), symbol 1 is represented by a transmitting
pulse, whereas symbol 0 is represented by switching off the pulse. When the pulse occupies the
full duration of a symbol, the unipolar format is said to be of the nonreturn-to-zero (NRZ) type.
When it occupies a fraction (usually one-half) of the symbol duration, it is said to be return-to-zero
(RZ) type.
POLAR:
In polar format, a positive pulse is transmitted for symbol 1, and a negative pulse for symbol 0.
Unlike unipolar waveform, a polar waveform has no DC component, provided that the 0s and 1s
in the input data occur in equal proportion.
BIPOLAR:
In bipolar format (also known as pseudoternary signaling), positive and negative pulses are used
alternately for the transmission of 1s, and no pulses for the transmission of 0s.
MANCHESTER:
In Manchester format (also known as bi phase baseband signaling), symbol 1 is represented by
transmitting a positive pulse for one-half of the symbol duration, followed by a negative pulse
subplot(3,3,3)
%% NRZ Bipolar
output=[];
temp=1;
for i=1:1:binarysize
if binary(i) == 1
output=[output temp*ones(1,sample)];
temp=-1*temp;
else
output=[output zeros(1,sample)];
end
end
subplot(3,3,4)
plot(output);
axis([0 binarysize*sample -2 2]);
grid on;
xlabel(' samples');
ylabel('amplitude');
title(' NRZ Bipolar');
%% RZ Unipolar
output=[];
for i=1:1:binarysize
if binary(i) == 1
output=[output ones(1,sample/2) zeros(1,sample/2)];
else
output=[output zeros(1,sample)];
end
end
subplot(3,3,5)
plot(output);
axis([0 binarysize*sample -2 2]);
grid on;
xlabel(' samples');
ylabel('amplitude');
title(' RZ Unipolar');
%% RZ polar
output=[];
for i=1:1:binarysize
if binary(i) == 1
output=[output ones(1,sample/2) zeros(1,sample/2)];
else
output=[output -1*ones(1,sample/2) zeros(1,sample/2)];
end
end
subplot(3,3,6)
for the remaining half of the symbol duration; for symbol 0, these two pulses are transmitted in
reverse order. It has no DC component.
%% RZ Bipolar
output=[];
temp=1;
for i=1:1:binarysize
if binary(i) == 1
output=[output temp*ones(1,sample/2) zeros(1,sample/2)];
temp=-1*temp;
else
output=[output zeros(1,sample)];
end
end
subplot(3,3,7)
plot(output);
axis([0 binarysize*sample -2 2]);
grid on;
xlabel(' samples');
ylabel('amplitude');
title(' RZ Bipolar');
%% Manchester
output=[];
for i=1:1:binarysize
if binary(i) == 1
output=[output ones(1,sample/2) -1*ones(1,sample/2)];
else
output=[output -1*ones(1,sample/2) ones(1,sample/2)];
end
end
subplot(3,3,8)
plot(output);
axis([0 binarysize*sample -2 2]);
grid on;
xlabel(' samples');
ylabel('amplitude');
title(' Manchester');
RESULT
Thus, the MATLAB program for different types of line encoding process is written and
executed.
AIM:
To design the digital modulations techniques and simulate it using simulink.
APPARATUS REQUIRED: -
THEORY
BPSK is a method for modulating a binary signal onto a complex waveform by shifting the
phase of the complex signal. In digital baseband BPSK, the symbols 0 and 1 are modulated to the
complex numbers exp(jt) and -exp(jt), respectively, where t is a fixed angle.
Differential Phase Shift Keying or DPSK modulation signal records changes in a binary
stream. Changes in bits will result in a π phase shift. Phase-shift keyed signals cannot be detected
incoherently as they use coherent detection. A coherent detector has two inputs for which one is a
reference signal and the other is the modulated signal to be demodulated. However in this case a
partially coherent detection is used here where a one-bit delay is use.
Formula:
Generation: 𝑠(𝑡) = 𝑠𝑖1 𝜑1 (𝑡)
1, 𝑏𝑖 = 1
𝑠𝑖1 = {
−1, 𝑏𝑖 = 0
2𝐸
𝜑1 (𝑡), = √ 𝑇 𝑏 cos(2𝜋𝑓𝑐 𝑡) , 0 ≤ 𝑡 < 𝑇𝑏 ,
𝑏
Detection:
𝑇
𝑥𝑖 = ∫0 𝑏 𝑠(𝑡) 𝜑1 (𝑡)𝑑𝑡,
1, 𝑥 ≥ 0
𝑏̂ = { 𝑖
0, 𝑥𝑖 < 0
Formula:
Generation: 𝑠(𝑡) = 𝑠𝑖1 𝜑1 (𝑡) + 𝑠𝑖2 𝜑2 (𝑡)
1
𝑠𝑖1 [ ], 𝑏𝑖 = 1
[𝑠 ] = { 0
𝑖2 0
[ ], 𝑏𝑖 = 0
1
2𝐸
𝜑1 (𝑡), = √ 𝑇 𝑏 cos(2𝜋𝑓𝑐1 𝑡) , 0 ≤ 𝑡 < 𝑇𝑏 ,
𝑏
2𝐸
𝜑2 (𝑡), = √ 𝑇 𝑏 cos(2𝜋𝑓𝑐2 𝑡) , 0 ≤ 𝑡 < 𝑇𝑏 ,
𝑏
Detection:
𝑇
𝑥𝑖1 = ∫0 𝑏 𝑠(𝑡) 𝜑1 (𝑡)𝑑𝑡,
𝑇
𝑥𝑖2 = ∫0 𝑏 𝑠(𝑡) 𝜑2 (𝑡)𝑑𝑡,
𝑙 = 𝑥𝑖1 − 𝑥𝑖2
1, 𝑙 ≥ 0
𝑏̂ = {
0, 𝑙 < 0
RESULT
Thus, the different digital modulation techniques- BFSK,BPSK and DPSK was designed
and simulated.
Formula:
Bit error rate = No. of bits in error after detection / No. of bits transmitted
Program:
n=7; k=4;
blk_nos=20000;
Nbits=blk_nos*k; % Number of bits in simulation
snrdB=[0:10];
P= [ 1 1 0 ; % Parity Matrix
0 1 1 ;
1 1 1 ;
1 0 1];
In= eye(4); % Identity Matrix
Ink=eye(3);
G=[P,In]; % Generator Matrix
H=[Ink, P']; % Parity Check Matrix
errpat=[ 0 0 0 0 0 0 0 ;
1 0 0 0 0 0 0 ;
0 1 0 0 0 0 0 ;
0 0 1 0 0 0 0 ;
0 0 0 1 0 0 0 ;
0 0 0 0 1 0 0 ;
0 0 0 0 0 1 0 ;
0 0 0 0 0 0 1 ];
syndrom=errpat*H';
AIM:
To study the BER performance of Linear Block Code using matlab software
APPARATUS REQUIRED: -
Theory:
The input to the encoder is binary information sequence at a rate R bits/sec. There are
mainly two types of channel encoding techniques namely Block coding and Convolutional coding.
In block coding, a block of k information bits is encoded into a block of n bits known as codeword
(n>k). So for k bits there could be total 2k possible code words. The code rate defined as the ratio
Rc= k/n is a measure of amount of redundancy introduced by block coding.
In convolution coding each k bit information symbol to be encoded and transformed into
n bit called as codeword such that n>k and transformation is a function of the last L information
symbols where L is the constraint length of the code. The codeword can be generated using finite
state shift register approach. Thus code rate Rc would be same as that of block codes. Hence a
good code is the one that ensure a certain error correcting capability at minimum Rc or maximum
output encoder rate R/Rc.
for ii=1:length(snrdB)
snr(ii)=10^(snrdB(ii)/10)
r=awgn(ctx, snr(ii), 'measured');
cr=r;
cr(r>=0)=1;
cr(r<=0)=0;
y=reshape(cr', n, [])';
s=mod( y*H', 2);
e0=[];
for jj=1:blk_nos
for kk=1:2^(n-k)
if(syndrom(kk,:)==s(jj,:))
ro_match=kk;
break;
end
end
e0=[e0; errpat(ro_match,:)];
end
xcat=mod( y+e0, 2);
mcat=xcat(:, n-k+1:end);
bcat=reshape(mcat', 1,[]);
BER_wo_EC(ii)=length(find(ct~=cr))/length(ct)
BER_with_EC(ii)=length(find(x~=xcat))/length(ct)
end
semilogy(snr, BER_with_EC, 'r*-', snr, BER_wo_EC, 'b-+')
legend('BER_with_EC', 'BER_wo_EC,');
xlabel('SNR (dB)'); ylabel('BER'); title('BER Performance of Linear Block
Code');
Algorithm:
Observation:
Number of blocks on simulation :
Number of bits used:
Message word length =
Codeword length =
Generator Matrix=
SNR:
BER (w/o EC):
BER (with EC):
RESULT
Thus, the BER performance of Linear Block Code using matlab software was performed
and coding gain obtained for 10−4 BER is
AIM:
To design and simulate the operation of equivalent base-band binary phase shift keying
(BPSK) direct sequence spread spectrum (DS/SS) system.
APPARATUS REQUIRED: -
THEORY
A system may be required to provide a form of secure communication in a hostile
environment such that the transmitted signal is not easily detected or recognized by unwanted
listeners. This requirement is fulfilled by a signaling technique called “Spread-Spectrum
modulation”.
2. The spectrum spreading is accomplished before transmission through the use of a code that
is independent of the data sequence. The same code is used in the receiver to de-spread the
received signal so that the original data may be recovered.
In a direct sequence spread spectrum technique, two stages of modulation are used. First, the
incoming data sequence is used to modulate a wideband code. This code transforms the
narrowband data sequence into a noise-like wideband signal. The resulting wideband signal
undergoes a second modulation using a phase shift keying technique.
RESULT
Thus the equivalent base-band binary phase shift keying (BPSK) direct sequence spread
spectrum (DS/SS) system is designed and simulate.
AIM:
To design and simulate the operation of equivalent base-band binary phase shift keying
(BPSK) direct sequence spread spectrum (DS/SS) system.
APPARATUS REQUIRED: -
THEORY
Several algorithms like Least Mean Square (LMS), Recursive Least Mean Square (RLMS),
Normalized Least Mean Square (NLMS) etc., has been proposed to perform this operation of
equalization.
PROGRAM
LMS ALGORITHM
clc;
clear all;
close all;
d=[ 0 1 0 1 1 ];
t=linspace(0,10,1000);
n=length(t);
b=2*d-1; % Convert unipolar to bipolar
Nsb=n/length(d)% Number of samples per bit
bb=repmat(b',1,Nsb)% replicate each bit Nsb times
bw=bb'; % Transpose the rows and columns
bw=bw(:)' ; % Data sequence samples
x=bw+randn[‘,length(d)*0.01];%adding noise
w=zeros(1,n)
mu=0.2;
for i=1:n
e(i)=bw(i)-w(i)*x(i);
w(i+1)=w(i)+(mu*e(i)*x(i));
end
for i=1:n
y(i)=w(i).*bw(i);
end
subplot(2,2,1),plot(bw);
ylabel('original signal');
subplot(2,2,2),plot(x);
ylabel('signal added with noise');
subplot(2,2,3),plot(e);
ylabel('error');
subplot(2,2,4),plot(y);
ylabel('adaptive equalizer output');
RESULT
Thus the distortion introduced by the channel on the transmitted signal on the received
samples are mitigated using LMS algorithm.
Rough Work
Rough Work