Discrete-Time Signal Processing
Discrete-Time Signal Processing
Discrete-Time Signal Processing
1
What is Signal
Example
• Speech signal, Electrocardiogram (ECG),
Electroencephalogram (EEG), a photographic image etc.
2
Continuous-time signal:
3
Discrete-time signal:
• Defined only at certain specific values of time
Amplitude is not discrete
Fig: sequence of samples obtained from the continuous time speech signal
4
Discrete-time signal: sequences
5
Sampling of an analog signal:
For uniform sampling x(n) = xa (nT )
Here,
T = sampling period
Fs = samplig frequency (hertz) or sampling rate (samples per second)
1
T=
Fs
n
t = nT =
Fs
Let , Analog signal with frequency F or
xa (t ) = A cos(2 Ft + ) angular frequency = 2 F
xa (nT ) = A cos(2 FnT + )
F
= A cos 2 n +
Fs
F
x(n) = A cos ( 2 fn + ) , where f = = relative or normalized frequency
Fs
or =2 f = relative angular frequency 6
Sampling of an analog signal:
7
Example 1.4.2
8
Example 1.4.2
Solution:
100
x(n) = 3cos( n) = 3cos( n)
200 2
9
c) If sampling rate is 75 Hz, then the discrete time sequence is
100 4
x(n) = 3cos n = 3cos n
75 3
2 2
= 3cos 2 − n = 3cos n
3 3
d) The sampling rate in part c) is 75 Hz, and the normalized frequency of the
discrete time sequence is 1/3.
Since
F 1 F
f = = F = 25 Hz
Fs 3 75
So the frequency of the continuous time sinusoid which will yield exact same
samples as in part c) is 25 Hz.
10
Some elementary discrete-time signals
(basic sequences)
1. Unit sample sequence/ unit impulse:
(n) = 0, n0
1, n=0
11
2. Unit step signal:
12
3. Unit ramp signal:
13
4. Exponential signal:
14
4. Exponential signal (complex):
a re j x[n] = r n e jn
=r n (cos n + j sin n)
=r n cos n + jr n sin n
Sinusoidal sequences
5. Sinusoidal sequences:
General form:
Frequency in 0 = 2 f Frequency in
cycles/sample
radian/sample
15
Difference between continuous-time and discrete-time complex exponential sequences and
sinusoidal sequences:
Definition of periodicity,
x[n] is periodic with period N ( N 0) if and only if
x(n+N)=x(n), for all n
16
This is possible if
cos(0 n + ) = cos{(0 + 2 k )n + )
17
3. The highest rate of oscillation in a discrete-time sinusoid is attained when = or -
x(n) = cos 0 n
( f = 1 , N = 4)
4
( f = 0, N = )
( f = 1 , N = 2)
( f = 1 , N = 16) 2
16
0 (0 → ), f (0 → 1 2), N ( → 2)
( f = 1 , N = 8)
8
18
0 2 There is an alias of the sinusoid having
frequency in the range 0 →
19
0 2 There is an alias of the sinusoid having
frequency in the range 0 →
The frequency range for discrete- time sinusoids is finite with duration 2
20
Simple manipulations of discrete-time signals
Transformation of the independent variable (time)
1. Time-shift of x(n)
TDk [ x(n)] = x(n − k ), k integer.
k +ve delaying x(n) by k units of time (shift of signal to the right)
k -ve advancing x(n) by k units of time (shift of signal to the left)
delay
advance
22
3. Down sampling of x(n) DS {x(n)} = x( n), an integer
23
Transformation of the dependent variable (amplitudes)
Addition, multiplication and scaling of sequences
24
Discrete-time systems
A device or algorithm that operates on a discrete-time signal (input) according to
some well-defined rules and transforms the input to produce a discrete time signal
output.
operator
25
Discrete-time systems
Input-Output description of systems
b) y(n) = x(n − 1)
= { ,0,3, 2,1,0,1, 2,3,0, }
c) y(n) = x(n + 1)
= { ,0,3, 2,1,0,1, 2,3,0, }
27
Input signal x(n) = { , 0,3, 2,1, 0,1, 2,3, 0, }
1
d ) y (n) = [ x(n + 1) + x(n) + x( n − 1)]
3
5 2 5
== { , 0,1, , 2,1, ,1, 2, ,1, 0, }
3 3 3
28
Input signal x(n) = { , 0,3, 2,1, 0,1, 2,3, 0, }
n
f) y ( n) = x(k ) = x(n) + x(n − 1) + x(n − 2) +
k =−
={0,3,5, 6, 6, 7,9,12,12, }
Accumulator system
(accumulation of all the previous inputs)
n n −1
y ( n) = x(k ) = x(k ) + x(n) = y(n − 1) + x(n)
k =− k =−
In relaxed
Initial condition system 0 29
Block diagram representation of discrete-time systems
An adder:
A constant multiplier:
30
A signal multiplier:
31
Using basic building blocks sketch the block diagram representation
of the discrete-time system described by the input-output relation.
1 1 1
y (n) = y (n − 1) + x(n) + x(n − 1),
4 2 2
where x(n) is the input and y( n) is the output.
32
Using basic building blocks sketch the block diagram representation
of the discrete-time system described by the input-output relation.
1 1 1
y (n) = y (n − 1) + x(n) + x(n − 1),
4 2 2
where x(n) is the input and y( n) is the output.
33
Classification of discrete-time systems
y (n) = ax(n)
y (n) = nx(n) + bx 3 (n)
Dynamic system:
Output depends on the present and/or past values of the input
x(n) ⎯⎯ → y ( n)
x(n − k ) ⎯⎯ → y (n − k )
for every input signal x(n) and every time shift k .
1) For any arbitrary input x( n) get the output y (n)from sys i/p o/p description
2) Change the input to x( n − k ) and get the output y (n, k )
3) Delay the output by k → y ( n − k )
if y (n, k ) = y (n − k ) TI system
35
Linear versus non-linear system:
If in a system,
for i/o= 0, we get o/p=0 Relaxed linear system
Theorem:
37
Interconnection of discrete-time systems
Here,
In general,
38
2. Parallel connection
Here,
39
Analysis of discrete-time LTI systems
Techniques:
1. Based on direct solution of system’s i/p-o/p equation.
N M
y (n) = − ak y (n − k ) + bk x(n − k ) [for LTI system]
k =1 k =0
→ difference equation
2. Based on resolving i/p into the sum of elementary signals and
obtaining the system’s response for each of the elementary signals.
Steps:
a) resolve i/p x(n) as c x (n), x
k
k k k elementary signal
41
Resolution of a discrete time signal into impulses
elementary signal xk (n) = (n − k )
x(n) (n − k ) = x(k ) (n − k )
42
Finally, x ( n) = x(k ) (n − k )
k =−
Convolution sum
y (0) = v (k )
k =−
0
=4
45
y(1) = v (k ) = 8
k =−
1
y(−1) = v
k =−
−1 (k ) = 1
46
From observation,
y ( n) = 0 for n −2
the entire response of the system for − n
y ( n) = x ( k ) h( n − k ) = h( k ) x ( n − k )
k =− k =−
47
Properties of convolution and the interconnection of LTI systems
y (n) = x(n)* h(n) = x ( k ) h( n − k )
k =−
Impulse response is shifted & folded
y (n) = h(n)* x(n) = h( k ) x ( n − k )
k =−
Input is shifted & folded
48
Convolution follows
Commutative law:
x(n)* h(n) = h(n)* x(n)
(The order to perform convolution is immaterial)
Associative law:
[ x(n) * h1 ( n)]* h2 ( n) = x( n) *[ h1 ( n) * h2 ( n)] = x( n) * h( n),
where, h(n) = h1 (n) * h2 ( n) = h2 ( n) * h1 ( n)
(viewed in cascade connection)
49
Distributive law:
50
Condition of Causality of LTI systems:
Depends on
o/p Past and/or present value of the i/p
For LTI sys.
o/p at n = n0
y (n0 ) = h( k ) x ( n
k =−
0 − k)
−1
= h( k ) x( n0 − k ) + h( k ) x ( n
0 − k)
k =0 k =−
52
Condition of Stability of LTI systems:
For LTI sys.
y ( n) = h( k ) x ( n − k )
k =−
k =−
h( k ) x ( n − k )
An LTI system is stable if h(n)
is absolutely summable
bounded if Sh =
k =−
h( k )
LTI System classification based on the duration of its impulse response:
LTI systems
characterized in terms of h(n)
FIR System IIR System
finite duration h(n) infinite duration h(n)
depends
o/p of a recursive Past+present values Past values of
system of i/ps + o/ps
y(n) = F[ y(n −1), y(n − 2), y(n − N ), x(n), x(n −1), x(n − M )]
Discrete time system classification based on implementation:
x(n) −1 −1 −1
z z z
h(0) h(1) h(2) h(3)
+ + + y(n)
+z +z +z
Discrete time system classification based on implementation:
y ( n) = h( k ) x ( n − k )
k =−
Non recursive Implementation
is not possible as shown above
Example:
n
y (n) = x(k ), n = 0,1, 2, (no. of addition, memory
k =0
location with n )
Rearranging n −1
y ( n) = x ( n) + x ( k )
k =0
=x( n) + y ( n − 1)
y (n) = y (n − 1) + x(n)
2 multiplications,
1 addition, 1
mem. location
Summarizes all we need to know about the past history of the response of the
sys. to compute present and future o/ps
LTI Systems chatacterized by constant coefficient difference equations:
(Difference
Constant
equation of LTI Varies with n
coefficient
system)
(Difference
equation of LTV
st
1 order difference equation system)
y(n) = ay(n −1) + x(n) Implicit description of sys.
Let
1) x(n) may be causal or non-causal
2) y(−1) (initial condition) exists
y (n) = ay (n − 1) + x(n)
n +1 n −1
=a y (−1) + a x(0) + a
n
x(1) + + x(n)
n
y (n) = a n +1 y (−1) + a k x(n − k ) Explicit description
of sys.
k =0
(system’s o/p is expressed as the function of system’s i/p
and initial conditions only)
n
y( zs ) (n) = a k x(n − k ), n 0 Zero state response/ forced response
k =0 When initial condition is taken as 0
when y (−1) 0, x(n) = 0
n +1 Zero input response/ natural response
y zi (n) = a y (−1), n 0 When input is taken as 0
Non-relaxed system
h(k )
here, h(n) = a u(n) n
3) Depends on 3) Depends on
a) nature of the system a) nature of the system
b) nature of the input b) initial conditions
Solution of Linear constant coefficient difference equations:
Direct method:
y ( n ) = yh ( n ) + y p ( n )
Homogeneous/
Particular
complementary
solution
solution
Homogeneous Solution of a difference equation:
N M
a y ( n − k ) = b x (n − k )
k =0
k
k =0
k a0 = 1
n − N [ N + a1 N −1 + a2 N − 2 + + aN −1 + aN ] = 0
(Distinct/complex/identical)
For N distinct roots
Example
assume yh (n) = n
n − N [ N + a1 N −1 + a2 N − 2 + + aN −1 + aN ] = 0
a y
k =0
k p (n − k ) = bk x(n − k )
k =0
a0 = 1
6 6
at n = 2
5 1
4K = K − K + 4
3 6
8 8 n
K= y p ( n) = 2 , n 0
5 5
Total Solution of a difference equation:
y ( n ) = yh ( n ) + y p ( n )
Example
total solution
1
y (n) = C (−a1 ) n + u ( n) n0
1 + a1
initial initial
condition 0 condition = 0 y (n) = y zs (n)
Obtaining zero state response:
1 − (−a1 ) n +1
y zs (n) = n0
1 + a1
Example 2.4.10
Determine the impulse response h(n) for the system described by the second order
difference equation y(n) − 3 y(n − 1) − 4 y(n − 2) = x(n) + 2 x(n − 1)
** For the system shown below find the input-output relation. Classify the system as FIR or
IIR. Find an explicit expression for the impulse response of the system