Difference Equations For FIR and IIR Filters: Objectives
Difference Equations For FIR and IIR Filters: Objectives
CHAPTER 3
Difference Equations for
FIR and IIR Filters
Objectives
After completing this chapter, you will be able to:
▪ Learn more about IIR and FIR digital signal.
▪ Know how difference equations are affected the
signal
▪ Differentiate the equation used for IIR and FIR
INTRODUCTION
DSP (Digital Signal Processing) rose to significance in the 70’s and has been
increasingly important ever since. The first enabling breakthrough was the discovery of
the Fast Fourier Transform in the last 1960’s (enabling calculation of spectra on digital
signals) and then the rise of the transistor and the CPU in the 1970’s and 1980’s. Its rapid
rise to significance culminated in the advent of Digital Television/Media and Mobile
Communications toward the end of the 20th century.
The study of DSP now lies somewhere between Electronic Engineering (where it
started) and Statistics, Mathematics, Computer Science and even Statistical Physics. The
computer and computing science is to DSP engineers what the hammer and nail is to a
carpenter.
In the early part of the 1990’s DSP chips for implementation of DSP algorithms
were extremely popular: enabling faster computation times than general purpose CPUs
like the Intel 808x series or Motorola, SUN or Alpha chips. But as clock speeds have
increased and reconfigurable hardware has developed, the lines between DSP chips,
CPUs and IC chips have blurred.
16
DIGITAL SIGNAL PROCESSING
DIFFERENCE EQUATION
Definition
General Formula
We can also write the general form to easily express a recursive output, which looks like
this:
17
DIGITAL SIGNAL PROCESSING
From this equation, note that y[n−k] represents the outputs and x[n−k] represents the
inputs. The value of N represents the order of the difference equation and corresponds
to the memory of the system being represented. Because this equation relies on past
values of the output, in order to compute a numerical solution, certain past outputs,
referred to as the initial conditions, must be known.
1. What causes a filter to introduce a time delay in the output time history?
Take the equation for a FIR filter and work through the equation, the cause for the time
delay can be observed.
Observation: To be fully realized (i.e., actually work) the filter requires as many data
points (n) as the terms (N) to be passed through the filter.
A number of time data samples from the input signal (x) must pass through the
filter that is proportional to the number of terms (N), before the filter will work. The filtered
output data does not start until the number (n) data points passed through the filter is
greater than N. Because some data must pass through the filter to even create an output,
a delay in the output time history (y) is created when compared to the input time history
(x).
18
DIGITAL SIGNAL PROCESSING
Impulse Response
xn = δn = 1, 0, 0, 0, 0, . . .
19
DIGITAL SIGNAL PROCESSING
Recursive digital filters can be designed in which the output of the filter depends
both on current and previous inputs as well as previous outputs. For such filters, the
impulse response has infinite duration and they are called Infinite Impulse Response
(IIR) filters.
20
DIGITAL SIGNAL PROCESSING
Thus, to calculate the current value yn given the previous value yn−1 and the new input
xn, we need to calculate the previous total, and add in the new input xn, before finding the
new average by dividing by 2.
Example: Given the input sequence xn = 4, 3, 2, 1, 0, 0, calculate the output sequence yn,
for n = 0 . . . 4 when xn is input to the filter with difference equation as below (assume
zero initial conditions).
21
DIGITAL SIGNAL PROCESSING
Calculate the impulse response for the system defined through the difference equation
below.
Note: It is important to note that not all recursively defined filters will be IIR.
22
DIGITAL SIGNAL PROCESSING
It is an FIR filter. In fact it is equivalent to the 3-tap moving average filter from earlier.
Reference:
▪ http://www.mee.tcd.ie/~corrigad/3c1/DSP1_2012_students.pdf
▪ http://pilot.cnxproject.org/content/collection/col10064/latest/module/m10595/lat
est
▪ https://community.sw.siemens.com/s/article/introduction-to-filters-fir-versus-
iir#:~:text=The%20equations%20for%20both%20an,time%20series%20y(n).&text=T
he%20mathematical%20difference%20between%20the,the%20filter%20output%2
0as%20input.
IIR Filter
▪ https://www.youtube.com/watch?v=MtHpbGUIGaA
23