A Course Material On DSP
A Course Material On DSP
A Course Material On DSP
QUALITY CERTIFICATE
CONTENT
PG.NO
CHAPTR -1
SIGNALS AND
SYSTEMS
Introduction
11
11
12
12
12
13
13
16
Types of convolution
Properties of convolution
Causality of LSI systems
Stability for LTI systems
Correlation
Types of correlation
Properties of correlation
19
22
A/D Conversion
Differential Equations
23
CHAPTER 2
DISCRETE TIME SYSTEMS ANALYSIS
2.0 Introduction to Z Transform
Advantages of Z Transform
Advantages of ROC
2.1 Z Transform plot
26
26
Properties of Z -Transform
2.2
Relationship between FT & Z
Transform
2.3 Inverse Z Transform
2.4 Pole Zero Plot
2.5 One sided Z Transform
2.6 Solution of Differential Equations
2.7 Jury stability criterian
CHAPTER 3
DISCRETE FOURIER TRANSFORM & COMPUTATION
3.0
3.1
3.2
3.3
3.4
3.5
3.6
Introduction
Difference between FT & DFT
Calculation of DFT
Difference between DFT & IDFT
Properties of DFT
Application of DFT
FFT
Radix 2 FFT Algorithm
3.7
GEOERZEL Algorithm
29
31
34
36
37
38
39
39
41
47
50
59
CHAPTER 4
DESIGN OF DIGITAL FILTERS
Introduction 61
Types of digital filters
Structure for FIR system
Structure for IIR system
IIR Filter design (Impulse invariance)
IIR Filter design (BZT)
Butterworth approximation
Frequency Transformation
FIR Filter design
Design filter for pole zero placement
65
65
68
73
76
80
87
89
93
CHAPTER 5
DIGITAL SIGNAL PROCESSOR
97
100
101
106
References
Glossary Terms
Tutorial Problems
Question Bank
Question paper
110
111
112
CHAPTER 1
SIGNALS AND SYSTEM
PREREQISTING DISCUSSION
A Signal is defined as any physical quantity that changes with time, distance, speed, position,
pressure, temperature or some other quantity. A Signal is physical quantity that consists of
many sinusoidal of different amplitudes and frequencies.
Ex
x(t) = 10t
X(t) = 5x2+20xy+30y
A System is a physical device that performs an operations or processing on a signal. Ex Filter
or Amplifier.
Analog
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
Signal signal
Most of the signals generated are analog in nature. Hence these signals are converted to
digital form by the analog to digital converter. Thus AD Converter generates an array of
samples and gives it to the digital signal processor. This array of samples or sequence of
samples is the digital equivalent of input analog signal. The DSP performs signal processing
operations like filtering, multiplication, transformation or amplification etc operations over
this digital signals. The digital output signal from the DSP is given to the DAC.
CLASSIFICATION OF SIGNALS
Single channel and Multi-channel signals
Single dimensional and Multi-dimensional signals
Continuous time and Discrete time signals.
Continuous valued and discrete valued signals.
Analog and digital signals.
Deterministic and Random signals
Periodic signal and Non-periodic signal
Symmetrical(even) and Anti-Symmetrical(odd) signal
Energy and Power signal
Single channel and Multi-channel signals
If signal is generated from single sensor or source it is called as single channel signal. If the
signals are generated from multiple sensors or multiple sources or multiple signals are
generated from same source called as Multi-channel signal. Example ECG signals. Multichannel signal will be the vector sum of signals generated from multiple sources.
Single Dimensional (1-D) and Multi-Dimensional signals (M-D)
If signal is a function of one independent variable it is called as single dimensional signal
like speech signal and if signal is function of M independent variables called as Multidimensional signals. Gray scale level of image or Intensity at particular pixel on black and
white TV are examples of M-D signals.
S. No
1
Continuous Valued
Discrete Valued
If a signal takes on all possible values on If signal takes values from a finite set of
a finite or infinite range, it is said to be possible values, it is said to be discrete valued
continuous valued signal.
signal.
Continuous Valued and continuous time
Discrete time signal with set of discrete
signals are basically analog signals.
amplitude are called digital signal.
Continuous valued and Discrete Valued signals.
Analog signal
These are basically continuous time &
continuous amplitude signals.
Digital signal
These are basically discrete time signals &
discrete amplitude signals. These signals are
basically obtained by sampling
&
quantization process.
ECG signals, Speech signal, Television All signal representation in computers and
signal etc. All the signals generated from digital signal processors are digital.
various sources in nature are analog.
2
3
4
Random signals
Random signals that cannot be
represented or described by a
mathematical equation or lookup table.
Not Preferable. The random signals can
be described with the help of their
statistical properties.
The value of the random signal cannot
be evaluated at any instant of time.
Example Noise signal or Speech signal
Tutorial problems:
cos (0.01 n)
cos (3 n)
sin(3n)
cos(n/8) cos( n/8)
= + ( ) 2
Rearranging the above terms we have
Thus X(n)= Xe(n) + Xo(n)
= ( ) 2
Even component of discrete time signal is given by
= + ( ) 2
Odd component of discrete time signal is given by
= ( ) 2
Test whether the following CT waveforms is periodic or not. If periodic
find out the fundamental period.
2 sin(2/3)t + 4 cos (1/2)t + 5 cos((1/3)t
Ans: Period of x(t)= 12
a cos(t 2) + b sin(t/4)
Ans: Non-Periodic
Find out the even and odd parts of the discrete signal x(n)={2,4,3,2,1}
Find out the even and odd parts of the discrete signal x(n)={2,2,2,2}
()
The average power for a discrete time signal x(n) is defined as
1
= lim 2+1 = ( )
If Energy is finite and power is zero for x(n) then x(n) is an energy
signal. If power is finite and energy is infinite then x(n) is power signal.
There are some signals which are neither energy nor a power signal.
Tutorial problems:
Find the power and energy of u(n) unit step function.
Find the power and energy of r(n) unit ramp function.
Find the power and energy of an u(n).
1
0
n=0
n=0
i.e (n)={1}
1
0
n0
n<0
2
4
3
0
4
0
n
0
n0
n<0
Exponential signal
x(n) = a n = (re j ) n = r n e j n = r n (cos n + j sin n)
4) Sinusoidal waveform
x(n) = A Sin wn
Shifting : signal x(n) can be shifted in time. We can delay the sequence or advance the
sequence. This is done by replacing integer n by n-k where k is integer. If k is positive
signal is delayed in time by k samples (Arrow get shifted on left hand side) And if k is
negative signal is advanced in time k samples (Arrow get shifted on right hand side)
X(n) = { 1, -1 , 0 , 4 , -2 , 4 , 0 ,
}
Delayed by 2 samples :
n=0
X(n-2)= { 1, -1 , 0 , 4 , -2 , 4 , 0 ,}
Advanced by 2 samples :
n=0
X(n+2) = { 1, -1 , 0 , 4 , -2 , 4 , 0 ,}
n=0
Folding / Reflection : It is folding of signal about time origin n=0. In this case
replace n by n. Original signal:
X(n) = { 1, -1 , 0 , 4 , -2 , 4 , 0}
n=0
Folded signal:
X(-n) = { 0 , 4 , -2 , 4 , 0 , -1 , 1}
n=0
Addition : Given signals are x1(n) and x2(n), which produces output y(n) where y(n)
= x1(n)+ x2(n). Adder generates the output sequence which is the sum of input
sequences.
Scaling: Amplitude scaling can be done by multiplying signal with some constant.
Suppose original signal is x(n). Then output signal is A x(n)
y(n) = x(n-1)
x(n)
y(n) = x(n+1)
Unit advance
Addition
x2(n)
Multiplication
x1(n)
x2(n)
Scaling (constant multiplier)
A
y(n) =x1(n)+x2(n)
y(n) =x1(n)*x2(n)
x(n)
y(n) = A x(n)
DYNAMIC
(Dynamicity property)
Static systems are those systems whose output at any Dynamic
systems
output
instance of time depends at most on input sample at same depends upon past or future
time.
samples of input.
Static systems are memory less systems.
They have memories for
memorize all samples.
It is very easy to find out that given system is static or dynamic. Just check that output of
the system solely depends upon present input only, not dependent upon past or future.
S. No
System [y(n)]
Static / Dynamic
1
x(n)
Static
2
A(n-2)
Dynamic
2
3
Static
X (n)
2
4
Dynamic
X(n )
2
5
Static
n x(n) + x (n)
6
X(n)+ x(n-2) +x(n+2)
Dynamic
Let x1(n) and x2(n) are two input sequences, then the system
is said to be linear if and only if T[a1x1(n) +
a2x2(n)]=a1T[x1(n)]+a2T[x2(n)]
NON-LINEAR
(Linearity Property)
A System is Non-linear if it
does
not
satisfies
superposition theorem.
x1(n)
x2(n)
a1
a2 x1(n)
y(n)= T[a1x1[n] + a2x2(n) ]
y(n)=T[a1x1(n)+a2x2(n)]
x2(n)
a2
ex(n)
Non-Linear
x2 (n)
Non-Linear
m x(n) + c
Non-Linear
cos [ x(n) ]
Non-Linear
X(-n)
Linear
Log 10 (|x(n)|)
Non-Linear
NON-CAUSAL
(Causality Property)
A System is Non causal if output of
system at any time depends on future
inputs.
In Non-Causal System the output is the
function of future inputs also. X(n+1)
x(n+2) .. and so on
Offline Systems
It is very easy to find out that given system is causal or non-causal. Just check that output
of the system depends upon present or past inputs only, not dependent upon future.
S.No
System [y(n)]
Causal /Non-Causal
1
x(n) + x(n-3)
Causal
2
X(n)
Causal
3
X(n) + x(n+3)
Non-Causal
4
2 x(n)
Causal
5
X(2n)
Non-Causal
6
X(n)+ x(n-2) +x(n+2)
Non-Causal
STABLE v/s UNSTABLE SYSTEMS
S.No
STABLE
1
2
UNSTABLE
(Stability Property)
A System is unstable if any bounded input
produces a unbounded output.
() <
S.No
1
2
3
4
5
System [y(n)]
Cos [ x(n) ]
x(-n+2)
|x(n)|
x(n) u(n)
X(n) + n x(n+1)
Stable / Unstable
Stable
Stable
Stable
Stable
Unstable
elementary input signals are taken into account and individually given to the system.
Now using linearity property whatever output response we get for decomposed input
signal, we simply add it & this will provide us total response of the system to any
given input signal.
Convolution involves folding, shifting, multiplication and summation operations.
If there are M number of samples in x(n) and N number of samples in h(n) then the
maximum number of samples in y(n) is equals to M+n-1.
Linear Convolution states that
y(n) = x(n) * h(n)
y(n) =
x (k) h(n k )
h[ -(k-n) ] k= -
= x (k)
k= -
ANSWER :
y(n) = x (k)
h(n k )
k= -
k= 0 to 3
(start index to end
index of x(n))
y(n) = x(0) h(n) + x(1) h(n-1) + x(2) h(n-2) + x(3) h(n-3)
METHOD 3: VECTOR FORM (TABULATION METHOD)
X(n)= {x1,x2,x3}
&
h(n) ={ h1,h2,h3}
h1 h2 h3
y(-1) = h1 x1
y(0) = h2 x1 + h1 x2
y(1) = h1 x3 + h2x2 + h3 x1
X1
x2
x3
METHOD 4: SIMPLE MULTIPLICATION FORM
X(n)= {x1,x2,x3}
&
h(n) ={ h1,h2,h3}
x1 x2 x3
y(n) =
y1 y2 y3
X(n)
h(n)
X(n)
Response
y(n) =
h(k)
x(nk)
k=-
At n= n0 ,the output y(n0) will be
y(n0) =
h(k)
x(n0k)
k=-
Rearranging the above terms...
-
y(n0) = h(k) x(n0k) +
h(k) x(n0k) k=0k=-1
The output of causal system at n= n0 depends upon the inputs for
n< n0 Hence h(-1)=h(-2)=h(-3)=0
Thus LSI system is causal if and only
if
h(n) =0
for n<0
This is the necessary and sufficient condition for causality of the system.
Linear convolution of the causal LSI system is given by
n
y(n) = x (k) h(n k )
k=0
The input x(n) is said to bounded if there exists some finite number Mx such that |x(n)| Mx
< . The output y(n) is said to bounded if there exists some finite number My such that |y(n)|
My < .
Linear convolution is given by
y(n) = x
(k)
h(n
k
)
k=
Taking the absolute value of both
sides
|y(n)|
|y(n)|
The input x(n) is said to bounded if there exists some finite number Mx such that |x(n)| Mx
< . Hence bounded input x(n) produces bounded output y(n) in the LSI system only if
|h(k)| <
k=-
With this condition satisfied, the system will be stable. The above equation states that the LSI
system is stable if its unit sample response is absolutely summable. This is necessary and
sufficient condition for the stability of LSI system.
SELF-STUDY: Exercise No. 1
Q1) Show that the discrete time signal is periodic only if its frequency is expressed as the
ratio of two integers.
Q2) Show that the frequency range for discrete time sinusoidal signal is - to
radians/sample or - cycles/sample to cycles/sample.
Q3) Prove (n)= u(n)= u(n-1).
n
Q4) Prove
u(n)=
(k)
k=-
CORRELATION:
It is frequently necessary to establish similarity between one set of data and another.
It means we would like to correlate two processes or data. Correlation is closely related to
convolution, because the correlation is essentially convolution of two data sequences in
which one of the sequences has been reversed.
Applications are in
Images processing for robotic vision or remote sensing by satellite in which data from
different image is compared
In radar and sonar systems for range and position finding in which transmitted and
reflected waveforms are compared.
Correlation
In case of Correlation, two signal sequences are
just compared.
Not commutative.
TYPES OF CORRELATION
Under Correlation there are two classes.
CROSS CORRELATION: When the correlation of two different sequences x(n)
and y(n) is performed it is called as Cross correlation. Cross-correlation of x(n) and
y(n) is rxy(l) which can be mathematically expressed as
rxy(l) = x (n) y(n l )
n= -
OR
rxy(l) = x (n + l) y(n) n= -
OR
rxx(l) = x (n
+ l)
x(n)
n= -
PROPERTIES OF CORRELATION
The cross-correlation is not commutative.
rxy(l) = ryx(-l)
The cross-correlation is equivalent to convolution of one sequence with folded version
of another sequence.
rxy(l) = x(l) *
y(-l).
The autocorrelation sequence is an even function.
rxx(l) = rxx(-l)
Examples:
Q) Determine cross-correlation
sequence
x(n)={2, -1, 3, 7,1,2, -3} & y(n)={1, -1, 2, -2, 4, 1, -2 ,5}
Answer:
rxy(l) = {10, -9, 19, 36, -14, 33, 0,7, 13, -18, 16, -7, 5, -3}
Q) Determine autocorrelation
sequence
x(n)={1, 2, 1, 1}
Answer:
rxx(l) = {1, 3, 5, 7, 5, 3, 1}
A/D CONVERSION
BASIC BLOCK DIAGRAM OF A/D CONVERTER
Analog signal Xa(t)
Discrete time
Quantized
Digital signal
signal
signal
SAMPLING THEOREM
It is the process of converting continuous time signal into a discrete time signal by taking
samples of the continuous time signal at discrete time instants.
X[n]= Xa(t) where t= nTs = n/Fs
.(1)
Fs= 40 Hz
i.e t= n/Fs
Case 2:
X1(t) = cos 2 (50) t
Fs= 40 Hz
i.e t= n/Fs x1[n]= cos 2(5n/4)= cos 2( 1+ )n
= cos (/2)n
Thus the frequency 50 Hz, 90 Hz , 130 Hz are alias of the frequency 10 Hz at the
sampling rate of 40 samples/sec
2.QUANTIZATION
The process of converting a discrete time continuous amplitude signal into a digital signal
by expressing each sample value as a finite number of digits is called quantization. The
error introduced in representing the continuous values signal by a finite set of discrete value
levels is called quantization error or quantization noise.
Example:
N
0
1
2
3
4
[n]
5
4.5
4.05
3.645
3.2805
fs= 1 Hz
eq [n]
0
0
-0.05
-0.045
0.0195
Quantization Step/Resolution : The difference between the two quantization levels is called
quantization step. It is given by = XMax xMin / L-1 where L indicates Number of
quantization levels.
3.CODING/ENCODING
Each quantization level is assigned a unique binary code. In the encoding operation, the
quantization sample value is converted to the binary equivalent of that quantization level. If
16 quantization levels are present, 4 bits are required. Thus bits required in the coder is the
smallest integer greater than or equal to Log2 L. i.e
b= Log2 L
Thus Sampling frequency is calculated as fs=Bit rate / b.
ANTI-ALIASING FILTER
When processing the analog signal using DSP system, it is sampled at some rate depending
upon the bandwidth. For example if speech signal is to be processed the frequencies upon
3khz can be used. Hence the sampling rate of 6khz can be used. But the speech signal also
contains some frequency components more than 3khz. Hence a sampling rate of 6khz will
introduce aliasing. Hence signal should be band limited to avoid aliasing.
The signal can be band limited by passing it through a filter (LPF) which blocks or
attenuates all the frequency components outside the specific bandwidth. Hence called as
Anti aliasing filter or pre- filter. (Block Diagram).
SAMPLE-AND-HOLD CIRCUIT:
The sampling of an analogue continuous-time signal is normally implemented using a
device called an analogue-to- digital converter (A/D). The continuous-time signal is first
passed through a device called a sample-and-hold (S/H) whose function is to measure the
input signal value at the clock instant and hold
it fixed for a time interval long enough for the A/D operation to complete.
Analogue-to-digital conversion is potentially a slow operation, and a
variation of the input voltage during the conversion may disrupt the
operation of the converter. The S/H prevents such disruption by keeping the
input voltage constant during the conversion. This is schematically
illustrated by Figure.
After a continuous-time signal has been through the A/D converter, the
quantized output may differ from the input value. The maximum possible
output value after the quantization process could be up to half the
quantization level q above or q below the ideal output value. This
deviation from the ideal output value is called the quantization error. In
order to reduce this effect, we increases the number of bits.
Tutorial problems:
Q) Calculate Nyquist Rate for the analog signal x(t)
1) x(t)= 4 cos 50 t + 8 sin 300t cos 100t
Hz
2) x(t)= 2 cos 2000t+ 3 sin 6000t
Fn=12KHz
Fn=300
+
cos
12000t
Fn=100
Q) The following four analog sinusoidal are sampled with the fs=40Hz.
Find out corresponding time signals and comment on them
X(t)= cos 2(10)t X2(t)= cos 2(50)t X3(t)= cos 2(90)t X4(t)= cos 2(130)t
Q) Signal x1(t)=10cos2(1000)t+ 5 cos2(5000)t. Determine Nyquist
rate. If the signal is sampled at 4khz will the signal be recovered from its
samples.
Q) Signal x1(t)=3 cos 600t+ 2cos800t. The link is operated at 10000 bits/sec and each input
sample is quantized into 1024 different levels. Determine Nyquist rate, sampling frequency,
folding frequency & resolution.
DIFFERENCE EQUATION
S. No
1
2
3
The FIR system has limited span which views only most
recent M input signal samples forming output called as
Windowing.
FIR has limited or finite memory requirements.
Realization of FIR system is generally
Convolution Sum Method.
IIR System
requires
infinite
memory.
based on Realization of IIR system
is
generally based on Difference
Method.
n0
k= 0
Zero state response (Forced response) : Consider initial condition are zero. (System is
relaxed at time n=0) i.e
y(-1) =0
Zero Input response (Natural response) : No input is forced as system is in non-relaxed
initial condition.
i.e
y(-1) != 0
Total response is the sum of zero state response and zero input response.
Q) Determine zero input response for y(n) 3y(n-1) 4y(n-2)=0; (Initial Conditions are
y(-1)=5 & y(-2)= 10)
Answer: y(n)= 7 (-1)n + 48 (4)n
CHAPTER 2
DISCRETE TIME SYSTEM
ANALYSIS 2.0 PREREQISTING DISCUSSION ABOUT Z
TRANSFORM
For analysis of continuous time LTI system Laplace transform is used. And for
analysis of discrete time LTI system z transform is used. Z transform is mathematical tool
used for conversion of time domain into frequency domain (z domain) and is a function of
the complex valued variable Z. The z transform of a discrete time signal x(n) denoted by
X(z) and given as
X(z) = x (n) z n
z-
Transform.(1) n=-
Z transform is an infinite power series because summation index varies from - to . But it
is useful for values of z for which sum is finite. The values of z for which f (z) is finite and
lie within the region called as region of convergence (ROC).
ADVANTAGES OF Z TRANSFORM
The DFT can be determined by evaluating z transform.
Z transform is widely used for analysis and synthesis of digital filter.
Z transform is used for linear filtering. z transform is also used for finding Linear
convolution, cross-correlation and auto-correlations of sequences.
In z transform user can characterize LTI system (stable/unstable, causal/anticausal) and its response to various signals by placements of pole and zero plot.
ADVANTAGES OF ROC(REGION OF CONVERGENCE)
ROC is going to decide whether system is stable or unstable.
ROC decides the type of sequences causal or anti-causal.
ROC also decides finite or infinite duration sequences.
2.1 Z TRANSFORM PLOT
Z-Plane
Fig show the plot of z transforms. The z transform has real and imaginary parts. Thus a plot
of imaginary part versus real part is called complex z-plane. The radius of circle is 1 called
as unit circle.
This complex z plane is used to show ROC, poles and zeros. Complex variable z is also
expressed in polar form as Z= rej where r is radius of circle is given by |z| and is the
frequency of the sequence in radians and given by z.
S.No
1
2
Time Domain
Sequence
(n) (Unit sample)
(n-k)
Time shifting
(n+k)
Time shifting
4
5
6
7
8
9
10
11
12
13
14
1 for 0<n<N-1 or
u(n) u(n-N)
cos(0n) u(n)
Property
z Transform
1
Time reversal
Time reversal
Differentiation
Scaling
z-k
zk
1/1- z-1 = z/z-1
1/1- z
z/z- 1
z-1 / (1- z-1)2
1/1- (az-1)
1/1- (az-1)
ROC
complete z plane
except z=0
except z=
|z| > 1
|z| < 1
|z| < 1
|z| > 1
|z| > |a|
|z| < |a|
Differentiation
Differentiation
Linearity
Shifting
1- z-N/ 1- z-1
1- z-1cos0
|z| > 1
1- 2z-1cos0+z-2
15
16
17
z-1sin0
|z| > 1
Time scaling
1- 2z-1cos0+z-2
1- (z/a)-1cos0
Time scaling
1- 2(z/a)-1cos0+(z/a)-2
(z/a)-1sin0
sin(0n) u(n)
a cos(0n) u(n)
a sin(0n) u(n)
1- 2(z/a)-1cos0+(z/a)-2
Tutorial problems:
Q) Determine z transform of
following signals. Also draw
ROC. i) x(n) = {1,2,3,4,5}
ii) x(n)={1,2,3,4,5,0,7}
Q) Determine z transform and ROC for x(n) = (-1/3)n u(n) (1/2)n
u(-n-1).
Q) Determine z transform and ROC for x(n) = [ 3.(4n)4(2n)]
u(n).
Q) Determine z transform and ROC for x(n) = (1/2)n u(-n).
Q) Determine z transform and ROC for x(n) = (1/2)n {u(n) u(n10)}.
Q) Find linear convolution using z transform. X(n)={1,2,3} &
h(n)={1,2}
z
a1 x1(n) + a2 x2(n)
a1 X1(z) + a2 X2(z)
z Transform of linear combination of two or more signals is equal to the same linear
combination of z transform of individual signals.
Time shifting
The Time shifting property states that
if
z
x(n)
X(z) And
z
Then
x(n-k)
X(z) zk
Thus shifting the sequence circularly by k samples is equivalent to multiplying its z
transform by z k
Scaling in z domain
This property states that if
z
x(n)
X(z) And
z
Then
an x(n)
x(z/a)
Thus scaling in z transform is equivalent to multiplying by an in time domain.
Time reversal Property
The Time reversal property states that
if
z
x(n)
X(z) And
z
Then
x(-n)
x(z-1)
It means that if the sequence is folded it is equivalent to replacing z by z-1 in z domain.
Differentiation in z domain
The Differentiation property states
that if
z
x(n)
X(z) And
z
Then
n x(n)
-z d/dz (X(z))
Convolution Theorem
The Circular property states that if
z
x1(n)
z
x2(n)
X1(z) And
X2(z) Then
z
X1(z) And
z
x2(n)
X2(z) Then
then
z
x1 (l) x2(-l)
X1(z) x2(z-1) n=-
x(n)
x(0)
X(z) And
= lim X(Z) z
= lim(z-1) X(z) z
z1
X(z) = x (n) z n
(Definition of z-Transform)
n=-
Fourier transform of sequence x(n) is given by
X() = x (n) e jn
n=-
Complex variable z is expressed in polar form as Z= rej where r= |z| and is z. Thus we
can be written as
n=-
X(z)
e
z =e
= x (n)
n=-
X(z)
z =e
= x()
Thus, X(z) can be interpreted as Fourier Transform of signal sequence (x(n) rn). Here rn
grows with n if r<1 and decays with n if r>1. X(z) converges for |r|= 1. hence Fourier
transform may be viewed as Z transform of the sequence evaluated on unit circle. Thus The
relationship between DFT and Z transform is given by
X(z)
z=e
= x(k)
The frequency =0 is along the positive Re(z) axis and the frequency /2 is along the
positive Im(z) axis. Frequency is along the negative Re(z) axis and 3/2 is along the
negative Im(z) axis.
=/2 z(0,+j)
Im(z)
z=rej
=
z(-1,0)
=0
z(1,0) Re(z)
=3/2 z(0,-j)
Frequency scale on unit circle X(z)= X() on unit circle
INVERSE Z TRANSFORM (IZT)
S.No
Function (ZT)
Time domain sequence
1
1
2
1- a z-1
1
1+z-1
3-4z-1
1- 3.5 z-1+1.5z-2
1
1- 1.5 z-1+0.5z-2
Comment
causal sequence
anti-causal sequence
causal sequence
anti-causal sequence
stable system
stable system
causal system
anti-causal system
causal system
anti-causal system
The signal can be converted from time domain into z domain with the help of z
transform (ZT). Similar way the signal can be converted from z domain to time
domain with the help of inverse z transform(IZT). The inverse z transform can be
obtained by using two different methods.
Partial fraction expansion Method (PFE) / Application of residue theorem
Power series expansion Method (PSE)
for m n
b0 zn + b1 znn-1+ .+ bn
First find the roots of the denominator polynomial
a0 zm+ a1 zm-1+ .+ am
X(z) =
(z- p1) (z- p2) (z- pn)
The above equation can be written in partial fraction expansion form and find the
coefficient AK and take IZT.
SOLVE USING PARTIAL FRACTION EXPANSION METHOD
(PFE)
1+2 z-1+ z-2
5
_
causal system
causal system
causal system
causal system
causal system
5(2n-1)
for |z|>2
causal system
4-(n+3)(1/2)n
causal system
1- 3/2 z-1+0.5z-2
6
1+ z-1
_
1- z-1 + 0.5z-2
1 (0.5) z-1
1- 1/4 z-2
z+1
3z2 - 4z + 1
10
5z
_
(z-1) (z-2)
z3
11
for |z|>1
_
(z-1) (z-1/2)
z (z
(2n -1 ) u(n)
1)(z-2)
3
z2 + z
(2n+1) u(n)
(z 1)2
4
z3
(z-1) (z0.5)2
4 (n+3)(0.5)n u(n)
X(z) = x (n) z n
(1)
n
=- Expanding the
above terms we
have
x(z) = ..+x(-2)Z2+ x(-1)Z+ x(0)+ x(1) Z-1 + x(2) Z2 +..
(2)
This is the expansion of z transform in power series form. Thus
sequence x(n) is given as x(n) ={ .. ,x(-2),x(-1),x(0),x(1),x(2),
..}.
Power series can be obtained directly or by long division method.
S.No
Function (ZT)
Time domain Sequence
1
For causal sequence an u(n)
_
z
For Anti-causal sequence -an u(-n-1)
z-a
2
1
1- 1.5 z-1+0.5z-2
z2+z
z3 -3z2+3z -1
4
z2(1-0.5z-1)(1+z-1) (1-z-1)
log(1+az-1)
X(n) ={1,-0.5,-1,0.5}
(-1)n+1an/n for n1 and |z|>|a|
b0 + b1 z-1+ b2 z-2
Their IZT is give as
n
Thus
x(n) = 1/b0 [ an - x(n-i) bi] for n=1,2,.
i=1
X(0) = a0/b0
X(1) = 1/b0 [ a1- x(0) b1]
X(2) = 1/b0 [ a1- x(1) b1 - x(0) b2]
SOLVE USING RECURSIVE ALGORITHM METHOD
S. No
Function (ZT)
Time domain Sequence
-1
-2
1
X(n) = {1,3,3.6439,.}
1+2z +z
1-z-1 +0.3561z2
2
1+z-1
X(n) = {1,11/6,49/36,.}
z4 +z2
X(n) = { 23/16,63/64,}
z2-3/4z+ 1/8
ROC dos not contain any poles of X(z). This is because x(z) becomes infinite at
the locations of the poles. Only poles affect the causality and stability of the system.
|h(n)| <
n=-
With this condition satisfied, the system will be stable. The above equation states
that the LSI system is stable if its unit sample response is absolutely summable.
This is necessary and sufficient condition for the stability of LSI system.
H(z) = h (n) z n
(1)
Z-Transform.
n=-
Taking magnitude of both the sides
|H(z)| = h(n) z n
...(2)
n=-
Magnitudes of overall sum is less than the sum of magnitudes of individual sums.
|H(z)|
h
(
n
)
z
n
n
=
|H(z)|
|h(n)| | z-n |
.(3) n=-
If H(z) is evaluated on the unit circle | z-n|=|z|=1.
Hence LSI system is stable if and only if the ROC the system function includes the
unit circle. i.e r < 1. This is the condition for stability of the LSI system in terms of z
transform. Thus
For stable
system |z| < 1
For unstable
system |z| > 1
Marginally stable system |z| = 1
Fig: Stable system
Poles inside unit circle gives stable system. Poles outside unit circle gives unstable
system. Poles on unit circle give marginally stable system.
A causal and stable system must have a system function that converges for
|z| > r < 1.
STANDARD INVERSE Z TRANSFORMS
S. No
Function (ZT)
za
z
Causal Sequence
|z| > |a|
n
(a) u(n)
Anti-causal sequence
|z| <|a|
n
-(a) u(-n-1)
u(n)
u(-n-1)
(n+1)an
-(n+1)an
(n)
(n)
(n+k)
(n+k)
(n-k)
(n-k)
z1
3
z2
(z a)2
4
5
6
7
zk
(z a)k
1
Zk
Z-k
X(z) = x (n) z
n=-
X(z) = x (n) z n
n=0
One sided z transform is applicable for those systems
which are described by differential equations with non zero
initial conditions.
One sided z transform is applicable for causal systems
only.
ROC of x(z) is always exterior to circle hence need not to
be specified.
z+
[ X (z) + x(-n) zn]
+
x(n-k) z
n=1
Time advance
k
k>0
z+
X+(z) and
x(n)
z+
x(n+k)z [ X (z) - x(n) z-n]
Examples:
Q) Determine one sided z
transform for following
signals 1)
x(n)={1,2,3,4,5}
k
k-1
k>0n=0
2) x(n)={1,2,3,4,5}
Z{x(n-1)}
= x(n-1) z-n
(One sided Z transform)
n=0
= x(-1) + x(0) z-1 + x(1) z-2 + x(2) z-3 +
Similarly
Difference equations are used to find out the relation between input and
output sequences. It is also used to relate system function H(z) and Z
transform.
Tutorial problems:
Q) A difference
equation of the
system is given
below Y(n)= 0.5
y(n-1) + x(n)
Determine
a)
System function
Pole zero plot
Unit sample response
A difference equation of the
system is given below Y(n)=
0.7 y(n-1) 0.12 y(n-2) +
x(n-1) + x(n-2)
System Function
Pole zero plot
Response of system to the input x(n) = nu(n)
Is the system stable? Comment on the result.
Q) A difference
equation of the
system is given
below Y(n)= 0.5
x(n) + 0.5 x(n1)
Determine
a)
System function
Pole zero plot
Unit sample response
Transfer function
Magnitude and phase plot
A difference equation of
the system is given below
a.
Y(n)= 0.5 y(n-1) +
x(n) + x(n-1)
b.
Y(n)= x(n) + 3x(n-1) + 3x(n-2) + x(n-3)
System Function
Pole zero plot
BN-J
BN
BJ
This process will continue until you obtain 2N-3 rows with
last two having 3 elements. Y0,Y1,Y2
A digital filter with a system function H(z) is stable, if and only
if it passes the following terms. a.
D(Z)|Z=1
>0
N
b.
(-1) D(Z)|Z=-1 >0
c.
|b0|>|bN|, |C0|
CHAPTER 3
DISCRETE FOURIER TRANSFORM AND
COMPUTATION 3.1 PREREQISTING DISCUSSION
Any signal can be decomposed in terms of sinusoidal (or complex exponential)
components. Thus the analysis of signals can be done by transforming time domain signals
into frequency domain and vice-versa. This transformation between time and frequency
domain is performed with the help of Fourier Transform(FT) But still it is not convenient
for computation by DSP processors hence Discrete Fourier Transform(DFT) is used.
Time domain analysis provides some information like amplitude at sampling instant but
does not convey frequency content & power, energy spectrum hence frequency domain
analysis is used.
For Discrete time signals x(n) , Fourier Transform is denoted as x() & given by
X() = x (n) e jn
n=-
DFT is denoted by x(k) and given by (= 2
k/N)
N-1
X(k) = x (n) e j2
kn / N
DFT.(2) n=0
IDFT is given as
N-1
x(n) =1/N X (k) e j2
kn / N
IDFT(3) k=0
FT.(1)
S. No
3
4
5
Tutorial problems:
Q) Prove that FT x() is periodic with period 2.
Q) Determine FT of x(n)= an u(n) for -1< a < 1.
Q) Determine FT of x(n)= A for 0 n L-1.
Q) Determine FT of x(n)= u(n)
Q) Determine FT of x(n)= (n)
Q) Determine FT of x(n)= eat u(t)
For calculation of DFT & IDFT two different methods can be used. First
method is using mathematical equation & second method is 4 or 8 point
DFT. If x(n) is the sequence of N samples then consider W N= e j2 / N
(twiddle factor)
S. No
1
2
3
WN=W4=e j /2
W4 0
W4 1
W4 2
Angle
Real
Imaginary
Total
- /2
-j
-j
-1
-1
- 3 /2
W4 3
Four POINT DFT ( 4-DFT)
n=0
k=0
[WN] =k=1
k=2 k=3
W4
W4
W4 0
0
n=1
n=3
0
W4
W4
n=2
0
W4
W4
W4 3
WN = W8= e j /4
W8 0
W8 1
W8 2
W8 3
W8 4
W8 5
W8 6
W8 7
Angle
Magnitude
Imaginary
Total
----
- /4
1/2
-j 1/2
1/2 -j 1/2
- /2
-j
-j
- 3 /4
-1/2
-j 1/2
- 1/2 -j 1/2
-1
----
-1
- 5 / 4
-1/2
+j 1/2
- 1/2 + j 1/2
- 7 / 4
- 2
1/2
+j 1/2
1/2 + j 1/2
Remember that W8 0 = W8 8 = W8 16 = W8 24 = W8 32 = W8
40
(Periodic Property) Magnitude and phase of x(k) can
be obtained as,
|x(k)| = sqrt ( Xr(k)2 + XI(k)2)
Angle x(k) = tan -1 (XI(k) / XR(k))
Tutorial problems:
Q) Compute DFT of x(n) = {0,1,2,3}
Q) Compute DFT of x(n) = {1,0,0,1}
Q) Compute DFT of x(n) = {1,0,1,0}
Q) Compute IDFT of x(k) = {2, 1+j, 0, 1-j }
S.No
DFT (Analysis transform)
1
DFT is finite duration discrete frequency
sequence that is obtained by sampling one
period of FT.
2
DFT equations are applicable to causal
finite duration sequences.
3
Mathematical Equation to calculate DFT is
given by
N-1
X(k) = x (n) e j2
n=0
4
kn / N
kn / N
n=0
PROPERTIES OF DFT
DFT
Periodicity
x(n) x(k)
N
Let x(n) and x(k) be the DFT pair
then if
x(n+N) = x(n)
X(k+N) = X(k)
Thus periodic sequence xp(n) can be
given as
xp(n) = x(n-lN) l=
Linearity
The linearity property states that if
DFT
x1(n)
N DFT
x2(n)
N
X1(k) And
X2(k) Then
Then
DFT
a1 x1(n) + a2 x2(n)
a1 X1(k)
+ a2 X2(k) N
DFT of linear combination of two or more signals is equal to the same linear combination of
DFT of individual signals.
A sequence is said to be circularly even if it is symmetric about the point zero on the
circle. Thus X(N-n) = x(n)
A sequence is said to be circularly odd if it is anti symmetric about the point zero on
the circle. Thus X(N-n) = - x(n)
Anticlockwise direction gives delayed sequence and clockwise direction gives advance
sequence. Thus delayed or advances sequence x`(n) is related to x(n) by the circular
shift.
This property states that if the sequence is real and even x(n)= x(N-n) then
DFT becomes N-1
X(k) = x(n) cos
(2kn/N) n=0
Real and odd sequence x(n) i.e xI(n)=0 & XR(K)=0
This property states that if the sequence is real and odd x(n)=-x(N-n) then
DFT becomes N-1
X(k) = -j x(n) sin
(2kn/N)
n=0
Pure Imaginary x(n) i.e xR(n)=0
This property states that if the sequence is purely imaginary x(n)=j XI(n) then
DFT becomes N-1
XR(k) = xI(n) sin
(2kn/N) n=0
N-1
XI(k) = xI(n) cos
(2kn/N) n=0
Circular Convolution
The Circular Convolution property
states that if
DFT
x1(n)
NDFT
x2(n)
N DFT
Then x1(n)
x2(n)
X1(k) And
X2(k) Then
x1(k)
x2(k) N
It means that circular convolution of x1(n) & x2(n) is equal to multiplication of
their DFTs. Thus circular convolution of two periodic discrete signal with
period N is given by
N-1
y(m) = x1 (n) x2 (m-n)N
.(4) n=0
Multiplication of two sequences in time domain is called as Linear
convolution while Multiplication of two sequences in frequency domain is
called as circular convolution. Results of both are totally different but are
related with each other.
(n)*h(n)
There are two different methods are used to calculate circular
convolution
Graphical representation form
Matrix approach
DIFFERENCE BETWEEN LINEAR CONVOLUTION &
CIRCULAR CONVOLUTION
Tutorial problems:
Q) The two sequences x1(n)={2,1,2,1} & x2(n)={1,2,3,4}. Find out the
sequence x3(m) which is equal to circular convolution of two sequences.
Ans: X3(m)={14,16,14,16}
Q) x1(n)={1,1,1,1,-1,-1,-1,-1} & x2(n)={0,1,2,3,4,3,2,1}. Find out the sequence x3(m) which is
equal to circular convolution of two sequences. Ans: X3(m)={-4,-8,-8,-4,4,8,8,4}
Q) Perform Linear Convolution of x(n)={1,2} & h(n)={2,1}
using DFT & IDFT.
Q) Perform Linear Convolution of x(n)={1,2,2,1} &
h(n)={1,2,3} using 8 Pt DFT & IDFT.
Multiplication
The Multiplication property states that if
DFT
X1(n)
x1(k) and
N
DFT
X2(n)
x2(k) then
N
DFT
x1(n)
x2(n)
1/N x1(k)
x2(k) N
It means that multiplication of two sequences in time domain results in
circular convolution of their DFTs in frequency domain.
x(k) and
DFT
x(k) And
N DFT
Then
x((n-l))N
N
x(k) e j2 k l / N
x(k) And
x((n-l))N N
Thus shifting the frequency components of DFT circularly is equivalent to multiplying its
time domain sequence by e j2 k l / N
Complex conjugate property
The Complex conjugate property
states that if
DFT
X(n)
N DFT
x*(n)
x(k) then
x*((-k))N =
x*(N-k) And N
DFT
x*((-n))N = x*(N-k)
x*(k
)N
Circular Correlation
N
Here rxy(l) is circular cross correlation which is given as
N-1
rxy(l) = x (n)
y*((n l
))N n=0
This means multiplication of DFT of one sequence and conjugate DFT of another sequence is
equivalent to circular cross-correlation of these sequences in time domain.
12. Parsevals Theorem
The Parsevals theorem states
N-1
N-1
X(n) y*(n) = 1/N x
(k) y*(k) n=0
n=0
This equation give energy of finite duration sequence in terms of its frequency components.
APPLICATION OF DFT
DFT FOR LINEAR FILTERING
Consider that input sequence x(n) of Length L & impulse response of same system is h(n)
having M samples. Thus y(n) output of the system contains N samples where N=L+M-1. If
DFT of y(n) also contains N samples then only it uniquely represents y(n) in time domain.
Multiplication of two DFTs is equivalent to circular convolution of corresponding time
domain sequences. But the length of x(n) & h(n) is less than N. Hence these sequences are
appended with zeros to make their length N called as
Zero padding. The N point circular convolution and linear convolution provide the same
sequence. Thus linear convolution can be obtained by circular convolution. Thus linear
filtering is provided by DFT.
When the input data sequence is long then it requires large time to get the output sequence.
Hence other techniques are used to filter long data sequences. Instead of finding the output of
complete input sequence it is broken into small length sequences. The output due to these
small length sequences are computed fast. The outputs due to these small length sequences
are fitted one after another to get the final output response.
METHOD 1: OVERLAP SAVE METHOD OF LINEAR FILTERING
Step 1> In this method L samples of the current segment and M-1 samples of the previous
segment forms the input data block. Thus data block will be
X1(n) ={0,0,0,0,0, ,x(0),x(1),
.x(L-1)} X2(n) ={x(L-M+1),
.x(L-1),x(L),x(L+1),,,,,,,,,,,,,x(2L-1)}
X3(n) ={x(2L-M+1), .x(2L-1),x(2L),x(2L+2),,,,,,,,,,,,,x(3L-1)}
Step2> Unit sample response h(n) contains M samples hence its length is made N by padding
zeros. Thus h(n) also contains N samples.
h(n)={ h(0), h(1), .h(M-1), 0,0,0,(L-1 zeros)}
Step3> The N point DFT of h(n) is H(k) & DFT of m th data block be xm(K) then
corresponding DFT of output be Y`m(k)
Y`m(k)= H(k)
xm(K)
Step 4> The sequence ym(n) can be obtained by taking N point IDFT of Y`m(k). Initial
(M-1) samples in the corresponding data block must be discarded. The last L samples are the
correct output samples. Such blocks are fitted one after another to get the final output.
X1(n)
M-1
Zeros
Size L
M-1
M-1
Points add together
Y3(n)
In this method, L samples of the current In this method L samples from input
segment and (M-1) samples of the previous sequence and padding M-1 zeros forms data
segment forms the input data block.
block of size N.
Initial M-1 samples of output sequence are There will be no aliasing in output data
discarded which occurs due to aliasing blocks.
effect.
To avoid loss of data due to aliasing last M1 samples of each data record are saved.
1. Large number of the applications such as filtering, correlation analysis, spectrum analysis
require calculation of DFT. But direct computation of DFT require large number of
computations and hence processor remain busy. Hence special algorithms are developed to
compute DFT quickly called as Fast Fourier algorithms (FFT).
3. The radix-2 FFT algorithms are based on divide and conquer approach. In this method, the
N-point DFT is successively decomposed into smaller DFTs. Because of this
decomposition, the number of computations are reduced.
3.7.1 RADIX-2 FFT ALGORITHMS
K
W k+N = W
(Periodicity Property)
W k+N/2
2
= -W K
(Symmetry Property)
WN = WN/2.
N point sequence x(n) be splitted into two N/2 point data sequences f1(n) and f2(n). f1(n)
contains even numbered samples of x(n) and f2(n) contains odd numbered samples of x(n).
This splitted operation is called decimation. Since it is done on time domain sequence it is
called Decimation in Time. Thus
f1(m)=x(2m)
where n=0,1,
.N/2-1 f2(m)=x(2m+1)
where n=0,1,
.N/2-1
N point DFT is given as
N-1
X(k) = x (n) WNkn
(1)
n=0
Since the sequence x(n) is splitted into even numbered and odd numbered samples, thus N/2-1
N/2-1
X(k) = x (2m) WN + x (2m+1) WN
(2)
m=0
m=0
X(k) =F1(k) + W k
F2(k) (3)
k
(4)
Fig 1 shows that 8-point DFT can be computed directly and hence no reduction in
computation.
x(0)
x(1)
x(2)
x(3)
X(0)
X(1)
X(2)
X(3)
x(7)
X(7)
g1(k) =P1(k) + WN
P2(k) ------- (5)
2k
--------
F(0)
x(4)F(1)
x(2)
x(6)
F(2)
Fig 3. SECOND STAGE FOR FFT COMPUTATION FOR N=8
x(0)
x(2)
A= a + WN b
B= a - WN b
X(0)
X(1)
x(1)
w80
x(3)
w80
X(2)
w81
X(3)
N2 N
N/2 log2 N
N log2 N
64
52
12
24
5.3 times
16
256
240
32
64
8 times
256
65536
65280
1024
2048
64 times
A= a + WN b
WN
B= a - WN b
Table shows first column of memory address in decimal and second column as binary. Third
column indicates bit reverse values. As FFT is to be implemented on digital computer
simple integer division by 2 method is used for implementing bit reversal algorithms. Flow
chart for Bit reversal algorithm is as follows,
FLOW CHART
n=0
Since the sequence x(n) is splitted N/2 point samples, thus N/2-1
X(k) = x (n) WN + x (n + N/2) WN
m=0
m=0
N/2-1
N/2-1
(2)
N/2-1
X(k) = x (n) WN + WN
+ N/2) WN m=0
m=0
N/2-1
x (n
N/2-1
X(k) = x (n) WN +
m=0
(-1)
x (n + N/2) WN
m=0
N/2-1
X(k) =
m=0
(3)
(4)
(5)
m=0
Equation (4) and (5) are thus
simplified as
g1(n) =
x (n) +
x(n + N/2)
n
g2(n) =
A= a + b
B= (a b)WN
B
X(3) w40
w41
w40
C
D
w4 0
DIT
DIF FFT
FFT
DITFFT algorithms are based upon DIFFFT algorithms are based upon decomposition
decomposition of the input sequence of the output sequence into smaller and smaller sub
into smaller and smaller sub sequences. sequences.
In this input sequence x(n) is splitted into In this output sequence X(k) is considered to be
even and odd numbered samples
splitted into even and odd numbered samples
In DIT FFT input sequence is in bit reversed In DIFFFT, input sequence is in natural
order while the output sequence is in natural order. And DFT should be read in bit
order.
reversed order.
Direct Computation
Direct computation requires large number Radix-2 FFT algorithms requires less number
of computations as compared with FFT of computations.
algorithms.
Direct computation does not requires Splitting operation is done on time domain
splitting operation.
basis (DIT) or frequency domain basis (DIF)
Tutorial problems:
Q) x(n)={1,2,2,1} Find X(k) using DITFFT.
Q) x(n)={1,2,2,1} Find X(k) using DIFFFT.
Q) x(n)={0.3535,0.3535,0.6464,1.0607,0.3535,-1.0607,-1.3535,-0.3535}
Find X(k) using DITFFT.
Q) Using radix 2 FFT algorithm, plot flow graph for N=8.
(1)
yk(n)
yk(n) = x (m) WN
m=-
u(nm)
(3)
x (m) WN
(4)
m=0
The output of LSI system at n=N is
given by
yk(n)|n=N
= x (m) WN
m=-
(5)
There are two main kinds of filter, analog and digital. They are quite different in their
physical makeup and in how they work.
An analog filter uses analog electronic circuits made up from components such as
resistors, capacitors and op amps to produce the required filtering effect. Such filter circuits
are widely used in such applications as noise reduction, video signal enhancement, graphic
equalizers in hi-fi systems, and many other areas.
In analog filters the signal being filtered is an electrical voltage or current which is the direct
analogue of the physical quantity (e.g. a sound or video signal or transducer output) involved.
A digital filter uses a digital processor to perform numerical calculations on sampled
values of the signal. The processor may be a general-purpose computer such as a PC, or a
specialized DSP (Digital Signal Processor) chip.
The analog input signal must first be sampled and digitized using an ADC (analog to
digital converter). The resulting binary numbers, representing successive sampled values of
the input signal, are
transferred to the processor, which carries out numerical calculations on them. These
calculations typically involve multiplying the input values by constants and adding the
products together. If necessary, the results of these calculations, which now represent
sampled values of the filtered signal, are output through a DAC (digital to analog converter)
to convert the signal back to analog form.
In a digital filter, the signal is represented by a sequence of numbers, rather than a
voltage or current.
The following diagram shows the basic setup of such a system.
Discrete
Time signal
Digital signal
Samplers are used for converting continuous time signal into a discrete time signal by
taking samples of the continuous time signal at discrete time instants.
The Quantizer are used for converting a discrete time continuous amplitude signal into a
In the encoding operation, the quantization sample value is converted to the binary
digital filters performs the frequency related operations such as low pass, high pass,
band pass and band reject etc.
These digital Filters are designed with
digital hardware and software and are
represented by difference equation.
DIFFERENCE BETWEEN ANALOG FILTER AND DIGITAL FILTER
S. No
1
Analog Filter
Analog filters are used for filtering
Digital Filter
Digital filters are used for filtering digital sequences.
analog signals.
2
capacitor
assembly language.
Analog filters less accurate & because of Digital filters are less sensitive to the environmental
component tolerance of active
environmental changes.
stable.
Less flexible
system components.
6
Lowpass Filter
A lowpass filter is made up of a passband and a stopband, where the
lower frequencies Of the input signal are passed through while the
higher frequencies are attenuated.
|H ()|
Highpass Filter
A highpass filter is made up of a stopband and a passband where the lower
frequencies of the input signal are attenuated while the higher frequencies
are passed.
-c
Bandpass Filter
A bandpass filter is made up of two stopbands and one passband so that
the lower and higher frequencies of the input signal are attenuated while
the intervening
frequencies are passed.
|H()|
-2
-1
2 1
Bandstop Filter
A bandstop filter is made up of two passbands and one stopband so that the lower and
higher frequencies of the input signal are passed while the intervening frequencies are
attenuated. An idealized bandstop filter frequency response has the following shape.
|H()|
Multipass Filter
A multipass filter begins with a stopband followed by more than one passband. By
default, a multipass filter in Digital Filter Designer consists of three passbands and four
stopbands. The frequencies of the input signal at the stopbands are attenuated while
those at the passbands are passed.
Multistop Filter
A multistop filter begins with a passband followed by more than one stopband. By
default, a multistop filter in Digital Filter Designer consists of three passbands and
two stopbands.
Ideal filters have a constant gain (usually taken as unity gain) passband
characteristic and zero gain in their stop band.
FIR system has finite duration unit sample IIR system has infinite duration unit sample
duration from 0 to .
filters becomes
filters becomes
y(n)= bk x(nk)
k=0
requirements.
5
distortion is desired.
Example:
Example:
System described by
System described by
h(n)={0.5,0.5}
4. 3
Lattice structures.
(1)
k
=
0
The above equation can be expanded as,
Y(n)= h(0) x(n) + h(1) x(n-1) + h(2) x(n-2) + + h(M-1) x(nM+1)
(2) Implementation of direct form structure of FIR filter is based upon the
above equation.
h(1)x(n)
y(n)
There are M-1 unit delay blocks. One unit delay block requires one
memory location. Hencedirect form structure requires M-1 memory
location
The multiplication of h(k) and x(n-k) is performed for 0 to M-1 terms. Hence M
Direct form structure is often called as transversal or tapped delay line filter.
In cascade form, stages are cascaded (connected) in series. The output of one system is input
to another. Thus total K number of stages are cascaded. The total system function 'H' is given
by
H= H1(z) . H2(z). Hk(z)
(1)
k=1
y1(n)=x2(n)
(3)
y2(n)=x3(n)
yk(n)=y(n)
(1)
k=0
Expanding the above terms we have
H(z)= H1(z) . H2(z). Hk(z)
where HK(z) = bk0 + bk1 z-1 + bk2 z-2
(2)
bk1
x(n-1)
bk2
k=0
(1)
Z transform is given as
M
H(z) = bk zk / 1+ ak zk
K=0
(2)
k=1
M
N
There are M+N-1 unit delay blocks. One unit delay block requires one memory
location.Hence direct form structure requires M+N-1 memory locations.
DIRECT FORM I
X(n)
bo
y(n)
b2
bM-1
-a2
-aN-1
Z-1
Z-1
bM
-aN
DIRECT FORM - II
Direct form realization of H(z) can be obtained by cascading the realization of H1(z)
which is all pole system and H2(z) which is all zero system.
Two delay elements of all pole and all zero system can be merged into single delay element.
Direct Form II structure has reduced memory requirement compared to Direct form I
structure. Hence it is called canonic form.
(1)
(3)
x(n)=x1(n)
y1(n)=x2(n)
yk(n)=y(n
y2(n)=x3(n)
(1)
k=1
k=1
(1)
(4)
C
FIG - PARALLEL FORM REALIZATION OF IIR SYSTEM
Thus Direct form of second order IIR system is shown as
y(n)
IMPULSE INVARIANCE
BILINEAR TRANSFORMATION
BUTTERWORTH APPROXIMATION
n=0,1,2.
where h(n) is the unit sample response of digital filter and T is sampling interval.
But the main disadvantage of this method is that it does not correspond to simple
algebraic mapping of S plane to the Z plane. Thus the mapping from analog frequency
to digital frequency is many to one. The segments
(2k-1)/T
Because of these factors, its application is limited to design low frequency filters like
LPF or a limited class of band pass filters.
then r>
1 Thus
Left side of s-plane is mapped inside the unit circle.
n
Ha(s)= Ck / s-pk
(1)
k=1
where pk are the poles of the analog filter and ck are the coefficients of partial fraction
expansion. The impulse response of the analog filter ha(t) is obtained by inverse
Laplace transform and given as
n
ha(t) = Ck epkt
(2)
k=1
The unit sample response of the digital filter is obtained by
uniform sampling of ha(t). h(n) = ha(nT)
n=0,1,2.
.
n
h(n) = Ck epknT
(3)
k=1
System function of digital filter H(z) is obtained by Z transform of h(n).
N
H(z) = Ck
k=1
epkT z-1
(4)
n=0
Using the standard relation and comparing equation (1) and (4) system function of
digital filter is given as
1
s - pk
1
1- epkT z-1
1
1
1
1- eaT z-1
sa
2
1 - (e -0.1Tcos3T)z-1
s + 0.1
(s+0.1) + 9
2
1
(s+1) (s+2)
0.148 z
z2 - 1.48 z + 0.548
samples/sec)
3
10
(s+2)
(for sampling time is
10
1 - z-1
0.01 sec)
The method of filter design by impulse invariance suffers from aliasing. Hence in
order to overcome this drawback Bilinear transformation method is designed. In
analogue domain frequency axis is an infinitely long straight line while sampled data
z plane it is unit circle radius. The bilinear transformation is the method of squashing
the infinite straight analog frequency axis so that it becomes finite.
Important Features of Bilinear Transform Method are
Bilinear transformation method (BZT) is a mapping from analog S plane to digital
Z plane. This conversion maps analog poles to digital poles and analog zeros to
digital zeros. Thus all poles and zeros are mapped.
This transformation is basically based on a numerical integration techniques used
r2 -1
1+ r2+2r cos
2 r sin
1+ r +2r cos
2
When r
=1
2
sin
In this method IIR filters are designed This method of IIR filters design is based on the
having a unit sample response h(n) that is trapezoidal formula for numerical integration.
sampled version of the impulse response of
the analog filter.
They are generally used for low frequencies For designing of LPF, HPF and almost all types
like design of IIR LPF and a limited class of of Band pass and band stop filters this method is
bandpass filter
used.
All poles are mapped from the s plane to the z All poles and zeros are mapped.
plane by the relationship
Zk= epkT. But the zeros in two domain does
not
satisfy the same relationship.
LPF AND HPF ANALOG BUTTERWORTH FILTER TRANSFER FUNCTION
Sr
Order of the
No
Filter
1 / s+1
s / s+1
1 / s2+ 2 s + 1
s2 / s2+ 2 s + 1
1 / s3 + 2 s2 + 2s +1
s3 / s3 + 2 s2 + 2s +1
Step 4. Find out the digital filter transfer function. Replace s by (z-1)/(z+1)
z-1
-0.675
Tutorial problems:
Q) Design second order low pass butterworth filter whose cutoff
frequency is 1 kHz at sampling frequency of 104 sps.
Q) First order low pass butterworth filter whose bandwidth is known to
be 1 rad/sec . Use BZT method to design digital filter of 20 Hz
bandwidth at sampling frequency 60 sps.
Q) Second order low pass butterworth filter whose bandwidth is known to
be 1 rad/sec . Use BZT method to obtain transfer function H(z) of digital
filter of 3 DB cutoff frequency of 150 Hz and sampling frequency 1.28
kHz.
Notch Frequency= 60 Hz
H( )|2
fC
|Ha()|2=1
1 + (/c)2N
The squared magnitude function for an analog butterworth filter is of the form.
_
|Ha()|2=
1
1 + (/c)2N
1
1 + (-s2/c2)N
To find poles of H(s). H(-s) , find the roots of denominator in above equation.
-s2
c 2
= (-1)
1/N
= (e
j(2k+1) )1/N
s2 = (-1) c2 e j(2k+1) / N
Pk = + j c
j(2k+1) / 2N
As e j/2 = j
Pk = + c e j/2 e j(2k+1) / 2N
Pk = + c e j(N+2k+1)
/ 2N
(1)
1 + (p/c)2N
_
1 + (s/c)2N
Ap2
As2
2N
p
Hence order of the filter (N) is
calculated as
N= 0.5
log((1/As2) -1)
(2A)
log (s/ c)
And cutoff frequency c is
calculated as
c =p
(3)
[(1/Ap2) -1]1/2N
If As and Ap values are given
in DB then As (DB) =
- 20 log As
log As = -As /20
As
= 10 -As/20
(As)-2 = 10 As/10
(As)-2 = 10 0.1 As DB
Hence equation (2) is modified as
N= 0.5
log
10
-1
(4)
log (s/
p)
Example
|Ha()|
0.89125
0.1778
0.2
0.3
- 0.17783
- 0.2
- 0.3
N= 0.5
N= 5.88
log(1/Ap2)-1
log (s/ p)
Order of the filter should be integer.
Always go to nearest highest
Poles
P0= + 0.7032 e
j7/12
-0.182 + j
0.679
0.182 - j
0.679
P1= + 0.7032 e
j9/12
-0.497 + j
0.497
0.497 - j
0.497
P2= + 0.7032 e
j11/12
-0.679 + j
0.182
0.679 - j
0.182
P3= + 0.7032 e
-0.679 - j
0.182
j13/12
0.679 + j
0.182
4
-0.497 - j
0.497
P4= + 0.7032 e
j15/12
0.497 + j
0.497
5
-0.182 - j
0.679
0.182 + j
0.679
For stable filter all poles lying on the left
side of s plane is selected. Hence S1 =
-0.182 + j 0.679
S1* = -0.182 - j 0.679
S2 = -0.497 + j 0.497
0.497
S2* = -0.497 - j
S3* = -0.679 - j
S3 = -0.679 + j 0.182
0.182
Hence
Ha(s) =
Ha(s) =
Ha(s) =
c6
(s-s1)(s-s1*) (s-s2)(s-s2*) (s-s3)(s-s3*)
(0.7032)6
(s+0.182-j0.679)(s+0.182+j0.679) (s+0.497j0.497) (s+0.497+j0.497) (s+0.679-j0.182)
(s+0.679-j0.182)
0.1209
[(s+0.182)2 +(0.679)2] [(s+0.497)2+(0.497)2] [(s+0.679)2-(0.182)2]
1.97 0.679 0.497 0.182
[(s+0.182)2 +(0.679)2] [(s+0.497)2+(0.497)2] [(s+0.679)2-(0.182)2]
Step 6) To determine the system function (Digital Filter)
(In Bilinear transformation replace s by the term ((z-1)/(z+1)) and find
out the transfer function of digital function)
H(z)=1.97
0.09 z-1
_
1-0.99z-1+0.26z-2
Tutorial problems:
Given for low pass butterworth filter Ap= -1 db at 0.2
As= -15 db at 0.3
S. No
FREQUENCY TRANSFORMATION
Type of transformation
Low Pass
High Pass
hp
s
hp = Password edge frequency of HPF
Band Pass
(s2 + l h )
s (h - l )
h - higher band edge frequency
l - Lower band edge frequency
Band Stop
s (h - l)
When the cutoff frequency c of the low pass filter is equal to 1 then it is
called normalized filter. Frequency transformation techniques are used to
generate High pass filter, Bandpass and bandstop filter from the lowpass
filter system function.
FREQUENCY TRANSFORMATION (ANALOG FILTER)
s2+ h l
h - higher band edge frequency
l - Lower band edge frequency
Type of transformation
Low Pass
High Pass
Band Pass
Band Stop
Example:
- (z-1+ a)
1 + az-1
z-2 - a1z-1 + a2
a2z-2 - a1z-1 + 1
performance.
In
various
2 FIR filters are most stable as compared with IIR filters due to
its non feedback nature.
Quantization Noise can be made negligible in FIR filters. Due to this sharp
cutoff FIR filters can be easily designed.
Disadvantage of FIR filters is that they need higher ordered for similar
magnitude response of IIR filters.
FIR SYSTEM ARE ALWAYS STABLE. Why?
Proof: Difference equation of
FIR filter of
length M is
given as M-1
y(n)= bk x(nk)
(1)
k=0
And the coefficient bk are related to unit sample
response as H(n) = bn for 0 n M-1
= 0 otherwise.
We can expand this equation as
Y(n)= b0 x(n) + b1 x(n-1) + .. + bM-1 x(n-M+1)
(2)
System is stable only if system produces bounded output for every bounded input. This is
stability definition for any system.
Here h(n)={b0, b1, b2, } of the FIR filter are stable. Thus y(n) is bounded if input x(n) is
bounded. This means FIR system produces bounded output for every bounded input. Hence
FIR systems are always stable.
Symmetric and Anti-symmetric
FIR filters
n=0,1,2.M-1
Windowing Method
DFT method
W4 2
W4 4
W4 3
W4 6
W
4
[
W
1
1
1
j
1
-1
1
j
1
1
S. No
-1
j
1
-1
-1
-j
]
=
Linear Convolution
Circular Convolution
n=0
X3(n
)
8 Point
DFT
In Fourier series method, limits of summation index is - to . But filter must have
finite terms. Hence limit of summation index change to -Q to Q where Q is some finite
integer. But this type of truncation may result in poor convergence of the series. Abrupt
truncation of infinite series is equivalent to multiplying infinite series with rectangular
sequence. i.e at the point of discontinuity some oscillation may be observed in
resultant series.
This oscillation or ringing is generated because of side lobes in the frequency response
W() of the window function. This oscillatory behavior is called "Gibbs
Phenomenon".
Truncated response and ringing effect is as shown in fig 3.
WINDOWING TECHNIQUE
Windowing is the quickest method for designing an FIR filter. A windowing function
simply truncates the ideal impulse response to obtain a causal FIR approximation that is non
causal and infinitely long. Smoother window functions provide higher out-of band rejection
in the filter response. However this smoothness comes at the cost of wider stopband
transitions.
Various windowing method attempts to minimize the width of the main lobe (peak) of
the frequency response. In addition, it attempts to minimize the side lobes (ripple) of the
frequency response.
Rectangular Window: Rectangular This is the most basic of windowing methods. It does not
require any operations because its values are either 1 or 0. It creates an abrupt discontinuity that
results in sharp roll-offs but large ripples.
= 1
for 0 n N
= 0
otherwise
Kaiser Window: This windowing method is designed to generate a sharp central peak. It has
reduced side lobes and transition band is also narrow. Thus commonly used in FIR filter
design.
Hamming Window: This windowing method generates a moderately sharp central peak. Its
ability to generate a maximally flat response makes it convenient for speech processing
filtering.
Hanning Window: This windowing method generates a maximum flat filter design.
Filters can be designed from its pole zero plot. Following two constraints should be imposed
while designing the filters.
All poles should be placed inside the unit circle on order for the filter to be stable.
However zeros can be placed anywhere in the z plane. FIR filters are all zero filters
hence they are always stable. IIR filters are stable only when all poles of the filter are
inside unit circle.
All complex poles and zeros occur in complex conjugate pairs in order for the filter
coefficients to be real.
In the design of low pass filters, the poles should be placed near the unit circle at points
corresponding to low frequencies ( near =0)and zeros should be placed near or on unit
circle at points corresponding to high frequencies (near =). The opposite is true for high
pass filters.
NOTCH AND COMB FILTERS
A notch filter is a filter that contains one or more deep notches or ideally perfect nulls in its
frequency response characteristic. Notch filters are useful in many applications where
specific frequency components must be eliminated. Example Instrumentation and recording
systems required that the power-line frequency 60Hz and its harmonics be eliminated.
To create nulls in the frequency response of a filter at a frequency 0, simply introduce a pair
of complex-conjugate zeros on the unit circle at an angle 0.
comb filters are similar to notch filters in which the nulls occur periodically across the
frequency band similar with periodically spaced teeth. Frequency response characteristic of
notch filter |H()| is as shown in figure.
DIGITAL RESONATOR
A digital resonator is a special two pole bandpass filter with a pair of complex
conjugate poles located near the unit circle. The name resonator refers to the fact that the
filter has a larger magnitude response in the vicinity of the pole locations. Digital resonators
are useful in many applications, including simple bandpass filtering and speech generations.
IDEAL FILTERS ARE NOT PHYSICALLY REALIZABLE. Why?
Ideal filters are not physically realizable because Ideal filters are anti-causal and as only
causal systems are physically realizable.
Proof:
Let take example of ideal lowpass filter.
H() = 1 for - c c
= 0 elsewhere
The unit sample response of this ideal LPF can be obtained by taking IFT of H().
h(n)=
( )
(1)
h(n)=
1
(2)
c
1_
h(n) =
2
1
ejn
jn
-c
2jn
[ejcn - e-jcn ]
1_
[]c
2
-c
and
h(n) = c /
for n=0
sin (cn )
h(n) =
for n0
n
for n=0
Hence impulse response of an ideal LPF is as shown in Fig
LSI system is causal if its unit sample response satisfies following condition.
h(n) = 0
for n<0
In above figure h(n) extends - to . Hence h(n) 0 for n<0. This means causality
condition is not satisfied by the ideal low pass filter. Hence ideal low pass filter is non causal
and it is not physically realizable.
EXAMPLES OF SIMPLE DIGITAL FILTERS:
The following examples illustrate the essential features of digital filters. 1.UNITY GAIN
FILTER: yn = xn
Each output value yn is exactly the same as the corresponding input
value xn: 2.SIMPLE GAIN FILTER: yn = Kxn (K = constant)
Amplifier or attenuator) This simply applies a gain factor K to each
input value:
PURE DELAY FILTER: yn = xn-1
The output value at time t = nh is simply the input at time t = (n-1)h, i.e. the signal is
delayed by time h: 4.TWO-TERM DIFFERENCE FILTER: yn = xn - xn-1
The output value at t = nh is equal to the difference between the current input xn and the
previous inputxn-1:
5.TWO-TERM AVERAGE FILTER: yn = (xn + xn-1) / 2
The
output
is
the
average
(arithmetic
mean)
of
the
current
and
explicitxn-1 term in
A) Order = 1: a0 = 2, a1 = -1
(b) yn = xn-2
B) Order = 2: a0 = 0, a1 = 0, a2 = 1
C) Order = 3: a0 = 1, a1 = -2, a2 = 2, a3 = 1
CHAPTER 5
DIGITAL SIGNAL PROCESSOR
REQUIREMENTS OF DSP PROCESSORS
The most fundamental mathematical operation in DSP is sum of products also called as dot of
products.
Y(n)= h(0)*x(n) + h(1)*x(n-1) ++ h(N-1)*x(n-N)
This operation is mostly used in digital filter designing, DFT, FFT and many other DSP
applications. A DSP is optimized to perform repetitive mathematical operations such as the
dot product. There are five basic requirements of s DSP processor to optimize the
performance They are
Fast arithmetic
Extended precision
Fast operations
Circular buffering
S. No
Requirements
Fast Arithmetic
Extended precision
Fast Execution
Fast Operations
Program and data memories are on chip memory and extendable offchip
No multiplexing is used. Separate address, data and control bus.
Powerful instruction set and various addressing modes.
Circular shift operations
Circular Buffers
MICROPROCESSOR ARCHITECTURES
There are mainly three types of microprocessor architectures present.
Von-Neumann architecture
Harvard architecture
Von-Neumann Architecture
General purpose microprocessors uses the Von-Neumann Architectures. (named after the
American mathematician John Von Neumann)
It consists of ALU, accumulator, IO devices and common address and data bus. It also
consists of a single memory which contains data and instructions, a single bus for
transferring data and instructions into and out of the CPU.
Multiplying two numbers requires at leased three cycles, two cycles are required to
transfer the two numbers into the CPU and one cycle to transfer the instruction.
This architecture is giving good performance when all the required tasks can be
executed serially. 4.For large processing applications like DSP applications VonNeumann architecture is not suitable as processing speed is less. Processing speed can
be increased by pipelining up to certain extend which is not sufficient for DSP
applications. In order to perform a single FIR filter multiply-accumulate, an instruction
is fetched from the program memory, and during the same cycle, a coefficient can be
fetched from the data memory. A second cycle is required to fetch the data word from
data memory
A: VON NEUMANN
HARVARD B:
ADI MODIFIED
C:HARVARD
(DMA)
Program
memory
data(PMD)
Data memory data (DMD) and Result (R)
SCE
Three Computational Units are
Arithmetic logic
unit
100
(ALU)
Multiplyaccumulate
(MAC) Shifter
Instruction
1
_ Register Cache
Program
2
Memory Sequencer
R BUS
BUSES:
The ADSP-21xx processors have five internal buses to ensure data transfer.
PMA and DMA buses are used internally for addresses associated
with Program and data memory. The PMD and DMD are used for
data associated with memory spaces. Off Chip, the buses are
multiplexed into a single external address bus and a single external
data bus. The address spaces are selected by the appropriate
control signal.
The result (R) bus transfers the intermediate results directly between
code and data. PMD bus is 24 bits wide to accommodate the 24 bit
instruction width.
The DMA bus 14 bits wide allowing direct access of up to 16k words of
data.The DMD bus is 16 bit wide.
The DMD bus provides a path for the contents of any register in the
COMPUTATIONAL UNITS:
The processor contains three -independent computational units. ALU, MAC (Multiplieraccumulator) and the barrel shifter. The computational units process 16- bit data directly. ALU is
16 bits wide with two 16 bit input ports and one output port. The ALU provides a standard set of
arithmetic and logic functions.
ALU Features
Add, subtract, Negate, increment, decrement, Absolute value, AND,
etc.
ensure that no loss of data occurs. 256 overflows would have to occur before any data is lost. A set of
background registers is also available in the MAC for interrupts service routine.
SHIFTER:
The shifter performs a complete set of shifting functions like logical and arithmetic shifts
(circular or linear shift) , normalization (fixed point to floating point conversion),
demoralization (floating point to fixed point conversion) etc
ALU, MAC and shifter are connected to DMD bus on one side and to R bus on other side.
All three sections contains input and output registers which are accessible from the internal
DMD bus. Computational operations generally take the operands from input registers and
load the result into an output register.
DATA ADDRESS GENERATORS (DAG):
Two DAG's and a powerful program sequencer ensure efficient use of these computational
units. The two DAG's provides memory addresses when memory data is transferred to or
from the input or output registers. Each DAG keeps track of up to four address pointers.
Hence jumps, branching types of instructions are implemented within one cycle. With two
independent DAG's, the processor can generate two address simultaneously for dual
operand fetches.
DAG1 can supply addresses to data memory only. DAG2 can supply addresses to either data
memory or program memory. When the appropriate mode bit is set in mode status register
(MSTAT), the output address of DAG1 is bit-reversed before being driven onto the address
bus. This feature facilitates addressing in radix-2 FFT algorithm.
PROGRAM SEQUENCER:
The program sequencer exchanges data with DMD bus. It can also take from PMD
bus. It supplies instruction address to program memory. The sequencer is driven by the
instruction register which holds the currently executing instruction. The instruction register
introduces a single level of pipelining into the program flow. Instructions are fetched and
loaded into the instruction register during one processor cycle, and executed during the
following cycle while the next instruction is pre-fetched. The cache memory stores up to 16
previously executed instructions. Thus data memory on PMD bus is more efficient because
of cache memory. This also makes pipelining and increase the speed of operations.
On chip program and data memories which can be extended off chip.
CODE_AREA
.SEG/RAM/ABS=0X4000/PM/DATA
DATA_AREA
COMMON MEMORY
.SEG/RAM/ABS=0X800/DM/DATA
PRIVATE MEMORY
.PORT/RAM/ABS=0x100
DATA
MEMORY IO PORT
.PORT/RAM/ABS=0x200
AD PORT
.PORT/RAM/ABS=0x300
DA PORT
.ENDSYS
The sample system configuration file (.SYS) is shown. .SEG directive is used to declare the
system's physical memory segments and its characteristics. .PORT directive declares the
memory mapped IO port. .ENDSYS indicates the end of .SYS file.
ASSEMBLER
The assembler translated source code into object code modules. The source code is written in
assembly language file (.DSP) Assembler reads .DSP file and generates four
output filed with the same root name. Object file(.OBJ), Code File(.CDE), Initialization
File (.INT), List File(.LST) etc. The file can be assembled by the following command.
ASM21FILTER
S.No
File Extension
.OBJ
Application
Binary codes for instruction, Memory allocation
and
symbol
declaration,
Addresses
of
the
instructions
2
.CDE
Instruction opcodes
.INT
Initialization information
.LST
Documentation
LINKER
The linker is a program used to join together object files into one large object file.
The linker produces a link file which contains the binary codes for all the combined
modules. The linker uses .INT, .CDE, .OBJ and .ACH file and
generates three files. Map listing file (.MAP), Memory Image File
(.EXE) and Symbol table (.SYM).
LD21 FILTER -a SAMPLE -e FILTER
Here Filter is the input file name, sample.ACH file is system architecture file name and
FILTER.EXE is output file name.
DEBUGGER
A debugger is a program which allows user to load object code program into system memory,
execute the program and debug it. The debugger allows the user to look at the contents of
registers and memory locations etc. We can change the contents of registers and memory
locations at run time, generates breakpoints etc.
SIMULATOR
The multiprogramming environment can be tested using the simulator. When simulated, the
filter program produces output data and stores in common data memory. Simulator
command is used to dump form data memory to store the dual port data memory image on
disk which can be reloaded and tested.
APPLICATIONS OF DSP
1. SPEECH RECOGNITION
Basic block diagram of a speech recognition system is shown in Fig 1
In speech recognition system using microphone one can input speech or voice. The
analog speech signal is converted to digital speech signal by speech digitizer. Such
digital signal is called digitized speech.
The digitized speech is processed by DSP system. The significant features of speech such
as its formats, energy, linear prediction coefficients are extracted.The template of this
extracted features are compared with the standard reference templates.The closed
matched template is considered as the recognized word.
Voice operated consumer products like TV, VCR, Radio, lights, fans
Voiced
Synthetic speech
Unvoiced
Digital
_
filter
Synthetic speech
Filter Coefficients
3. SOUND PROCESSING
In sound processing application, Music compression(MP3) is
effects are also done by DSP processor. ADC and DAC are used in
signal generation and recording. 4. ECHO CANCELLATION
In the telephone network, the subscribers are connected to telephone
exchange by two wire circuit. The exchanges are connected by four
wire circuit. The two wire circuit is bidirectional and carries signal in
both the directions. The four wire circuit has separate paths for
transmission and reception. The hybrid coil at the exchange provides
the interface between two wire and four wire circuit which also
provides impedance matching between two wire and four wire circuits.
Hence there are no echo or reflections on the lines. But this impedance
matching is not perfect because it is length dependent. Hence for echo
cancellation, DSP techniques are used as follows.
Input Reg
ALU
Output Reg
Input Regs
MAC
Output Reg
I*put Reg
Shifter
Output Reg
. The
adaptive filter will try to identify the equivalent filter seen by the
system from the loudspeaker to the microphone, which is the
transfer function of the room
the loudpeaker and microphone are in.
This transfer function will depend heavily on the physical
There are one sided(right and left sequences) and two sided
sequences are present in the Z Transform pair.
It cosists of two duration they are
Finite duration
Infinite duration
S,
Sasikala.
,Digital
Signal
Vijay Nicole/TMH,2013.
Dimitris
Digital
G.Manolakis,
Vinay
K.
Ingle,
applied
Signal Processing,Cambridge,2012
GLOSSARY TERMS:
DDC:
in
Input
Devices
and
Hilbert
filtersareimplementedwithFIRfilters.
Address: The logical location of program code or data stored in
memory. Addressing mode: The method by which an instruction
interprets its operands to acquire the data it needs.
Address stage: The second stage of the parallel processors fetch,
address, execute (FAE) pipeline during which addresses are calculated
and supplied to the crossbar. (TMS320C8x)
Address unit: Hardware on the parallel processor that computes a bit
address during each cycle. Each parallel processor has two address
units: a global address unit and a local address unit. (TMS320C8x)
Address unit arithmetic: The parallel processors use of the local and
global address units to perform general-purpose arithmetics in parallel
with the data unit. The computed address is not used for memory
access, but is stored in the destination register. (TMS320C8x)
Address visibility (AVIS) bit: A bit field that allows the internal
program address to appear at the external address pins. This enables the
internal program address to be traced and the interrupt vector to be
decoded in conjunction with the interrupt
acknowledge (IACK) signal when the interrupt vectors reside in onchip memory. At reset, AVIS = 0. (TMS320C5x, TMS320C54x,
TMS320C2xx)
Administrative privileges: Authority to set software and hardware
access; includes access and privileges to install, manage, and maintain
system and application software and directories on a network server or
individual computer systems.
ADTR: Asynchronous data transmit and receive register. See also
receive (ADTR) register.
AFB: See auxiliary register file bus.
Aggregate type: A C data type, such as a structure or an array, in which
a variable is composed of multiple other variables, called members.
AIC: See analog interface circuit.
A-Law companding: See companded.
Alias disambiguation: A technique that determines when two pointer
expressions cannot point to the same location, allowing the compiler to
freely optimize such expressions. (TMS320C6200)
Aliasing: 1) A method of customizing debugger commands; aliasing
provides a shorthand method for entering often-used command strings.
2) A method of accessing a single data object in more than one way, as
when a pointer points to a named object. The optimizer has logic to
detect aliasing, but aliasing can cause problems for the optimizer. 3)
Aliasing occurs when a single object can be accessed in more than one
way, such as when two pointers point to a single object. It can disrupt
optimization, because any indirect reference could refer to any other
object. Alignment: A process in which the linker places an output
section at an address that falls on an n-byte boundary, where n is a
power of 2. You can specify alignment with the SECTIONS linker
directive.
the
operation
class,
and
any
function
modifiers).
(A/D):
Conversion
of
continuously
variable
Define Signal.
A Signal is defined as any physical quantity that varies with time,
space or any other independent variables.
Define a system.
A System is a physical device (i.e., hardware) or algorithm (i.e.,
software) that performs an operation on the signal.
What are the steps involved in digital signal processing?
Converting the analog signal to digital signal, this is performed by
A/D converter Processing Digital signal by digital system.
Converting the digital signal to analog signal, this is performed by D/A converter.
Give some applications of DSP?
Speech processing Speech compression & decompression
for voice storage system
Communication Elimination of noise by filtering and echo cancellation.
Bio-Medical Spectrum analysis of ECG,EEG etc.
Write the classifications of DT Signals.
Energy & Power signals
Periodic & Aperiodic signals
Even & Odd signals.
What is an Energy and Power signal?
Energy signal: A finite energy signal is periodic sequence, which
has a finite energy but zero
average power.Power signal:
An Infinite energy signal with finite average power is called a
power signal.
What is Discrete Time Systems?
The function of discrete time systems is to process a given input
sequence to generate output sequence. In practical discrete time
systems, all signals are digital signals, and operations on such signals
also lead to digital signals. Such discrete time systems are called
digital filter.
Write the Various classifications of Discrete-Time systems.
Linear & Non linear system
Causal & Non Causal system
Stable & Un stable system
Static & Dynamic systems
What is DFT?
It is a finite duration discrete frequency sequence, which is obtained
by sampling one period of Fourier transform. Sampling is done at N
equally spaced points over the period extending from w=0 to 2.
Define N point DFT.
The DFT of discrete sequence x(n) is denoted by X(K). It is given
by, Here k=0,1,2N-1 Since this summation is taken for N points,
it is called as N-point DFT.
What is DFT of unit impulse (n)?
The DFT of unit impulse (n) is unity.
List the properties of DFT.
Linearity, Periodicity, Circular symmetry, symmetry, Time shift,
Frequency shift, complex conjugate, convolution, correlation and
Parsevals theorem.
State Linearity property of DFT.
DFT of linear combination of two or more signals is equal to the
sum of linear combination of DFT of individual signal.
When a sequence is called circularly even?
The N point discrete time sequence is circularly even if it is
symmetric about the point zero on the circle.
What is the condition of a sequence to be circularly odd?
An N point sequence is called circularly odd it if is antisymmetric
about point zero on the circle.
What is the speed of improvement factor in calculating 64point DFT of a sequence using direct computation and
computation and FFT algorithms? Or Calculate the number
of multiplications needed in the calculation of DFT and FFT
with 64-point sequence.
The number of complex multiplications required using direct
computation is N2=642=4096. The number of complex
multiplications required using FFT is N/2 log2N = 64/2log264=192.
Speed improvement factor = 4096/192=21.33
What is the main advantage of FFT?
FFT reduces the computation time required to compute discrete Fourier transform.
Calculate the number of multiplications needed in the
calculation of DFT using FFT algorithm with using FFT
algorithm with 32-point sequence.
For N-point DFT the number of complex multiplications needed
using FFT algorithm is N/2 log2N. For N=32, the number of the
complex multiplications is equal to 32/2log232=16*5=80.
What is FFT?
The fast Fourier transforms (FFT) is an algorithm used to compute the
DFT. It makes use of the Symmetry and periodically properties of
twiddles factor WKN to effectively reduce the DFT computation time.
It is based on the fundamental principle of decomposing the
computation of the DFT of a sequence of length N into successively
smaller discrete Fourier transforms. The FFT algorithm provides
speed-increase factors, when compared with direct computation of the
DFT, of approximately 64 and 205 for 256-point and 1024-point
transforms, respectively.
How many multiplications and additions are required to
compute N-point DFT using redix-2 FFT?
The number of multiplications and additions required to compute
N-point DFT using redix-2 FFT are N log2N and N/2 log2N
respectively.
What is meant by radix-2 FFT?
The FFT algorithm is most efficient in calculating N-point DFT. If the number of output points N
can be expressed as a power of 2, that is, N=2M, where M is an integer, Then this algorithm is
known as radix-s FFT algorithm.
What is a decimation-in-time algorithm?
Decimation-in-time algorithm is used to calculate the DFT of a N-point
Sequence. The idea is to break the N-point sequence into two
sequences, the DFTs of which can be combined to give the DFT of the
original N-point sequence. Initially the N- point sequence is divided
into two N/2-point sequences xe(n) and x0(n), which have the even and
odd members of x(n) respectively. The N/2 point DFTs of these two
sequences are evaluated and combined to give the N point DFT.
Similarly the N/2 point DFTs can be expressed as a combination of N/4
point DFTs. This process is continued till we left with 2-point DFT.
This algorithm is called Decimation-in-time because the sequence x(n)
is often splitted into smaller sub sequences.
What are the differences and similarities between
DIF and DIT algorithms?
Differences:
For DIT, the input is bit reversal while the output is in natural order,
whereas for DIF, the input is in natural order while the output is
bit reversed.
The DIF butterfly is slightly different from the DIT butterfly, the
difference being that the complex multiplication takes place after
the add-subtract operation in DIF. Similarities: Both algorithms
require same number of operations to compute the DFT. Bot
algorithms can be done in place and both need to perform bit
reversal at some place during the computation.
24. What are the applications of FFT algorithms?
Linear filtering
Correlation
Spectrum analysis
What is a decimation-in-frequency algorithm?
In this the output sequence X (K) is divided into two N/2 point
sequences and each N/2 point sequences are in turn divided into two
N/4 point sequences.
Distinguish between DFT and DTFT.
S.No
DFT
DTFT
1.
Obtained by performing
Sampling is performed only
sampling operation in both
in time domain
the time and frequency
domains.
2.
Discrete frequency spectrum
Continuous function of
3.
4.
It consists of adders,
multipliers and delays
implemented in digital logic.
In digital filters the filter
coefficients are designed to
satisfy the desired frequency
response.
It consists of electrical
components like resistors,
capacitors and inductors.
In digital filters the
approximation problem is
solved to satisfy the desired
frequency response.
4.
5.
A large number of
parameters has to be
calculated to determine the
transfer function
Hanning Window
i)The width of mainlobe in
window spectrum is 8/N
ii) The maximum sidelobe
magnitude in window spectrum
is 31dB.
iii) In window spectrum the
sidelobe magnitude decreases
with increasing w.
iv) In FIR filter designed using
hanning window the minimum
stopband attenuation is 44dB.
Hamming Window
i)The width of mainlobe in
window spectrum is 8/N
ii) The maximum sidelobe
magnitude in window
spectrum is 41dB.
iii) In window spectrum
the sidelobe magnitude
remains constant.
iv) In FIR filter designed
using hamming window
the minimum stopband
attenuation is 44dB.
Kaiser Window
i) The width of main lobe in
window spectrum depends on
the values of & N.
ii) The maximum side lobe
magnitude with respect to peak
of main lobe is variable using
the parameter .
iii) In window spectrum the side
lobe magnitude decreases with
increasing w.
iv) In FIR filter designed using
Kaiser window the minimum
stop band attenuation is variable
and depends on the value of .
pipelined. Assume a 5ns pipeline overhead in each stage and ignore other delays. The average
instruction time is = 30 ns+45 ns + 25 ns = 100 ns Each instruction has been completed in three
cycles = 45 ns * 3 = 135ns Throughput of the machine = The average instruction time/Number of
M/C per instruction = 100/135 = 0.7407 But in the case of pipeline machine, the clock speed is
determined by the speed of the slowest stage plus overheads. In our case is = 45 ns + 5 ns =50 ns
The respective throughput is = 100/50 = 2.00 The amount of speed up the operation is = 135/50
= 2.7 times
9. Assume a memory access time of 150 ns, multiplication time of
100 ns, addition time of 100 ns and overhead of 10 ns at each pipe
stage. Determine the throughput of MAC After getting successive
addition and multiplications The total time delay is 150 + 100 + 100 + 5
= 355 ns System throughput is = 1/355 ns. 10.Write down the name of
the addressing modes. Direct addressing. Indirect addressing. Bitreversed addressing
Immediate addressing.
Short immediate addressing.
Long
immediate
addressing.
Circular
addressing.
11.What are the instructions used for block transfer in C5X
Processors? The BLDD, BLDP and BLPD instructions use the BMAR
to point at the source or destination space of a block move. The MADD
and MADS also use the BMAR to address an operand in program
memory for a multiply accumulator operation 12.Briefly explain
about the dedicated register addressing modes. The dedicatedregistered addressing mode operates like the long immediate
addressing modes, except that the address comes from one of two
special-purpose memory- mapped registers in the CPU: the block move
address register (BMAR) and the dynamic bit manipulation register
(DBMR). The advantage of this addressing mode is that the address of
the block of memory to be acted upon can be changed during execution
of the program.
Briefly explain about bit-reversed addressing mode?
In the bit-reversed addressing mode, INDX specifies one-half the size
of the FFT. The value contained in the current AR must be equal to 2n1, where n is an integer, and the FFT size is 2n. An auxiliary register
points to the physical location of a data value. When we add INDX t the
current AR using bit reversed addressing, addresses are generated in a
bit-reversed fashion. Assume that the auxiliary registers are eight bits
long, that AR2 represents the base address of the data in memory (0110
00002), and that INDX contains the value 0000 10002.
Briefly explain about circular addressing mode.
Many algorithms such as convolution, correlation, and finite
impulse response (FIR) filters can use circular buffers in memory to
Clock generator
Hardware timer
Software programmable wait state generators
General
purpose
I/O pins
aa. Parallel
I/O ports
bb. Serial
port
interface
cc.
Buffered
serial port
dd. Time-division multiplexed
(TDM) serial port ee. Host port
interface
ff. User unmask able interrupts
What are the arithmetic instructions of C5x?
ADD, ADDB, ADDC, SUB, SUBB, MPY, MPYU
40. What are the shift
instructions? ROR,
ROL, ROLB, RORB,
BSAR.
What are the general purpose I/O pins?
Branch control input (BIO)
External flag (XF)
What are the logical instructions of C5x?
AND, ANDB, OR, ORB, XOR, XORB
What are load/store instructions?
LACB, LACC, LACL, LAMM, LAR, SACB, SACH, SACL, SAR, SAMM.
Mention the addressing modes available in TMS320C5X processor?
Direct addressing mode
Indirect addressing mode
Circular addressing mode
Immediate addressing
Register addressing
Memory mapped register addressing
Give the features of DSPs?
Architectural features
Execution speed
Type of arithmetic
Word length
What is function of NOP instruction?
NOP- No operation
Perform no operation.
What is function of ZAC instruction?
ZAC Zero accumulator
Clear the contents of accumulator to zero.
Give the function of BIT instruction.
BIT Test bit Copy the specified bit of the data memory value to the TC bit in ST1.
49. Mention the function of
B instruction. B Branch
conditionally.
Branch to the specified program memory address. Modify the current
AR and ARP as specified.
What is use of ADD instruction?
ADD Add to accumulator with shift.
Add the content of addressed data memory location or an immediate
value of accumulator, if a shift is specified, left-shift the data before the
add. During shifting, low order bits are Zero-filled, and high-order bits
are sign extended if SXM=1.
Give the advantages of DSPs?
Architectural features, Execution speed, Type of arithmetic, Word length.
Give the applications of DSP Processors?
Digital cell phones, automated inspection, voicemail, motor control,
video conferencing, noise cancellation, medical imaging, speech
synthesis, satellite communication etc.
IMPORTANT QUESTIONS
UNIT I INTRODUCTION
PART A
What is signal and Signal processing?
List the advantages of Digital Signal processing.
Mention few applications of Digital Signal processing.
Classify discrete time signals.
What are Energy and Power signals?
What do you mean by periodic and Aperiodic signals?
When a signal is said to be symmetric and Anti symmetric?
What are deterministic and random signals?
What are the elementary signals?
What are the different types of representation of discrete time signals?
Draw the basic block diagram of digital signal processing of analog signals.
What are the basic time domain operations of discrete time signal?
What is the significance of unit sample response of a system?
Classify discrete time systems.
Whether the system defined by the impulse response h(n) = 2n u(-n)
+ 2-n u(n) is causal ?
Justify your answer.
Compute the energy of the signal x(n) = 2-n u(n)
tabulation method.
Check whether the system defined by h (n) = [5 (1/2)n + 4 (1/3)n ] u(n) is stable.
Differentiate between analog, discrete, quantized and digital signals.
Differentiate between analog
and digital signals.
Differentiate between one dimensional and two dimensional signal
with an example for
each.
Name any four elementary time domain operations for discrete time signals.
For the signal f (t) = 5 cos (5000t) + sin2 (3000t), determine the
minimum sampling rate
for recovery without aliasing.
1 = 5000 = 2F1 2 =
3000 = 2F2 F1 = 2.5
kHz F2=1.5 kHz
Fmax = 2.5 kHz
According to sampling theorem
Fs 2 Fmax So, Fs = 5 kHz
For the signal f (t) = cos2 (4000t) + 2 sin (6000t), determine the
minimum sampling rate
for recovery without aliasing.
1 = 4000 = 2F1 2 =
6000 = 2F2 F1 = 2 kHz
F2 =3 kHz
Fmax = 3 kHz
According to sampling theorem
Fs 2 Fmax So, Fs = 6 kHz
What is sampling?
State sampling theorem and what is Nyquist frequency?
Sampling theorem - Fs 2 Fmax ,Nyquist frequency or Nyquist rate FN = 2 Fmax
What is known as aliasing?
Define the criteria to perform sampling process without aliasing.
Differentiate between anti aliasing and anti imaging filters.
What are the effects of aliasing?
What is anti aliasing filter? What is the need for it?
Draw the basic block diagram of a digital processing of an analog signal.
Determine the response of the system to the input signal x (n) = {1, 2, 3, 1}.
Design a high pass filter of length 7 samples with cut off frequency
of 2 rad / sec using Hamming window. Plot its magnitude and phase
response. (16)
For the constraints
0.8 H() 1.0 ,
0 0.2
H() 0.2, 0.6
(a) (i) Check whether the following is linear, time invariant, casual and stable
y(n ) = x(n ) + nx (n + 1) .
(8)
(ii) Check whether the following are energy or power signals
= (1 )
()
2
(8)
Or
=
11.5
+0.5
(6)
(5)
(3)
(a) (i) Realize the following using cascade and parallel form .
3+3.6
+0.6
(12)
1+0.1
0.2
Assume N = 7 . (12)
PART B (5 16 = 80 marks)
(a) (i) What you mean by Nyquist rate? Give its significance. (6)
(ii) Explain the classifications of the discrete signals.
(10)
Or
(b) (i) Explain in detail the quantization of digitals signals.
(8)
(ii) Describe the different types of sampling methods can be used.(8)
(a) (i) Explain the properties of Z transform. (8)
(ii) Find the impulse response given by Differential equations.
Or
(b) The specifications of defined low pass filter is : Using
Hanning window, design a filter with
0.8
1.0 ; 0 0.2
0.2; ; 0.32
Design Chebyshevs digital filter using bilinear transformations.(16)
(a) (i) Explain in detail the Von Neumann architecture with a neat diagram.(8)
(ii) What is MAC unit? Explain its functions?(8)
Or
(b) Explain in detail the architectural of TMS320C50 with a neat diagram. (16)
Question Paper Code: 21368
B.E./B.Tech. DEGREE EXAMINATION,MAY/JUN 2013
Fifth Semester
Electrical and Electronics
Engineering
EC 2361/EC2314/EE502 DIGITAL SIGNAL PROCESSING
(Regulation 2008)
Time : Three hours
Maximum : 100 marks Answer ALL questions
PART A (10 2 = 20 marks)
= 2 cos 500 . what is the
nyquist rate and fundamental frequency of the signal?
Determine
=
whether a power signal or an energy signal?
Give the difference equation
=
+3 1+2 1.
determine the system function H(Z).
Find the stability of the system whose impulse response
= (1)
(2) 2
= 3(0.5) ( ).
Or
(b) Starting from first priniciples, state and explain the sampling
theorem both in time domain and frequency domain
(16)
(a) (i) Find the Z transform and its ROC for the following discrete time signal
= (1/5)
+ 5(1/2) 1 .
(8)
Evaluate the frequency response of the system described by system function
=(
10.5
).
(8)
Or
(b) Using the Z transform determine the response y(n) for n 0 if
=1
1 n
y n 1 + x n ,x n = 2 3
u n ; y 1 = 1
(16)
(a) Find the output y(n) of a filter whose impulse response
= 1,1,1 and
the input signal
= 3, 1,0,1,3,2,0,1,2,1 using overlap save method.
(16)
Or
(b) Find the DFT of a sequence
=
1,2,3,4,4,3,2,1, using DIT algorithm. (16)
(i) Consider the causal linear time shift in variant filter with system function
1
1+0.875
1+0.2
+0.9
(10.75
<
(8)
Find the overall impulse response of the system.
PART B (5 16 = 80 marks)
(a) Check the following systems are linear, causal, time in variant,
stable, static. (i)
y(n) = x(1/2n)
y(n) = sin(x(n))
y(n) = x(n)cos(x(n))
y(n) = x(-n+5)
(v) y(n) = x(n) + nx(n+2)
(16)
Or
Compute linear and circular convolution of the two
sequence x1(n) = 1,2,2,2 and x2(n) =
1,2,3,4
(16)
(a) (i) Determine the system function and the unit sample
response of the system described by the difference equation
y(n) +1/2y(n-1)=2x(n).
(8)
(ii) Determine the step response of the system y(n)- ( 1)+x(n), -1< <
1,when the initial condition is y(-1) = 1.
(8)
Or
An filter system is described by the difference equation y(n) = x(n0+x(n10).
Compute and sketch its magnitude phase response
).
10
(16)
3
10
(a) (i) Derive the computational equation for the 8-point FFT DIT. (8)
(ii) State and prove any five properties of DFT. (8)
Or
(b) Find the X(K) for given sequence
= 1,2,3,4,1,2,3,4 .
(16)
/4
0
Hamming window with N = 11.
.
/4
.Using
(b)(i) Explain the functional modes present in the DSP processor. (8)
(ii) Explain about pipelining in DSP. (8)
PART B (5 16 = 80 marks)
(a) (i) Discuss whether the following are energy or power signals
N
3
(1)
x(n )=
u(n )
2
(2) x(n) = Ae
jw
( 10)
(b)
Check whether following are linear, time invariant, causal and stable.
(6)
(i)
(8)
(ii)
(8)
(6)
1
y(n ) +
(10)
Or
(b)
(i) Obtain the discrete Fourier series coefficients of x(n) = COS w0n .(4)
| z| 2
(2)
| z| 2
1 + 3z
X (z )= 1 + 3z
+ 2z
(12)
13. (a)
(i)
(10)
(6)
Or
jw
jw
) 1 0 W 0.2
) 0.2 0.6 w
(6)
Or
(b)
jw
)=e
j3w
for
EE6403
for
w 3
|w|
4
EE6403
PROCESSING