Professional Documents
Culture Documents
Dcomm File 123 PDF
Dcomm File 123 PDF
ADGITM, DELHI
INDEX:
Serial Experiment name date Page
no. no
1 To study CRO 3
Theory: The CRO stands for a cathode ray oscilloscope. The cathode ray
oscilloscope is an electronic test instrument; it is used to obtain waveforms
when the different input signals are given. In the early days, it is called as an
Oscillograph. The oscilloscope observes the changes in the electrical signals
over time, thus the voltage and time describe a shape and it is continuously
graphed beside a scale. By seeing the waveform, we can analyze some
properties like amplitude, frequency, rise time, distortion, time interval and etc.
Karl Ferdinand Braun invented it in 1897.
Working Principle of CRO: It works on the principle of the deflection of the
electron been with the help of deflection plates before it falls over the
phosphorescent screen.
Buttons of CRO:
1. On/Off: This is required to turn the CRO on or off as per the requirement.
2. Channel Select: As we know most of the CRO can work simultaneously with
two signals and thus there is a toggle switch present in the controls regarding the
selection, i.e., if both the channels are used or only one is used. So, selection must
be done accordingly. If both the channels are used the selection should be ‘Dual’
Theory:
The name MATLAB stands for MATrix LABoratory. MATLAB was written originally to
provide easy access to matrix software developed by the LINPACK (linear system
package)and EISPACK (Eigen system package) projects.
It allows matrix manipulations, plotting of functions and data, implementation of
algorithms, creation of user interfaces, and interfacing with programs written in other
languages. it has sophisticated data structures, contains built-in editing and
debugging tools, and supports object-oriented programming.
It has powerful built-in routines that enable a very wide variety of computations. It
also has easy to use graphics commands that make the visualization of results
immediately available. Specific applications are collected in packages referred to as
toolbox. There are toolboxes for signal processing, symbolic computation, control
theory, simulation, optimization, and several other fields of applied science and
engineering.
1. Arithmetic Operations
+ Addition
- Subtraction
.* Multiplication
* Matrix multiplication
2. Relational Operations
== Determine equality
~= Determine inequality
4. Entering Commands
ans Most recent answer
Data Types:
1. Numeric Types
1 2 3 4
Row vector
To create a matrix that has multiple rows, separate the rows with semicolons.
a = [1 2 3; 4 5 6; 7 8 10]
a = 3×3
1 2 3
4 5 6
7 8 10
Another way to create a matrix is to use a function, such as ones, zeros, or rand. For
example, create a 5-by-1 column vector of zeros.
z = zeros(5,1)
z = 5×1
0
0
0
0
0
11 12 13
14 15 16
17 18 20
sin(a)
ans = 3×3
1 4 7
2 5 8
You can perform standard matrix multiplication, which computes the inner products between rows and
columns, using the * operator. For example, confirm that a matrix times its inverse returns the identity
matrix:
p = a*inv(a)
p = 3×3
1.0000 0 0
0.0000 1.0000 0
0.0000 -0.0000 1.0000
Concatenation
Concatenation is the process of joining arrays to make larger ones. In fact, you made your first
array by concatenating its individual elements. The pair of square brackets [] is the concatenation
operator.
A = [a,a]
A = 3×6
1 2 3 1 2 3
4 5 6 4 5 6
7 8 10 7 8 10
Concatenating arrays next to one another using commas is called horizontal concatenation. Each
array must have the same number of rows. Similarly, when the arrays have the same number of
columns, you can concatenate v ertically using semicolons.
A = [a; a]
A = 6×3
1 2 3
4 5 6
7 8 10
1 2 3
4 5 6
7 8 10
Complex Numbers
Complex numbers have both real and imaginary parts, where the imaginary unit is the square root
of -1.
sqrt(-1)
ans = 0.0000 + 1.0000i
To represent the imaginary part of complex numbers, use either i or j.
c = [3+4i, 4+3j; -i, 10j]
c = 2×2 complex
Apparatus required: CRO , Power Supply , Probe, Jumper wires, Sampling &
Reconstruction Trainer Kit.
Theory: As a first step to convert analog signals into digital form, the samples of the
analog signals are taken at regular intervals. The levels of these samples are then
encoded and send to the receiver. At the receiver these samples are recovered and
from that the original signal is reconstructed. Sampling theorem states that the
original signal can be faithfully reconstructed only if the sampling frequency is at
least double that of the highest frequency component in the sampled signal. A
sampling and reconstruction circuit is shown in figure. An FET is used as a switch to
take samples of the sine wave input. Sampling pulses are applied to the gate of the
FET that switches it ON and OFF. The input signal is sent to the output only when
the transistor is ON. Thus the output of the FET is a sampled form of the input signal.
The reconstruction circuit is a low pass filter having a cut off frequency equal to the
frequency of the analog input signal.
Types of sampling:
2 Natural sampling :
The principle of Natural sampling is use to chopping principle. This method is used
practically.
Sampling Theorem:
Fs>=2fm
Aliasing:
We can simply avoid aliasing by sampling the signal at a higher rate than the Nyquist
rate (Fs>=Fm). Or, we can use anti-aliasing filters. These are special low-pass filters
that are usually found in the initial stages of any digital signal processing operation.
The anti-aliasing filters attenuate the unnecessary high-frequency components of a
signal. They band-limit the input signal by removing all frequencies higher than the
signal frequencies. As a result, they help preserve a lot of information that is needed
and remove unnecessary information.
Interpolation
Block Diagram:
1. Sampling signal
3. Sampled output
3.
4.Re-constructed signal
Observation:
Result: Analog Input is sampled at different sampling rates and then reconstructed.
Observed the waveforms and plotted. Hence we have studied sampling and
reconstruction.
Theory:
Sampling:
A continuous time signal can be processed by processing its samples through a discrete
time system. For reconstructing the continuous time signal from its discrete time samples
without any error, the signal should be sampled at a sufficient rate that is determined by the
sampling theorem.
Code:
%Oversampling : fs>2fm
fm =100;
fs =600; t=0:1/fs:((10/fm)-(1/fs)); %10 cycles 60 Samples
x = sin(2*pi*fm*t); fx = fft(x,64) ; xr=ifft(fx,64); % inv fft generates 64 samples
f= (-31*fs/64) : (fs/64) : (32*fs/64) ; fx=[fx(34:64) fx(1:33)];
subplot(231), stem(x), title(‘sampled signal, fm=100,fs=600’);
subplot(232), stem(f, abs(fx)), axis([-300 300 0 30]);
title(‘frequency spectrum, fm=100, fs=600’);
subplot(233), stem(xr), title(‘recovered signal, fm =100, fs=600’);
%Undersampling : fs<2fm
fm=400; x=sin(2*pi*fm*t);
fx=fft(x,64); xr = ifft(fx,64); fx=[fx(34:64) fx(1:33)];
subplot(234), stem(x), title(‘sampled signal, fm=400,fs=600’);
subplot(235), stem(f, abs(fx)), axis([-300 300 0 30]);
title(‘frequency spectrum, fm=400, fs=600’);
subplot(236), stem(xr), title(‘recovered signal, fm =400, fs=600’);
Aim: To study modulation and demodulation of TDM-PAM (Time division multiplexing),
Pulse Modulation.
THEORY-
1) MULTIPLEXING
2) TYPES OF MULTIPLEXING
A sampled waveform is “off” most of the time, leaving the time between samples
available for other purposes. In particular, sample values from several different
signals can be interleaved into a single waveform. This is the principle of
time-division multiplexing (TDM) discussed here. The simplified system in Figure (1)
demonstrates the essential features of time division multiplexing. Several input
signals are prefiltered by the bank of input LPFs and sampled sequentially. The
rotating sampling switch or commutator at the transmitter extracts one sample from
each input per revolution. Hence, its output is a PAM waveform that contains the
individual samples periodically interleaved in time. A similar rotary switch at the
receiver, called a decommutator or distributor, separates the samples and distributes
them to another bank of LPFs for reconstruction of the individual messages. If all
inputs have the same message bandwidth 𝑊, the commutator should rotate at the
rate 𝑓𝑠 ≥ 2𝑊 so that successive samples from any one input are spaced by 𝑇𝑠 = 1/𝑓𝑠
≤ 1/2𝑊. The time interval 𝑇𝑠 containing one sample from each input is called a
frame. If there are 𝑀 input channels, the pulse-to-pulse spacing within a frame is
𝑇𝑠/𝑀 = 1/𝑀𝑓𝑠 . Thus, the total number of pulses per second will be: 𝑟 = 𝑀𝑓𝑠 ≥ 2𝑀𝑊
(1) which represents the pulse rate or signaling rate of the TDM signal. Our primitive
example system shows mechanical switching to generate multiplexed PAM, but
almost all practical TDM systems employ electronic switching. Regardless of the
type of pulse modulation, TDM systems require careful synchronization between
commutator and decommutator. Synchronization is a critical consideration in TDM,
because each pulse must be distributed to the correct output line at the appropriate
time. A popular bruteforce synchronization technique devotes one time slot per
frame to a distinctive marker pulse or nonpulse, as illustrated in Figure (2). These
markers establish the frame frequency 𝑓𝑠 at the receiver, but the number of signal
channels is reduced to 𝑀 − 1. Other synchronization methods involve auxiliary pilot
tones or the statistical properties of the TDM signal itself.
3. Examine the sampling pulses related to 4 channels to check that the pulses are
shifted with 25 𝜇s between them. Display and sketch theses sampling pulses.
4. Use the Sampling block of the T20D board to generate 8 kHz PAM signal at each
channel. Display and sketch the PAM signals.
5. Use summation ( ∑ )block to generate PAM/TDM signal. Verify that the first-time
slot contains the synchronism (negative pulse) but other slots contain the pulses
from the PAM signals. Display and sketch the generated frame signal.
1. Use LINE part of T20E module with infinite band, and minimum attenuation and
noise to pass the generated PAM/TDM signal through it. Display and sketch the
reconstructed signal.
2. Use the amplifier and rectifier blocks at the receiver side to display and sketch the
amplified and rectified signals, then examine the synchronism pulses extracted by
the TDM signal.
3. Examine the sampling signals for the four demodulators to obtain the time ratio
between these signals.
4. Use the phase adjust to obtain the maximum amplitude of the demodulated
signals.
5. Examine the waveforms at the output of the reception filters and check their
correspondence to the transmitted analog signals.
6. Repeat steps (2-5) with 5, 50, and 320 kHz channel bands. Write down your
notes.
7. Repeat steps (2-5) with varying noise and attenuation levels. Write down your
notes.
BLOCK DIAGRAM :
1) input signals
2) multiplexed signal( tx output or rx input)
3) output signal(rx-output is similar to my transmitter input but with little distortion)
RESULT :
PRECAUTIONS
DISCUSSION
TDM is used for long distance communication, Telephone companies and ISP
implement through digital signals.
Types of Multiplexing:
PCM: P
ulse-code modulation (PCM) is a method used to digitally represent
sampled analog signals. It is the standard form of digital audio in computers, compact
discs, digital telephony and other digital audio applications. In a PCM stream,
the amplitude of the analog signal is sampled regularly at uniform intervals, and each
sample is quantized to the nearest value within a range of digital step
ISCUSSION :
D
Advantage of PCM – High reliability and efficient operation as the circuitry required
in digital.
Disadvantage – Timing filter. PCM Transmitter:
Theory:
Multiplexing (or muxing) is a way of sending multiple signals or streams of
information over a communications link at the same time in the form of a single,
complex signal; the receiver recovers the separate signals, a process called
demultiplexing (or demuxing).
PCM:
Pulse-code modulation (PCM) is a method used to digitally represent sampled
analog signals. It is the standard form of digital audio in computers, compact discs,
digital telephony and other digital audio applications. In a PCM stream, the amplitude
of the analog signal is sampled regularly at uniform intervals, and each sample is
quantized to the nearest value within a range of digital steps.
Code:
%Pulse Code Modulation Analog Signal-Sinusoidal
f=2
fs = 20*f
t= 0:1/fs:1
a=2
x= a*sin(2*pi*f*t)
x1 = x+a
q_op = round(x1)
enco = dec2bin(q_op)
deco = bin2dec(enco)
xr = deco-a
plot(t,x,'-r',t,xr,'k+-')
xlabel('Time')
ylabel('amplitude')
legend('original signal', 'reconstructed signal')
print -dpng figure.png
Theory :
The type of modulation, where the sampling rate is much higher and in which the
, such a modulation is termed
stepsize after quantization is of a smaller value Δ
elta modulation.
as d
Delta Modulation is a simplified form of DPCM technique, also viewed as 1 -bit
DPCM scheme. As the sampling interval is reduced, the signal correlation will be
higher.
Delta Modulator
The Delta Modulator comprises of a 1-bit quantizer and a delay circuit along with two
summer circuits. Following is the block diagram of a delta modulator.
Delta Demodulator
The delta demodulator comprises of a low pass filter, a summer, and a delay circuit.
The predictor circuit is eliminated here and hence no assumed input is given to the
demodulator.
DELTA MODULATOR
DELTA DEMODULATOR
%Modulation
xq(1) = 0; d(1) = 0;
for n=2:length(x),
d(n)=sign(x(n)-xq(n-1));
xq(n)=xq(n-1)+d(n)*step;
end
subplot(232); plot(d(1:100)), axis([0 100 -1.2 1.2]);
title('First 100 output of delta modulation ')
%Demodulation
y=0;
for n=2:length(d),
y(n)=y(n-1)+d(n);
end;
subplot(233), plot(y); title('demodulation by summing');
xr=filter([0.125*ones(1,8)],1,y); % 8th order moving average filter
subplot(234), plot(xr), title('Filtering to smoothing edge')
A-2.5; x= A*x; %max. slope=2.5*62.8=157, slope overloading
%Modulation
xq(1)=0; d(1)=0;
for n=2:length(x),
d(n)=sign(x(n)-xq(n-1)); xq(n)=xq(n-1)+d(n)*step;
end
%Demodulation y=0;
OUTPUT :
Theory :
A larger step-size is needed in the steep slope of modulating signal and a smaller
stepsize is needed where the message has a small slope. The minute details get
missed in the process. So, it would be better if we can control the adjustment of
step-size, according to our requirement in order to obtain the sampling in a desired
fashion. This is the concept of Adaptive Delta Modulation.
eceiver : The ADM receiver has two parts. The first part is used to produce the
R
step size from the incoming bits. The bits are then applied to the second part of the
receiver which contains an accumulator. The function of the accumulator is to build
up the staircase waveform. The signal is then passed through a low pass filter which
is used to smoothen the staircase waveform and reconstruct the original signal.
TRANSMITTER :
CODE:
t =0:1/29:1;
f=1;
x=4*sin(2*pi*f*t);
x=[x ones(1,10) x];
y = zeros(1,length(x));
d = zeros(1,length(x));
e= zeros(1,length(x));
s=0.1;
for i=5:length(x)
if(x(i)-y(i-1))>=0
y(i) = x(i)-s;
d(i)=-1;
elseif(x(i)-y(i-1))<0
y(i)=x(i)-1;
d(i)=-1;
end
if(sum(d(i-4:i)))>3
s=s+0.01;
elseif(sum(d(i-4:i)))<-3
s=s+0.01;
elseif(sum(d(i-4:i)))==0
s=s-0.01;
else
s=s;
end
pause;
end
OUTPUT :
AIM :
Generating Rayleigh distribution for different alpha
Theory :
Weibull Distribution (Rayleigh Distribution) The Weibull distribution describes data
resulting from life and fatigue tests. It is commonly used to describe failure time in
reliability studies as well as the breaking strengths of materials in reliability and
quality control tests. Weibull distributions are also used to represent various physical
quantities, such as wind speed. The Weibull distribution is a family of distributions
that can assume the properties of several other distributions. For example,
depending on the shape parameter you define, the Weibull distribution can be used
to model the exponential and Rayleigh distributions, among others. The Weibull
distribution is very flexible.
CODE:
% genrating RAYLEIGH distribution for different alpha
x =0:0.05:4;
y=raylpdf(x,0.4); %raylpdf is in build functio
subplot(131); plot(x,y); axis([0 4 0 2]); title('Alpha=0.4');
y=raylpdf(x,0.7);
subplot(132); plot(x,y) , axis([0 4 0 2]); title('Alpha=0.7');
y=poisspdf(x,1.2);
subplot(133); plot(x,y) , axis([0 4 0 2]); title('Alpha=1.2');
OUTPUT:
AIM :
Generating Poisson distribution for different alpha
Theory :
The Poisson distribution describes the number of times an event occurs in a given
interval, such as the number of telephone calls per minute or the number of errors
per page in a document. The three conditions underlying the Poisson distribution
are:
1. The number of possible occurrences in any interval is unlimited.
2. The occurrences are independent. The number of occurrences in one interval
does not affect the number of occurrences in other intervals.
3. The average number of occurrences must remain the same from interval to
interval.
Code :
% genrating Poisson distribution for different alpha
x =0:30;
y=poisspdf(x,5); %poisspdf is in build functio
subplot(131); plot(x,y); axis([0 30 0 0.2]); title('Alpha=5');
y=poisspdf(x,10);
Theory :
ormally distributed,
A random variable with a Gaussian distribution is said to be n
ormal deviate.
and is called a n
Normal distributions are important in statistics and are often used in
the natural and social sciences to represent real-valued r andom variables whose
distributions are not known.[3][4] Their importance is partly due to the central limit
theorem. It states that, under some conditions, the average of many samples
(observations) of a random variable with finite mean and variance is itself a random
variable—whose distribution c onverges to a normal distribution as the number of
samples increases. Therefore, physical quantities that are expected to be the sum of
many independent processes, such as measurement errors, often have distributions
that are nearly normal.
Code :
% genrating GAUSSIAN distribution for different alpha
x =-5:0.05:5;
y=normpdf(x,0,1); %mean = 0 , std deviation =1 normpdf is in build
functio
AIM :
To perform line coding using MATLAB
Theory
A l ine code is the code used for data transmission of a digital signal over a
transmission line. This process of coding is chosen so as to avoid overlap and
distortion of signal such as inter-symbol interference.
Unipolar Signaling
Unipolar signaling is also called as On-Off Keying or simply O OK.
The presence of pulse represents a 1 and the absence of pulse represents a 0.
There are two variations in Unipolar signaling −
● Non Return to Zero NRZ
● Return to Zero R Z
Unipolar Non-Return to Zero NRZ
In this type of unipolar signaling, a High in data is represented by a positive pulse
called as Mark, which has a duration T0 equal to the symbol bit duration. A Low in
data input has no pulse.
Unipolar Return to Zero RZ
In this type of unipolar signaling, a High in data, though represented by a Mark
pulse, its duration T0 is less than the symbol bit duration. Half of the bit duration
remains high but it immediately returns to zero and shows the absence of pulse
during the remaining half of the bit duration.
Polar Signaling
There are two methods of Polar Signaling. They are −
● Polar NRZ
● Polar RZ
Polar NRZ
In this type of Polar signaling, a High in data is represented by a positive pulse,
while a Low in data is represented by a negative pulse.
Polar RZ
In this type of Polar signaling, a High in data, though represented by a Mark pulse,
its duration T0 is less than the symbol bit duration. Half of the bit duration remains
high but it immediately returns to zero and shows the absence of pulse during the
remaining half of the bit duration.
However, for a Low input, a negative pulse represents the data, and the zero level
remains same for the other half of the bit duration.
Theory :
Amplitude Shift Keying ASK is a type of Amplitude Modulation which
represents the binary data in the form of variations in the amplitude of a
signal.
Any modulated signal has a high frequency carrier. The binary signal
when ASK modulated, gives a zero value for Low input while it gives the
carrier output for High input.
Code:
clc;
close all;
clear all;
x=round (rand (1,10));
t1=0:0.001:0.999;
s=5*sin(2*pi*2*t1);
s1=sin (2*pi*2*t1) ;
ask=[]
for i=1:10
if (x(i)==1)
ask = [ask s]
else
ask = [ask s1]
end
end
subplot (2,1,1)
stairs (0:9, x)
axis([0,10, -0.2,1.2])
subplot (2,1,2);
plot (0:0.001: 9.999, ask);
Code:
clc;
close all;
clear all;
x=round (rand (1,10));
t1=0:0.001:0.999;
s=5*sin(2*pi*2*t1);
s1=sin (2*pi*2*t1) ;
ask=[]
for i=1:10
if (x(i)==1)
ask = [ask s]
else
ask = [ask zeros(1,1000)]
end
end
subplot (2,1,1)
stairs (0:9, x)
axis([0,10, -0.2,1.2])
subplot (2,1,2);
plot (0:0.001: 9.999, ask);
Theory :
Frequency Shift Keying FSK is the digital modulation technique in which
the frequency of the carrier signal varies according to the digital signal
changes. FSK is a scheme of frequency modulation.
The output of a FSK modulated wave is high in frequency for a binary
High input and is low in frequency for a binary Low input. The binary 1s
and 0s are called Mark and Space frequencies.
Code:
clc;
close all;
clear all;
x=round (rand (1,10));
t=0:0.001:0.999;
s=5*sin(2*pi*4.5*t);
s1=5*sin (2*pi*2*t) ;
ask=[];
psk=[];
for i=1:10
if x(i)==1
ask = [ask s];
else
ask = [ask s1];
end
end;
subplot (2,1,1)
stairs (0:9, x)
xlabel('Time');
ylabel('Amplitude');
axis([0,10,-0.2,1.2]);
subplot(2,1,2);
plot(0:0.001:9.999,ask);
xlabel('Time');
ylabel('Amplitude');
Theory :
Phase Shift Keying PSK is the digital modulation technique in which the
phase of the carrier signal is changed by varying the sine and cosine
inputs at a particular time. PSK technique is widely used for wireless
LANs, bio-metric, contactless operations, along with RFID and Bluetooth
communications.
PSK is of two types, depending upon the phases the signal gets shifted.
They are −
Binary Phase Shift Keying BPSK
This is also called as 2-phase PSK or Phase Reversal Keying. In this
technique, the sine wave carrier takes two phase reversals such as 0°
and 180°.
If this kind of techniques are further extended, PSK can be done by eight
or sixteen values also, depending upon the requirement.
Code:
clc;
close all;
clear all;
x=round (rand (1,10));
t1=0:0.001:0.999;
s=sin(2*pi*2*t1);
s1=-sin (2*pi*2*t1) ;
psk=[]
for i=1:10
if (x(i)==1)
psk = [psk s]
else
end
subplot (2,1,1)
stairs (0:9, x)
grid on;
title('Phase Shift Keying');
ylabel('Amplitude');
xlabel('Time');
axis([0,10,-0.2,1.2]);
subplot(2,1,2);
plot(0:0.001:9.999,psk);
grid on;
title('Output Wave Form');
ylabel('Amplitude');
xlabel('Time');
OUTPUT