Lecture19_DigitalFilters01

CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
1. The Difference Equation and the Digital Filtering
Consider a DSP system in the form of an LTI system as shown in the figure below
Digital Input
An LTI
System
𝒙(𝒏)
Digital Output
π’š(𝒏)
The relationship between its input and output can be expressed in the form of a
difference equation as,
π’š(𝒏) = π’ƒπŸŽ 𝒙(𝒏) + π’ƒπŸ 𝒙(𝒏 βˆ’ 𝟏) + β‹― + 𝒃𝑴 𝒙(𝒏 βˆ’ 𝑴)
βˆ’π’‚πŸ π’š(𝒏 βˆ’ 𝟏) βˆ’ π’‚πŸ π’š(𝒏 βˆ’ 𝟐) βˆ’ β‹― βˆ’ 𝒂𝑡 π’š(𝒏 βˆ’ 𝑡)
(1)
where π’ƒπ’Š , 𝟎 ≀ π’Š ≀ 𝑴 and 𝒂𝒋 , 𝟏 ≀ 𝒋 ≀ 𝑡 represent the coefficients of the system
and 𝒏 is the time index. This equation can also be written as
𝑴
𝑡
π’š(𝒏) = βˆ‘ π’ƒπ’Š 𝒙(𝒏 βˆ’ π’Š) βˆ’ βˆ‘ 𝒂𝒋 π’š(𝒏 βˆ’ 𝒋)
π’Š=𝟎
(2)
𝒋=𝟏
The equation shows that the current value of the output π’š(𝒏) depends on the
current 𝒙(𝒏) and past values 𝒙(𝒏 βˆ’ 𝟏), 𝒙(𝒏 βˆ’ 𝟐), … , 𝒙(𝒏 βˆ’ 𝑴) of the input as
well as the past values π’š(𝒏 βˆ’ 𝟏), π’š(𝒏 βˆ’ 𝟐), … , π’š(𝒏 βˆ’ 𝑡) of the output.
We have already seen that a system expressed in this form of difference
equation fulfills the conditions of linearity, time-invariance and causality.
If the initial conditions are given, the system output (i.e. time response), π’š(𝒏),
can be obtained recursively (illustrated below by the examples). This process is
called digital filtering.
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
Example 1
Compute the system output
π’š(𝒏) = 𝟎. πŸ“ π’š(𝒏 βˆ’ 𝟐) + 𝒙(𝒏 βˆ’ 𝟏)
for the first four samples using the following initial conditions
(a) Initial conditions: π’š(βˆ’πŸ) = 𝟏, π’š(βˆ’πŸ) = 𝟎, 𝒙(βˆ’πŸ) = βˆ’πŸ, and input
𝒙(𝒏) = (𝟎. πŸ“)𝒏 𝒖(𝒏).
(b) Zero initial conditions: π’š(βˆ’πŸ) = 𝟎, π’š(βˆ’πŸ) = 𝟎, 𝒙(βˆ’πŸ) = 𝟎, and input
𝒙(𝒏) = (𝟎. πŸ“)𝒏 𝒖(𝒏).
Solution
(a) Setting 𝒏 = 𝟎, and using the initial conditions, we obtain the input and
output as
𝒙(𝟎) = (𝟎. πŸ“)𝟎 𝒖(𝟎) = 𝟏
π’š(𝟎) = 𝟎. πŸ“ π’š(βˆ’πŸ) + 𝒙(βˆ’πŸ) = 𝟎. πŸ“ × πŸ βˆ’ 𝟏 = βˆ’πŸŽ. πŸ“
Setting 𝒏 = 𝟏, and using the initial conditions, we obtain the input and output
as
𝒙(𝟏) = (𝟎. πŸ“)𝟏 𝒖(𝟏) = 𝟎. πŸ“
π’š(𝟏) = 𝟎. πŸ“ π’š(βˆ’πŸ) + 𝒙(𝟎) = 𝟎. πŸ“ × πŸŽ + 𝟏 = 𝟏. 𝟎
Setting 𝒏 = 𝟐, and using the past values of the input and output,
𝒙(𝟐) = (𝟎. πŸ“)𝟐 𝒖(𝟐) = 𝟎. πŸπŸ“
π’š(𝟐) = 𝟎. πŸ“ π’š(𝟎) + 𝒙(𝟏) = 𝟎. πŸ“ × (βˆ’πŸŽ. πŸ“) + 𝟎. πŸ“ = 𝟎. πŸπŸ“
Setting 𝒏 = πŸ‘, and using the past values of the input and output,
𝒙(πŸ‘) = (𝟎. πŸ“)πŸ‘ 𝒖(𝟏) = 𝟎. πŸπŸπŸ“
π’š(πŸ‘) = 𝟎. πŸ“ π’š(𝟏) + 𝒙(𝟐) = 𝟎. πŸ“ × πŸ + 𝟎. πŸπŸ“ = 𝟎. πŸ•πŸ“
Clearly, it can be seen that the further value of the output can be obtained
recursively.
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
(b) Setting 𝒏 = 𝟎, and using the initial conditions, we obtain the input and
output as
𝒙(𝟎) = (𝟎. πŸ“)𝟎 𝒖(𝟎) = 𝟏
π’š(𝟎) = 𝟎. πŸ“ π’š(βˆ’πŸ) + 𝒙(βˆ’πŸ) = 𝟎. πŸ“ × πŸŽ + 𝟎 = 𝟎
Setting 𝒏 = 𝟏, and using the initial conditions, we obtain the input and output
as
𝒙(𝟏) = (𝟎. πŸ“)𝟏 𝒖(𝟏) = 𝟎. πŸ“
π’š(𝟏) = 𝟎. πŸ“ π’š(βˆ’πŸ) + 𝒙(𝟎) = 𝟎. πŸ“ × πŸŽ + 𝟏 = 𝟏. 𝟎
Setting 𝒏 = 𝟐, and using the past values of the input and output,
𝒙(𝟐) = (𝟎. πŸ“)𝟐 𝒖(𝟐) = 𝟎. πŸπŸ“
π’š(𝟐) = 𝟎. πŸ“ π’š(𝟎) + 𝒙(𝟏) = 𝟎. πŸ“ × πŸŽ + 𝟎. πŸ“ = 𝟎. πŸ“
Setting 𝒏 = πŸ‘, and using the past values of the input and output,
𝒙(πŸ‘) = (𝟎. πŸ“)πŸ‘ 𝒖(𝟏) = 𝟎. πŸπŸπŸ“
π’š(πŸ‘) = 𝟎. πŸ“ π’š(𝟏) + 𝒙(𝟐) = 𝟎. πŸ“ × πŸ + 𝟎. πŸπŸ“ = 𝟎. πŸ•πŸ“
Clearly, it can be seen that the further value of the output can be obtained
recursively.
Example 2
Compute the DSP system output
π’š(𝒏) = πŸπ’™(𝒏) βˆ’ πŸ’π’™(𝒏 βˆ’ 𝟏) βˆ’ 𝟎. πŸ“ π’š(𝒏 βˆ’ 𝟏) βˆ’ π’š(𝒏 βˆ’ 𝟐)
with the initial conditions π’š(βˆ’πŸ) = 𝟏, π’š(βˆ’πŸ) = 𝟎, 𝒙(βˆ’πŸ) = βˆ’πŸ, and input
𝒙(𝒏) = (𝟎. πŸ–)𝒏 𝒖(𝒏).
(a) Compute the system response π’š(𝒏) for 20 samples using MATLAB.
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
Solution
A MATLAB program to compute the system response for 20 samples is given
below along with the corresponding output shown in graphical form.
%
%
%
%
%
%
%
%
Example 2
Compute the response y(n) of a DSP system expressed by
y(n)=2x(n)-4x(n-1)-0.5y(n-1)-y(n-2)
for the first 20 samples. Initial conditions are
y(-2)=1, y(-1)=0, x(-1)=-1 and the system input is
x(n)=(0.8)^n*u(n).
% Initialize the input and output vectors
xi = [0 -1]; % for n=-2 and n=-1
yi = [1 0]; % for n=-2 and n=-1
%
n
%
x
%
x
Compute time indices
= 0:1:19;
Compute the input samples x(n) for these time instants n
= (0.8).^n;
Include the initial values of input into this vector
= [xi x];
% Now compute the system response
y = [];
% an empty vector
y = [yi y];
% after including the initial conditions
% compute y(n) recursively
for k = 3:1:22
r = 2*x(k-2)-4*x(k-1)-0.5*y(k-1)-0.5*y(k-2);
y = [y r];
end
subplot(2,1,1), stem(n,x(3:22),'filled','LineWidth',2), grid on
xlabel('Sample number'); ylabel('Input x(n)');
subplot(2,1,2), stem(n,y(3:22),'filled','LineWidth',2), grid on
xlabel('Sample number'); ylabel('Output x(n)');
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
Input x(n)
1
0.5
0
0
2
4
6
8
10
12
Sample number
14
16
18
20
0
2
4
6
8
10
12
Sample number
14
16
18
20
Output x(n)
5
0
-5
-10
Figure 2: Plots of the input and system output for Example 2.
There are two MATLAB functions (syntax given below), that can used to perform
this filtering process:
Zi = filtic(B, A, Yi, Xi)
y = filter(B, A, x, Zi)
where B and A are vectors for the coefficients given as
𝑨 = [𝟏 π’‚πŸ π’‚πŸ … 𝒂𝑡 ] and 𝑩 = [ π’ƒπŸŽ π’ƒπŸ π’ƒπŸ … 𝒃𝑴 ]
Xi and Yi are the vectors containing the initial conditions. Also x, y are the input
and system output vectors.
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
The function filtic is used to obtain the initial states required by the second
function filter. The function filter is based on the direct-form II realization to
implement a digital filter from its difference equation form. This will be studied
in a coming lecture.
The following MATLAB code, illustrates how to solve Example 1, using filtic and
filter MATLAB functions.
>> B = [0 1];
>> A = [1 0 -0.5];
>> Xi = [-1 0];
>> Yi = [0 1];
>> Zi = filtic(B, A, Yi, Xi);
>> n = 0:3;
>> x = (0.5).^n;
>> y = filter(B, A, x, Zi)
y=
-0.5000 1.0000 0.2500 0.7500
These are the same results as obtained in Example 1.
2. The Difference Equation and the Transfer Function
From Equation 1, we have
π’š(𝒏) = π’ƒπŸŽ 𝒙(𝒏) + π’ƒπŸ 𝒙(𝒏 βˆ’ 𝟏) + β‹― + 𝒃𝑴 𝒙(𝒏 βˆ’ 𝑴)
βˆ’π’‚πŸ π’š(𝒏 βˆ’ 𝟏) βˆ’ π’‚πŸ π’š(𝒏 βˆ’ 𝟐) βˆ’ β‹― βˆ’ 𝒂𝑡 π’š(𝒏 βˆ’ 𝑡)
Assuming that all initial conditions for this system are zero, we take the ztransform of both sides to get
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
𝒀(𝒛) = π’ƒπŸŽ 𝑿(𝒛) + π’ƒπŸ π’›βˆ’πŸ 𝑿(𝒛) + β‹― + 𝒃𝑴 π’›βˆ’π‘΄ 𝑿(𝒛)
βˆ’π’‚πŸ π’›βˆ’πŸ 𝒀(𝒛) βˆ’ π’‚πŸ π’›βˆ’πŸ 𝒀(𝒛) βˆ’ β‹― βˆ’ 𝒂𝑡 π’›βˆ’π‘΅ 𝒀(𝒛)
(3)
We have made use of the shift-theorem in the above equation. Rearranging, we
obtain
𝒀(𝒛) π’ƒπŸŽ + π’ƒπŸ π’›βˆ’πŸ + β‹― + 𝒃𝑴 π’›βˆ’π‘΄ 𝑩(𝒛)
𝑯(𝒛) =
=
=
𝑿(𝒛)
𝟏 + π’‚πŸ π’›βˆ’πŸ + β‹― + 𝒂𝑡 π’›βˆ’π‘΅
𝑨(𝒛)
(4)
where 𝑯(𝒛) is defined as the z-transfer function with its numerator and
denominator polynomials given by
𝑩(𝒛) = π’ƒπŸŽ + π’ƒπŸ π’›βˆ’πŸ + β‹― + 𝒃𝑴 π’›βˆ’π‘΄
(5)
𝑨(𝒛) = 𝟏 + π’‚πŸ π’›βˆ’πŸ + β‹― + 𝒂𝑡 π’›βˆ’π‘΅
(6)
It can clearly be notices that the z-tranfer function is the ratio of the z-transform
of the output with the z-transform of the input. This can diagrammatically be
shown as
The z-transfer function can be used to determine the stability and frequency
response of the digital filter.
Example 3
A DSP system is described by the following difference equation
π’š(𝒏) = 𝒙(𝒏) βˆ’ 𝒙(𝒏 βˆ’ 𝟐) βˆ’ 𝟏. πŸ‘π’š(𝒏 βˆ’ 𝟏) βˆ’ 𝟎. πŸ‘πŸ”π’š(𝒏 βˆ’ 𝟐)
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
Find the z-transfer function 𝑯(𝒛), the denominator polynomial 𝑨(𝒛), and the
numerator polynomial 𝑩(𝒛).
Solution
Taking the z-transform of both sides of the given difference equation, and using
the shift-theorem, we get
𝒀(𝒛) = 𝑿(𝒛) βˆ’ π’›βˆ’πŸ 𝑿(𝒛) βˆ’ 𝟏. πŸ‘π’›βˆ’πŸ 𝒀(𝒛) βˆ’ 𝟎. πŸ‘πŸ”π’›βˆ’πŸ 𝒀(𝒛)
It can also be written as
𝒀(𝒛) + 𝟏. πŸ‘π’›βˆ’πŸ 𝒀(𝒛) + 𝟎. πŸ‘πŸ”π’›βˆ’πŸ 𝒀(𝒛) = 𝑿(𝒛) βˆ’ π’›βˆ’πŸ 𝑿(𝒛)
𝒀(𝒛)(𝟏 + 𝟏. πŸ‘π’›βˆ’πŸ + 𝟎. πŸ‘πŸ”π’›βˆ’πŸ ) = 𝑿(𝒛)(𝟏 βˆ’ π’›βˆ’πŸ )
(𝟏 βˆ’ π’›βˆ’πŸ )
𝒀(𝒛)
=
𝑿(𝒛) (𝟏 + 𝟏. πŸ‘π’›βˆ’πŸ + 𝟎. πŸ‘πŸ”π’›βˆ’πŸ )
The transfer function, is therefore, given by
(𝟏 βˆ’ π’›βˆ’πŸ )
𝒀(𝒛)
𝑯(𝒛) =
=
𝑿(𝒛) (𝟏 + 𝟏. πŸ‘π’›βˆ’πŸ + 𝟎. πŸ‘πŸ”π’›βˆ’πŸ )
The denominator and numerator polynomials are
𝑨(𝒛) = 𝟏 + 𝟏. πŸ‘π’›βˆ’πŸ + 𝟎. πŸ‘πŸ”π’›βˆ’πŸ
𝑩(𝒛) = 𝟏 βˆ’ π’›βˆ’πŸ
Example 4
A digital system is described by the following difference equation
π’š(𝒏) = 𝒙(𝒏) βˆ’ 𝟎. πŸ“π’™(𝒏 βˆ’ 𝟏) + 𝟎. πŸ‘πŸ”π’™(𝒏 βˆ’ 𝟐)
Find the z-transfer function 𝑯(𝒛), the denominator polynomial 𝑨(𝒛), and the
numerator polynomial 𝑩(𝒛).
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
Solution
Taking the z-transform of both sides of the given difference equation, and using
the shift-theorem, we get
𝒀(𝒛) = 𝑿(𝒛) βˆ’ 𝟎. πŸ“π’›βˆ’πŸ 𝑿(𝒛) + 𝟎. πŸ‘πŸ”π’›βˆ’πŸ 𝑿(𝒛)
It can also be written as
𝒀(𝒛) = 𝑿(𝒛)(𝟏 βˆ’ 𝟎. πŸ“π’›βˆ’πŸ + 𝟎. πŸ‘πŸ”π’›βˆ’πŸ )
𝒀(𝒛)
𝟏
=
𝑿(𝒛) (𝟏 βˆ’ 𝟎. πŸ“π’›βˆ’πŸ + 𝟎. πŸ‘πŸ”π’›βˆ’πŸ )
The transfer function, is therefore, given by
𝑯(𝒛) =
𝒀(𝒛)
𝟏
=
𝑿(𝒛) (𝟏 βˆ’ 𝟎. πŸ“π’›βˆ’πŸ + 𝟎. πŸ‘πŸ”π’›βˆ’πŸ )
The denominator and numerator polynomials are
𝑨(𝒛) = 𝟏 βˆ’ 𝟎. πŸ“π’›βˆ’πŸ + 𝟎. πŸ‘πŸ”π’›βˆ’πŸ
𝑩(𝒛) = 𝟏
In some DSP applications, the given transfer function of a digital system can be
converted into a difference equation for DSP implementation. The following
example illustrates this procedure.
Example 5
Convert each of the following transfer functions into its difference equation
(a) 𝑯(𝒛) =
(b) 𝑯(𝒛) =
π’›πŸ βˆ’ 𝟏
π’›πŸ + 𝟏.πŸ‘ 𝒛 + 𝟎.πŸ‘πŸ”
π’›πŸ βˆ’ 𝟎.πŸ“ 𝒛 + 𝟎.πŸ‘πŸ”
π’›πŸ
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
Solution
Part (a): We first divide the numerator and denominator by π’›πŸ to obtain the
transfer function whose numerator and the denominator polynomials have the
negative powers of 𝒛, it follows that
(π’›πŸ βˆ’ 𝟏)/π’›πŸ
(𝟏 βˆ’ π’›βˆ’πŸ )
𝑯(𝒛) = 𝟐
=
(𝒛 + 𝟏. πŸ‘ 𝒛 + 𝟎. πŸ‘πŸ”)/π’›πŸ (𝟏 + 𝟏. πŸ‘ π’›βˆ’πŸ + 𝟎. πŸ‘πŸ” π’›βˆ’πŸ )
According to the definition of the transfer function
𝑯(𝒛) =
𝒀(𝒛)
𝑿(𝒛)
Therefore, in this case,
(𝟏 βˆ’ π’›βˆ’πŸ )
𝒀(𝒛)
=
𝑿(𝒛) (𝟏 + 𝟏. πŸ‘ π’›βˆ’πŸ + 𝟎. πŸ‘πŸ” π’›βˆ’πŸ )
Cross multiplication gives
(𝟏 + 𝟏. πŸ‘ π’›βˆ’πŸ + 𝟎. πŸ‘πŸ” π’›βˆ’πŸ )𝒀(𝒛) = (𝟏 βˆ’ π’›βˆ’πŸ )𝑿(𝒛)
𝒀(𝒛) + 𝟏. πŸ‘ π’›βˆ’πŸ 𝒀(𝒛) + 𝟎. πŸ‘πŸ” π’›βˆ’πŸ 𝒀(𝒛) = 𝑿(𝒛) βˆ’ π’›βˆ’πŸ 𝑿(𝒛)
Applying the inverse z-transform and applying the shift-theorem
π’š(𝒏) + 𝟏. πŸ‘ π’š(𝒏 βˆ’ 𝟏) + 𝟎. πŸ‘πŸ” π’š(𝒏 βˆ’ 𝟐) = 𝒙(𝒏) βˆ’ 𝒙(𝒏 βˆ’ 𝟐)
This equation can be re-arranged to give the required difference equation for
the DSP system, as
π’š(𝒏) = 𝒙(𝒏) βˆ’ 𝒙(𝒏 βˆ’ 𝟐) βˆ’ 𝟏. πŸ‘ π’š(𝒏 βˆ’ 𝟏) βˆ’ 𝟎. πŸ‘πŸ” π’š(𝒏 βˆ’ 𝟐)
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
Part (b): In this case also, we first divide the numerator and denominator by π’›πŸ
to obtain the transfer function whose numerator and the denominator
polynomials have the negative powers of 𝒛, it follows that
(π’›πŸ βˆ’ 𝟎. πŸ“ 𝒛 + 𝟎. πŸ‘πŸ”)/π’›πŸ (𝟏 βˆ’ 𝟎. πŸ“ π’›βˆ’πŸ + 𝟎. πŸ‘πŸ” π’›βˆ’πŸ )
𝑯(𝒛) =
=
(π’›πŸ )/π’›πŸ
𝟏
According to the definition of the transfer function
𝑯(𝒛) =
𝒀(𝒛)
𝑿(𝒛)
Therefore, in this case,
𝒀(𝒛)
= (𝟏 βˆ’ 𝟎. πŸ“ π’›βˆ’πŸ + 𝟎. πŸ‘πŸ” π’›βˆ’πŸ )
𝑿(𝒛)
It can be written as
𝒀(𝒛) = (𝟏 βˆ’ 𝟎. πŸ“ π’›βˆ’πŸ + 𝟎. πŸ‘πŸ” π’›βˆ’πŸ )𝑿(𝒛)
𝒀(𝒛) = 𝑿(𝒛) βˆ’ 𝟎. πŸ“ π’›βˆ’πŸ 𝑿(𝒛) + 𝟎. πŸ‘πŸ” π’›βˆ’πŸ 𝑿(𝒛)
Applying the inverse z-transform and applying the shift-theorem
π’š(𝒏) = 𝒙(𝒏) βˆ’ 𝟎. πŸ“ 𝒙(𝒏 βˆ’ 𝟏) + 𝟎. πŸ‘πŸ” 𝒙(𝒏 βˆ’ 𝟐)
This is the required difference equation for the DSP system.
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
Transfer Function in Pole-Zero Form
From Equation 4, we know that the transfer function for a digital filter can be
written as
𝒀(𝒛) π’ƒπŸŽ + π’ƒπŸ π’›βˆ’πŸ + β‹― + 𝒃𝑴 π’›βˆ’π‘΄ 𝑩(𝒛)
𝑯(𝒛) =
=
=
𝑿(𝒛)
𝟏 + π’‚πŸ π’›βˆ’πŸ + β‹― + 𝒂𝑡 π’›βˆ’π‘΅
𝑨(𝒛)
The numerator 𝑩(𝒛) and the denominator 𝑨(𝒛) polynomials of the transfer
function 𝑯(𝒛) can be factorized. The transfer function 𝑯(𝒛) can therefore, be
written in its pole-zero form as
𝑯(𝒛) =
π’ƒπŸŽ (𝒛 βˆ’ π’›πŸ )(𝒛 βˆ’ π’›πŸ ) … (𝒛 βˆ’ 𝒛𝑴 )
(𝒛 βˆ’ π’‘πŸ )(𝒛 βˆ’ π’‘πŸ ) … (𝒛 βˆ’ 𝒑𝑡 )
(7)
where the zerosπ’›π’Š and poles 𝒑𝒋 can be found by solving (finding the roots of) the
polynomial equations
𝒛𝑴 + (
π’ƒπŸ π‘΄βˆ’πŸ
𝒃𝑴
+ β‹―+ ( ) = 𝟎
)𝒛
π’ƒπŸŽ
π’ƒπŸŽ
π’‚πŸ 𝒛𝑡 + π’‚πŸ π’›π‘΅βˆ’πŸ + β‹― + 𝒃𝑡 = 𝟎
This is explained with the following example.
Example 6
Given the following transfer function
(𝟏 βˆ’ π’›βˆ’πŸ )
𝑯(𝒛) =
(𝟏 + 𝟏. πŸ‘π’›βˆ’πŸ + 𝟎. πŸ‘πŸ”π’›βˆ’πŸ )
Convert it into its pole-zero form.
Solution
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
We first multiply the numerator and denominator by π’›πŸ to obtain the transfer
function whose numerator and the denominator polynomials have the positive
powers of 𝒛, as follows
(𝟏 βˆ’ π’›βˆ’πŸ ) π’›πŸ
π’›πŸ βˆ’ 𝟏
𝑯(𝒛) =
=
(𝟏 + 𝟏. πŸ‘π’›βˆ’πŸ + 𝟎. πŸ‘πŸ”π’›βˆ’πŸ ) π’›πŸ π’›πŸ + 𝟏. πŸ‘π’› + 𝟎. πŸ‘πŸ”
Putting the numerator polynomial equal to zero and then finding the roots,
gives us the zeros of the transfer function,
π’›πŸ βˆ’ 𝟏 = 𝟎
(𝒛 βˆ’ 𝟏)(𝒛 + 𝟏) = 𝟎
Therefore, we get π’›πŸ = 𝟏 and π’›πŸ = βˆ’πŸ as the roots.
Now, setting the denominator polynomial equal to zero and find the roots, gives
us the poles of the transfer function,
π’›πŸ + 𝟏. πŸ‘π’› + 𝟎. πŸ‘πŸ” = 𝟎
𝒛=
βˆ’πŸ. πŸ‘ ± √(𝟏. πŸ‘)𝟐 βˆ’ πŸ’(𝟏)(𝟎. πŸ‘πŸ”) βˆ’πŸ. πŸ‘ ± √𝟏. πŸ”πŸ— βˆ’ 𝟏. πŸ’πŸ’
=
𝟐(𝟏)
𝟐
βˆ’πŸ. πŸ‘ ± √𝟎. πŸπŸ“ βˆ’πŸ. πŸ‘ ± 𝟎. πŸ“
=
=
= βˆ’πŸŽ. πŸ’, βˆ’πŸŽ. πŸ—
𝟐
𝟐
Therefore, the poles are π’‘πŸ = βˆ’πŸŽ. πŸ’ and π’‘πŸπŸ = βˆ’πŸŽ. πŸ—. The transfer function can
now be written in the pole-zero form as
𝑯(𝒛) =
(𝒛 βˆ’ 𝟏)(𝒛 + 𝟏)
(𝒛 + 𝟎. πŸ’)(𝒛 + 𝟎. πŸ—)
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
Impusle Response, Step Response and System Response
Example 6.7
Given a transfer function depicting a DSP system
𝑯(𝒛) =
𝒛+𝟏
𝒛 βˆ’ 𝟎. πŸ“
Determine
(a) The impulse response 𝒉(𝒏)
(b) The step response π’š(𝒏), and
(c) The system response π’š(𝒏), if the input is given as 𝒙(𝒏) = (𝟎. πŸπŸ“)𝒏 𝒖(𝒏).
Solution
Part (a): In this case 𝒙(𝒏) = 𝜹(𝒏), thus 𝑿(𝒛) = 𝟏. As
𝑯(𝒛) =
𝒀(𝒛)
𝑿(𝒛)
Therefore, in this case, the z-transform of the output is equal to the transfer
function:
𝑯(𝒛) = 𝒀(𝒛)
By taking the inverse z-transform of the transfer function we can find out the
unit impulse response 𝒉(𝒏) of the system. The transfer function can be written
as
𝑯(𝒛)
𝒛+𝟏
=
𝒛
𝒛(𝒛 βˆ’ 𝟎. πŸ“)
This can further be written in the form of partial fractions as
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
𝑯(𝒛) 𝑨
𝑩
= +
𝒛
𝒛 (𝒛 βˆ’ 𝟎. πŸ“)
where
𝑨=
𝒛+𝟏
𝟎+𝟏
=
= βˆ’πŸ
|
(𝒛 βˆ’ 𝟎. πŸ“) 𝒛=𝟎 (𝟎 βˆ’ 𝟎. πŸ“)
𝑩=
𝒛+𝟏
𝟎. πŸ“ + 𝟏
=
=πŸ‘
|
𝒛 𝒛=𝟎.πŸ“
𝟎. πŸ“
Thus we have
𝑯(𝒛) βˆ’πŸ
πŸ‘
=
+
(𝒛 βˆ’ 𝟎. πŸ“)
𝒛
𝒛
Or
𝑯(𝒛) = βˆ’πŸ +
πŸ‘π’›
(𝒛 βˆ’ 𝟎. πŸ“)
Taking inverse z-transform of both sides (and using Table 5.1), we get
𝒉(𝒏) = βˆ’πŸ 𝜹(𝒏) + πŸ‘(𝟎. πŸ“)𝒏 𝒖(𝒏)
which is the required impulse response of the system.
Part (b): In this case 𝒙(𝒏) = 𝒖(𝒏), thus 𝑿(𝒛) =
𝑯(𝒛) =
𝒛
π’›βˆ’πŸ
. As
𝒀(𝒛)
𝑿(𝒛)
Therefore, in this case,
𝒀(𝒛) = 𝑯(𝒛)𝑿(𝒛) =
(𝒛 + 𝟏)
𝒛
(𝒛 βˆ’ 𝟎. πŸ“) (𝒛 βˆ’ 𝟏)
It can be written as
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
𝒀(𝒛)
𝒛+𝟏
=
(𝒛 βˆ’ 𝟎. πŸ“)(𝒛 βˆ’ 𝟏)
𝒛
This can further be written in the form of partial fractions as
𝒀(𝒛)
𝑨
𝑩
=
+
(𝒛 βˆ’ 𝟎. πŸ“) (𝒛 βˆ’ 𝟏)
𝒛
where
𝑨=
𝒛+𝟏
𝟎. πŸ“ + 𝟏
=
= βˆ’πŸ‘
|
(𝒛 βˆ’ 𝟏) 𝒛=𝟎.πŸ“ (𝟎. πŸ“ βˆ’ 𝟏)
𝑩=
𝒛+𝟏
𝟏+𝟏
=
=πŸ’
|
(𝒛 βˆ’ 𝟎. πŸ“) 𝒛=𝟏 𝟏 βˆ’ 𝟎. πŸ“
Thus we have
𝒀(𝒛)
βˆ’πŸ‘
πŸ’
=
+
(𝒛 βˆ’ 𝟎. πŸ“) (𝒛 βˆ’ 𝟏)
𝒛
Or
𝒀(𝒛) =
βˆ’πŸ‘π’›
πŸ’π’›
+
(𝒛 βˆ’ 𝟎. πŸ“) (𝒛 βˆ’ 𝟏)
Taking inverse z-transform of both sides (and using Table 5.1), we get
π’š(𝒏) = βˆ’πŸ‘(𝟎. πŸ“)𝒏 𝒖(𝒏) + πŸ’ 𝒖(𝒏)
which is the required step response of the system.
Part (c): In this case 𝒙(𝒏) = (𝟎. πŸπŸ“)𝒏 𝒖(𝒏), thus from Table 5.1, 𝑿(𝒛) =
𝒛
π’›βˆ’πŸŽ.πŸπŸ“
.
As
𝑯(𝒛) =
𝒀(𝒛)
𝑿(𝒛)
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
Therefore, in this case,
𝒀(𝒛) = 𝑯(𝒛)𝑿(𝒛) =
(𝒛 + 𝟏)
𝒛
(𝒛 βˆ’ 𝟎. πŸ“) (𝒛 βˆ’ 𝟎. πŸπŸ“)
It can be written as
𝒀(𝒛)
𝒛+𝟏
=
(𝒛 βˆ’ 𝟎. πŸ“)(𝒛 βˆ’ 𝟎. πŸπŸ“)
𝒛
This can further be written in the form of partial fractions as
𝒀(𝒛)
𝑨
𝑩
=
+
(𝒛 βˆ’ 𝟎. πŸ“) (𝒛 βˆ’ 𝟎. πŸπŸ“)
𝒛
where
𝑨=
𝒛+𝟏
𝟎. πŸ“ + 𝟏
𝟏. πŸ“
=
=
=πŸ”
|
(𝒛 βˆ’ 𝟎. πŸπŸ“) 𝒛=𝟎.πŸ“ (𝟎. πŸ“ βˆ’ 𝟎. πŸπŸ“) 𝟎. πŸπŸ“
𝑩=
𝒛+𝟏
𝟎. πŸπŸ“ + 𝟏
𝟏. πŸπŸ“
=
=
= βˆ’πŸ“
|
(𝒛 βˆ’ 𝟎. πŸ“) 𝒛=𝟎.πŸπŸ“ 𝟎. πŸπŸ“ βˆ’ 𝟎. πŸ“ βˆ’πŸŽ. πŸπŸ“
Thus we have
𝒀(𝒛)
πŸ”
βˆ’πŸ“
=
+
(𝒛 βˆ’ 𝟎. πŸ“) (𝒛 βˆ’ 𝟎. πŸπŸ“)
𝒛
Or
𝒀(𝒛) =
πŸ”π’›
πŸ“π’›
βˆ’
(𝒛 βˆ’ 𝟎. πŸ“) (𝒛 βˆ’ 𝟎. πŸπŸ“)
Taking inverse z-transform of both sides (and using Table 5.1), we get
π’š(𝒏) = πŸ”(𝟎. πŸ“)𝒏 𝒖(𝒏) + πŸ“ (𝟎. πŸπŸ“)𝒏 𝒖(𝒏)
which is the required system response.
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 19
Date: November, 2012
Table 5.1 Table of z-transform pairs (for causal sequences)
Line
No.
Signal
𝒙(𝒏),
𝒏β‰₯𝟎
z-Transform
𝒁(𝒙(𝒏)) = 𝑿(𝒛)
Region of
Convergence
∞
1
βˆ‘ 𝒙(𝒏) π’›βˆ’π’
𝒙(𝒏)
𝒏=𝟎
2
𝜹(𝒏)
3
𝒂 𝒖(𝒏)
4
𝒏 𝒖(𝒏)
5
π’πŸ 𝒖(𝒏)
6
𝒂𝒏 𝒖(𝒏)
7
π’†βˆ’π’π’‚ 𝒖(𝒏)
8
𝒏 𝒂𝒏 𝒖(𝒏)
9
𝐬𝐒𝐧(𝒂𝒏) 𝒖(𝒏)
10
𝐜𝐨𝐬(𝒂𝒏) 𝒖(𝒏)
11
𝒂𝒏 𝐬𝐒𝐧(𝒃𝒏) 𝒖(𝒏)
12
𝒂𝒏 𝐜𝐨𝐬(𝒃𝒏) 𝒖(𝒏)
13
π’†βˆ’π’‚π’ 𝐬𝐒𝐧(𝒃𝒏) 𝒖(𝒏)
14
π’†βˆ’π’‚π’ 𝐜𝐨𝐬(𝒃𝒏) 𝒖(𝒏)
15
𝟐|𝑨||𝑷|𝒏 𝒄𝒐𝒔(π’πœ½ + 𝝓) 𝒖(𝒏) where 𝑷
and 𝑨 are complex constants defined by
𝑷 = |𝑷|∠𝜽, 𝑨 = |𝑨|βˆ π“
Shift Theorem:
1
Entire z-plane
𝒂𝒛
π’›βˆ’πŸ
𝒛
(𝒛 βˆ’ 𝟏)𝟐
|𝒛| > 1
|𝒛| > 1
𝒛(𝒛 + 𝟏)
(𝒛 βˆ’ 𝟏)πŸ‘
𝒛
π’›βˆ’π’‚
𝒛
𝒛 βˆ’ π’†βˆ’π’‚
𝒂𝒛
(𝒛 βˆ’ 𝒂)𝟐
π’›πŸ
|𝒛| > 1
|𝒛| > |𝒂|
|𝒛| > π’†βˆ’π’‚
|𝒛| > |𝒂|
𝒛 𝐬𝐒𝐧(𝒂)
βˆ’ πŸπ’› 𝐜𝐨𝐬(𝒂) + 𝟏
|𝒛| > |𝟏|
𝒛 (𝒛 βˆ’ 𝐜𝐨𝐬(𝒂))
π’›πŸ βˆ’ πŸπ’› 𝐜𝐨𝐬(𝒂) + 𝟏
[𝒂 𝐬𝐒𝐧(𝒃)] 𝒛
π’›πŸ βˆ’ [πŸπ’‚ 𝐜𝐨𝐬(𝒃)]𝒛 + π’‚πŸ
𝒛 [𝒛 βˆ’ 𝒂 𝐜𝐨𝐬(𝒃)]
π’›πŸ βˆ’ [πŸπ’‚ 𝐜𝐨𝐬(𝒃)]𝒛 + π’‚πŸ
[π’†βˆ’π’‚ 𝐬𝐒𝐧(𝒃)] 𝒛
π’›πŸ βˆ’ [πŸπ’†βˆ’π’‚ 𝐜𝐨𝐬(𝒃)]𝒛 + π’†βˆ’πŸπ’‚
𝒛 [𝒛 βˆ’ π’†βˆ’π’‚ 𝐜𝐨𝐬(𝒃)]
π’›πŸ βˆ’ [πŸπ’†βˆ’π’‚ 𝐜𝐨𝐬(𝒃)]𝒛 + π’†βˆ’πŸπ’‚
|𝒛| > |𝟏|
|𝒛| > |𝒂|
|𝒛| > |𝒂|
|𝒛| > π’†βˆ’π’‚
|𝒛| > π’†βˆ’π’‚
𝑨𝒛
π‘¨βˆ— 𝒛
+
𝒛 βˆ’ 𝑷 𝒛 βˆ’ π‘·βˆ—
𝒁(𝒙(𝒏 βˆ’ π’Ž)) = π’›βˆ’π’Ž 𝒁(𝒙(𝒏))
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia