Unit - III Concepts of Digital Filtering: By:-Mr. B.M.Daxini
Unit - III Concepts of Digital Filtering: By:-Mr. B.M.Daxini
DIGITAL FILTERS
The function of a digital filter is the same as its analog
counterpart, but its implementation is very different.
Analog filters are implemented using = ???
either active or passive electronic circuits, and they operate on
continuous waveforms.
Digital filters, are implemented using either a digital logic
circuit or a computer program and they operate on a sequence
of numbers that are obtained by sampling the continuous
waveform.
A.V.P.T.I
Mr. B. M. Daxini
A.V.P.T.I
Mr. B. M. Daxini
A.V.P.T.I
Mr. B. M. Daxini
A.V.P.T.I
Mr. B. M. Daxini
THE z TRANSFORM
The sampling process reduces a continuous signal to a sequence of numbers.
Figure below is a representation of this process which yields the sequence {a(0), a(T),
a(2T), a(3T), , a(kT)}
This set of numbers summarizes the samples of the waveform a(t) at times 0, T, , kT,
where T is the sampling period.
A.V.P.T.I
Mr. B. M. Daxini
7
By definition, the z transform of any sequence {f(0), f(T), f(2T), , f(kT)} (4.2) is
F(z) = f(0) + f(T)z1 + f(2T)z2 + + f(kT)zk
In general
By this definition, then the z transform of the sequence of {a(0), a(T), a(2T), a(3T), , a(kT)}
is
A(z) = a(0) + a(T) z1 + a(2T) z2 + + a(kT) zk
OR
A.V.P.T.I
Mr. B. M. Daxini
8
Question :- Find the z transform of a signal represented
{1, 2, 5, 3, 0, 0, }
The z transform is important in digital filtering because it describes the sampling process and
plays a role in the digital domain similar to that of the Laplace transform in analog filtering.
Z transform of Unit Impulse signal = ???
Unit impulse Signal is represent as
f(nT) = 1 for n = 0
f(nT) = 0 for n > 0
This can be represented in sequence form as = ????
Therefore, the z transform of the unit impulse function is
F(z) = 1
A.V.P.T.I
Mr. B. M. Daxini
9
Unit Step Function is given as
f(nT) = 1 for n 0
In sequence form it is represented as = ???
Therefore, the z transform of the unit step is
F(z) = 1 + z1 + z2 + z3 +
This transform is an infinite summation of nonzero terms. We can convert this sum to a more
convenient ratio of polynomials by using the binomial theorem
If we let v = z1 in the above equation, the z transform of the unit step becomes
A.V.P.T.I
Mr. B. M. Daxini
10
A.V.P.T.I
Mr. B. M. Daxini
11
Consider the sequence {x(0), x(T), x(2T), , x(nT)}
Its z transform is
X(z) = x(0) + x(T)z1 + x(2T)z2 + + x(nT)zn
If we apply this sequence to the input of the storage element , we obtain the output sequence as
{0, x(0), x(T), x(2T), , x(nT)}
The z trasform of the above sequence is
Y(z) = 0 + x(0)z1 + x(T)z2 + + x(nT T)zn
The output sequence is identical to the input sequence except that the whole sequence has been
delayed by T seconds.
A.V.P.T.I
Mr. B. M. Daxini
12
By dividing the output by the input we verify that the relation between the output z transform
and the input z transform is
Y(z) = X(z) z1
and the transfer function of the delay block is
A.V.P.T.I
Mr. B. M. Daxini
13
Multiplication of the sequence {5, 9, 0, 6} by the constant 5 would produce a new sequence at
the output of the multiplier {25, 45, 0, 30} where each number in the output sequence is said to
occur exactly at the same point in time as the corresponding number in the input sequence.
A.V.P.T.I
Mr. B. M. Daxini
14
A.V.P.T.I
Mr. B. M. Daxini
15
For recursive filters, the transfer function is expressed as the ratio of two such
Polynomials
The values of z for which H(z) equals zero are called the zeros of the transfer function, and the
values of z for which H(z) goes to infinity are called the poles.
We find the zeros of a filter by equating the numerator to 0 and evaluating for z. To find the poles
of a filter, we equate the denominator to 0 and evaluate for z.
Thus, we can see that the transfer function (and hence the output) goes to zero at the zeros
of the transfer function and becomes indeterminate at the poles of the transfer function.
We can see from the transfer functions of nonrecursive filters that they have poles only at z = 0.
The location of the poles in the z plane determines the stability of the filter.
Since nonrecursive filters have poles only at z = 0, they are always stable.
A.V.P.T.I
Mr. B. M. Daxini
16
A.V.P.T.I
Mr. B. M. Daxini
17
TRANSFER FUNCTION OF A DIFFERENCE EQUATION
Once we have the difference equation representing the numerical algorithm for
implementing a digital filter, we can quickly determine the transfer equation that totally
characterizes the performance of the filter.
Consider the difference equation
y(nT) = x(nT) + 2x(nT T) + x(nT 2T)
Here x(nT) and y(nT) are points in the input and output sequences associated with the
current sample time, they are analogous to the undelayed zdomain variables,
There fore We can then write an equation for output Y(z) as a function of input X(z)
Y(z) = X(z) + 2X(z)z1 + X(z)z2
A.V.P.T.I
Mr. B. M. Daxini
18
Thus the transfer function of this difference equation is
H(z) = Y(z)
X(z) = 1 + 2z1 + z2
THE z-PLANE POLE-ZERO PLOT
mathematics of the z transform are based on the definition
z = esT
where the complex frequency is
s = + j
Therefore z = e T e T
By definition, the magnitude of z is |z| = e T
and the phase angle is z =T
A.V.P.T.I
Mr. B. M. Daxini
19
If we set = 0, the magnitude of z is 1 and we have
z = ej T= cos T + j sin T
This is the equation of a circle of unity radius called the unit circle in the z plane.
Mapping the s plane to the z plane shows that the imaginary axis (j ) in the s plane maps
to points on the unit circle in the z plane.
Negative values of describe the left half of the s plane and map to the interior of the unit
circle in the z plane.
Positive values of correspond to the right half of the s plane and map to points outside
the unit circle in the z plane.
What is the criteria for stability in Z domain ????
A.V.P.T.I
Mr. B. M. Daxini
20
All poles must lie either inside or on the unit circle.
Zeros do not influence stability and can be anywhere in the z plane.
A.V.P.T.I
Mr. B. M. Daxini
21
Any angle T specifies a point on the unit circle.
Since = 2f and T = 1/fs,
This angle is
T = 2 f/fs
The angular location of any point on the unit circle is then designated by the ratio
of a specified frequency f to the sampling frequency fs.
If f = fs, T = 2;
thus the sampling frequency corresponds to an angular location of 2 radians.
For f = 0,
T = 0; hence, dc is located at an angle of 0.
A.V.P.T.I
Mr. B. M. Daxini
22
Another important frequency is f = fs/2 = f0 at T = .
This frequency, called the foldover frequency, equals one-half the sampling rate.
Since sampling theory requires a sample rate of twice the highest frequency present in a
signal, the foldover frequency represents the maximum frequency that a digital filter can
process properly.
Thus, unlike the frequency axis for the continuous world which extends linearly to
infinite frequency, the meaningful frequency axis in the discrete world extends only from
0 to radians corresponding to a frequency range of dc to fs/2.
A.V.P.T.I
Mr. B. M. Daxini
23
Finite Impulse Response Filters
A finite impulse response (FIR) filter has a unit impulse response that has a limited
number of terms.
Infinite impulse response (IIR) filter which produces an infinite number of output terms
when a unit impulse is applied to its input.
FIR filters are generally realized nonrecursively, which means that there is no feedback
involved in computation of the output data.
The output of the filter depends only on the present and past inputs.
A.V.P.T.I
Mr. B. M. Daxini
24
CHARACTERISTICS OF FIR FILTERS
1) Finite impulse response
Finite impulse response implies that the effect of transients or initial conditions on
the filter output will eventually die away.
Mr. B. M. Daxini
25
The difference equation and the transfer function of the FIR filter is given as
A.V.P.T.I
Mr. B. M. Daxini
26
2) Linear phase
In many biomedical signal processing applications, it is important to preserve certain
characteristics of a signal throughout the filtering operation, such as the height and
duration of the QRS pulse. A filter with linear phase has a pure time delay as its phase
response, so phase distortion is minimized.
A filter has linear phase if its frequency response H(ej ) can be expressed as
where H1( ) is a real and even function, since the phase of H(ej ) is
A.V.P.T.I
Mr. B. M. Daxini
27
FIR filters can easily be designed to have a linear phase characteristic.
3) Stability
Since a nonrecursive filter does not use feedback, it has no poles except those that are
located at z = 0. Thus there is no possibility for a pole to exist outside the unit circle.
This means that it is inherently stable. As long as the input to the filter is bounded, the
output of the filter will also be bounded. This contributes to ease of design, and makes
FIR filters especially useful for adaptive filtering where filter coefficients change as a
function of the input data.
4) Desirable finite-length register effects
When data are converted from analog form to digital form, some information is lost due
to the finite number of storage bits. Likewise, when coefficient values for a filter are
calculated, digital implementation can only approximate the desired values. The
limitations introduced by digital storage are termed finite-length register effects
A.V.P.T.I
Mr. B. M. Daxini
28
Its negative effects include quantization error, roundoff noise, limit cycles, conditional
stability, and coefficient sensitivity. In FIR filters, these effects are much less significant
and easier to analyze than in IIR filters since the errors are not fed back into the filter.
5) Ease of design
All of the above properties contribute to the ease in designing FIR filters. There are
many straightforward techniques for designing FIR filters to meet arbitrary frequency
and phase response specifications, such as window design or frequency sampling.
6) Realizations
There are three methods of realizing an FIR filter.
1) Convolution
2) Fast Convolution
3) Advanced, recursive technique involving a comb filter and a bank of parallel digital
resonators
A.V.P.T.I
Mr. B. M. Daxini
29
Infinite Impulse Response Filters
Infinite impulse response (IIR) digital filters that have the potential of sharp rolloffs
GENERIC EQUATIONS OF IIR FILTERS
The generic format of transfer function of IIR filters is expressed as the ratio of
two polynomials.
30
Rearranging the terms gives
The Y(z) terms on the right side of this equation are delayed feedback terms.
The output of an IIR filter is delayed and fed back.
These feedback terms as recursive loops; hence, these types of filters are also called
recursive filters.
A.V.P.T.I
Mr. B. M. Daxini
31
A.V.P.T.I
Mr. B. M. Daxini
32
CHARACTERISTICS OF IIR FILTERS
1) IIR filter requires not only the current value of the input x(nT) but also the previous
value of the output itself y(nT T).
2) Since past history of the output influences the next output value, which in turn
influences the next successive output value, a transient requires a large number or
sample points before it disappears from an output signal. This does not occur in an FIR
filter because it has no feedback.
3) IIR filters are not stable as they are recursive in nature and feedback is also involved
in the process of calculating output sample values.
4) IIR filter need more power due to more coefficients in the design.
5) IIR filters have analog equivalent.
6) IIR filter need lower order to achieve same performance
A.V.P.T.I
Mr. B. M. Daxini
33
Difference between IIR and FIR filters
IIR FILTER
FIR FILTER
3) No limit cycles.
A.V.P.T.I
Mr. B. M. Daxini
34
IIR FILTER
FIR FILTER
A.V.P.T.I
Mr. B. M. Daxini
35
Adaptive Filters
Adaptive techniques are advantageous because they do not require a priori knowledge of
the signal or noise characteristics as do fixed filters.
Adaptive filters employ a method of learning through an estimated synthesis of a desired
signal and error feedback to modify the filter parameters.
Adaptive techniques have been used in filtering of 60-Hz line frequency noise from ECG
signals, extracting fetal ECG signals, and enhancing P waves, as well as for removing
other artifacts from the ECG signal.
In digital signal processing applications, frequently a desired signal is corrupted by
interfering noise. In fixed filter methods, the basic premise behind optimal filtering is
that we must have knowledge of both the signal and noise characteristics. It is also
generally assumed that the statistics of both sources are well behaved or wide-sense
stationary.
An adaptive filter learns the statistics of the input sources and tracks them if they vary
slowly.
A.V.P.T.I
Mr. B. M. Daxini
36
A.V.P.T.I
Mr. B. M. Daxini
37
Figure shows a general model of an adaptive filter noise canceler. In the discrete time
case, we can model the primary input as s(nT) + n0(nT).
The noise is additive and considered uncorrelated with the signal source. A secondary
reference input to the filter feeds a noise n1(nT) into the filter to produce output (nT)
that is a close estimate of n0(nT). The noise n1(nT) is correlated in an unknown way to
n0(nT).
The output (nT) is subtracted from the primary input to produce the system output
y(nT). This output is also the error (nT) that is used to adjust the taps of the adaptive
filter coefficients {w(1,, p)}.
y(nT) = s(nT) + n0(nT) (nT)
A.V.P.T.I
Mr. B. M. Daxini
38
APPLICATIONS OF ADAPTIVE FILTERING
1)
2)
3)
4)
A.V.P.T.I
Mr. B. M. Daxini