DSP Slide I

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

Introduction to DSP

A signal is defined as any physical quantity that varies with one or more independent
variables.Eg. ECG, EEG, ac power, seismic, speech

A System is a physical device that performs an operations or processing on a signal.


Eg. Filter or Amplifier.

Signal processing types

•ASP (Analog signal Processing) : If the input signal given to the system is analog then
system does analog signal processing. Eg. Resistor, capacitor or Inductor, OP-AMP etc.

ANALOG
Analog SYSTEM Analog
input output
DSP (Digital signal Processing)

If the input signal given to the system is digital then system does digital signal processing.
Ex Digital Computer, Digital Logic Circuits etc. The devices called as ADC (analog to
digital Converter) converts Analog signal into digital and DAC (Digital to Analog
Converter) does vice-versa.

Analog Analog
ADC DSP DAC output
input

ADVANTAGES OF DSP OVER ASP


➢ Physical size of analog systems is quite large while digital processors are more
compact and light in weight.

➢ Analog systems are less accurate because of component tolerance ex R, L, C and


active components. Digital components are less sensitive to the environmental
changes, noise and disturbances.
➢ Digital system is most flexible as software programs & control programs can
be easily modified.

➢ Digital signal can be stored on digital hard disk, floppy disk or magnetic
tapes. Hence becomes transportable.
➢ Digital processing can be done offline.

➢ Mathematical signal processing algorithm can be routinely implemented on digital


signal processing systems. Digital controllers are capable of performing complex
computation with constant accuracy at high speed.

➢ Digital signal processing systems are upgradeable since they are software
controlled.

➢ The cost of microprocessors, controllers and DSP processors are continuously


going down.

Disadvantages of DSP over ASP

➢ Additional complexity (A/D , D/A Converters & associated filters)


➢ Limit in frequency. High speed AD converters are difficult to achieve in
practice. In high frequency applications DSP are not preferred.
➢ Quantization noise and round off errors
APPLICATIONS OF DSP :
DSP can be applicable in variety of fields such as
➢ Telecommunication (cellphone, fax ,modems, echo cancellations ,etc)

➢ Consumer Electronics (flat screen TVs, television sets, MP3 players, video
recorders, DVD players, radio receivers, etc.)

➢ Image Processing (Compression , enhancement, animation , etc)

➢ Instrumentation and Control(function generator , process control , digital filter ,


etc)
➢ Military Applications (radar , intelligence, secure communications, etc)

➢ Speech Processing (speech recognition, speech to text conversion,…)

➢ Seismology (geophysical exploration such as oil ,gas ,nuclear and earth quake)

➢ Medicine (medical diagnostic instrumentation such as computerized


tomography(CT),x-ray scanning ,Magnetic resonance imaging (MRI),
Electroencephalography (EEG), electrocardiography (ECG),etc)
Elements of DSP

Analog to Digital Conversion

Sampling
Sampling is the processes of converting continuous-time analog signal, xa(t),
into a discrete-time signal by taking the “samples” at discrete-time intervals
Types of sampling
▪ Ideal Sampling
▪ Natural Sampling
▪ Flat-Top Sampling

Flat-Top Sampling
Natural Sampling
Ideal Sampling

Ideal Sampling
𝛿𝑇𝑠 (𝑓) = 𝑓𝑠 σ∞
𝑛=−∞ 𝛿(𝑓 − 𝑛𝑓𝑠 )

𝑋𝑠 (𝑓) = 𝑓𝑠 σ∞
𝑛=−∞ 𝑋(𝑓 − 𝑛𝑓𝑠 )

◼ This means that the output is simply the replication of the original signal at
discrete intervals.
Summary of Impulse Sampling

fs = 2fm

𝑋𝑠 (𝑓) = 𝑓𝑠 σ∞
𝑛=−∞ 𝑋(𝑓 − 𝑛𝑓𝑠 )
◼ Sampling Theorem: A finite energy function x(t) can be completely
reconstructed from its sampled value x(nTs) with

𝑥(𝑡) = σ∞
𝑛=−∞ 𝑥 𝑛𝑇𝑠 sincfs(t-nTs)

1 1
provided that => = Ts 
fs 2 fm
“If a signal is sampled at a rate at least, but not exactly equal to twice the
max frequency component of the waveform, then the waveform can be
exactly reconstructed from the samples without any distortion”

f s  2 f max
Aliasing

fs > 2fm

fs < 2fm Aliasing happens


Practical Sampling
▪ It is practically difficult to create a train of impulses

Practical sampling pulses


 t − nTs 
x p (t ) =    
n =−   

Natural Sampling

If we multiply x(t) by a train of rectangular pulses xp(t), we obtain a gated


waveform that approximates the ideal sampled waveform, known as
natural sampling or gating

xs (t ) = x(t ) x p (t ) = x(t ) 
n =−
cn e j 2 nf s t
 
X s ( f ) = [ x(t ) x p (t )] =  c [ x(t )e
n
j 2 nf s t
]= c
n =−
n X [ f − nf s ]
n =−

𝑐𝑛 = 𝐴𝑓𝑠 ෍ 𝑠𝑖𝑛𝑐(𝑛𝑓𝑠 𝜏)
𝑛=−∞

▪ Xs (f) is weighted by Cn  Fourier Series Coefficients


▪ The problem with a natural sampled waveform is that the tops of the
sample pulses are not flat
▪ It is not compatible with a digital system since the amplitude of each
sample has infinite number of possible values
Flat-Top Sampling

▪ The pulse is held to a constant height for the whole sample period
▪ This technique is used to realize Sample-and-Hold (S/H) operation
In S/H, input signal is continuously sampled and then the value is held
for as long as it takes to for the A/D to acquire its value

x '(t ) = x(t ) (t )

xs (t ) = x '(t ) * p(t )
 

= p(t ) * x(t ) (t ) = p(t ) *  x(t )   (t − nTs ) 
 n =− 
 

X s ( f ) = [ xs (t )] = P( f )   x(t )   (t − nTs ) 
 n =− 

1
= P( f )
Ts
 X ( f − nf )
n =−
s 𝑝 𝑓 = 𝐴𝜏𝑠𝑖𝑛𝑐(𝑓𝜏)𝑒 −𝑗𝜋𝑓𝜏

where P(f) is a sinc function

Spectrum of flat top sampling

Recovering the Analog Signal

▪ One way of recovering the original signal from sampled signal Xs(f) is to
pass it through a Low Pass Filter (LPF) as shown below
◼ If fs > 2B then we recover x(t) exactly
◼ Else we run into some problems and signal
is not fully recovered

Eg. Consider the analog signal x(t) given by


x(t ) = 3cos(50 t ) + 100sin(300 t ) − cos(100 t )
What is the Nyquist rate for this signal?
Quantization

Quantization is representing the sampled values of the amplitude by a finite set of


levels, which means converting a continuous-amplitude sample into a discrete-time
signal.
The spacing between the two adjacent representation levels is
called step-size.

𝑚𝑎𝑥 − 𝑚𝑖𝑛 L is the number of quantization levels


∆=
𝐿
N is the no. of bits to encode each sampled value
N = log 2 𝐿
Uniform Quantization

A quantizer with equal quantization level is a Uniform Quantizer

Dynamic range

Step size ∆

Two types of quantization: (a) midthread and (b) midrise


Signal to Quantization Noise Ratio

Let Δ=q
q q
Error of a uniform quantizer is bounded by − e
2 2

▪ Mean Squared Error (MSE) = q2/12


▪ Mean signal power = E[m2(t)]
▪ Mean SNR = 12 E[m2(t)]/q2
▪ For binary PCM, L = 2n → n bits/sample
▪ Let signal bandwidth = B Hz
– If Nyquist sampling → 2B samples/sec
▪ Bit rate = 2nB bits/sec
▪ Required channel bandwidth = nB Hz
Discrete time signal and systems

▪ Graphical representation
▪ Functional representation
▪ Tabular representation
▪ Sequence representation
Consider a signal x(n) with values
x (-2) = 3, x (-1) = 2, x (0) = 0, x (1) = 3, x (2) = 1 and x (3) = 2

Graphical representation of discrete time signals


Functional representation of discrete time signal

Tabular representation

Sequence representation

The arrow indicates n=0


Elementary discrete time signals

unit sample sequence

Shifted unit sample sequence

Properties of discrete-time unit sample sequence

unit step sequence


unit ramp sequence

real exponential sequence


Discrete time systems

A discrete-time system is one which transforms discrete-time input signals into


discrete-time output signals.

Classification of discrete time systems

Linear and non-linear systems

A system which obeys the principle of superposition and principle of homogeneity

Homogeneity a system which produces an output y(n) for an input x(n) must
produce an output ay(n) for an input ax(n).
Superposition a system which produces an output y1(n) for an input x1(n) and an
output y2(n) for an input x2(n) must produce an output y1(n) + y2(n)
for an input x1(n) + x2(n).

Example. Check whether the following systems are linear or not:

Shift-invariant and shift varying systems

If
then

Example. Determine whether the following systems are time-invariant or not:


Causal and non-causal systems

✓ A system is said to be causal (or non-anticipative) if the output of the system


at any instant n depends only on the present and past values of the input but
not on future inputs.

✓ Causal systems are real time systems. They are physically realizable.

Example. Check whether the following systems are causal or not:

Analysis of Linear Time Invariant (LTI) system

The response of LTI systems to arbitrary input is computed using convolution


Methods of computing convolution

✓ Graphical Method
✓ Using equation of convolution
✓ Tabulation method

Graphical Method
There are four basic steps to the calculation:

Lowest range : yL=hL+xL Highest range : yH=hH+xH

Example : Compute the convolution of 𝑥 𝑛 = 1,2,3 𝑎𝑛𝑑 ℎ 𝑛 = 1,1


Tabulation Method
✓ The simplest method of computing discrete convolution for short sequences

Steps 1. Arrange x[n] in row and h[n] in column or vice versa


2. Multiply each corresponding elements
3. Add product elements diagonally

Example: Determine the output of x[n] = {1,2,3} input to the system described
by h[n] = {-1,2,2}

The output y[n] = [ -1, -2+2, -3+4+2, 6+4, 6]= [-1, 0, 3, 10, 6]

You might also like