0% found this document useful (0 votes)
147 views28 pages

Chapter 5 - FIR Filters

This lecture covers Finite Impulse Response (FIR) filters, their significance in digital signal processing, and their applications in various fields. Key concepts include the differentiation between causal and non-causal FIR filters, the running-average filter, and the mathematical representation of FIR filters using convolution. The lecture also emphasizes the stability of FIR filters and their practical implementations in real-time systems.

Uploaded by

Hoàng Kiên
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
147 views28 pages

Chapter 5 - FIR Filters

This lecture covers Finite Impulse Response (FIR) filters, their significance in digital signal processing, and their applications in various fields. Key concepts include the differentiation between causal and non-causal FIR filters, the running-average filter, and the mathematical representation of FIR filters using convolution. The lecture also emphasizes the stability of FIR filters and their practical implementations in real-time systems.

Uploaded by

Hoàng Kiên
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ELEC2020: Signals and Information

Lecture 7: FIR and Linear Time-Invariant Systems I


LECTURE LEARNING OUTCOMES
By the end of this lecture, you should be able to:

Define Finite Impulse Response (FIR) filters and explain their significance in digital signal
processing.

Differentiate between causal and non-causal FIR filters and their practical implications.

Understand the running-average filter as a special case of FIR filters.

Describe the general FIR filter equation and how it applies weighted sums to input signals.

Explain unit impulse response and convolution in FIR filtering.

Analyze FIR filter applications in signal processing, telecommunications, and image processing.

2
INTRODUCTION TO FIR FILTERS
This chapter explores Finite Impulse Response (FIR) filters, a fundamental concept in digital signal
processing.

FIR filters are characterized by their finite-duration impulse response, making them inherently stable
and free from feedback.

Key topics covered in this chapter:

Unit impulse response and convolution – Understanding how FIR filters process signals.

Implementation of FIR filters – Examining block diagrams, multipliers, adders, and unit delay
elements.

Linear Time-Invariant (LTI) Systems – Exploring properties such as time invariance, linearity, and
convolution.

3
DISCRETE-TIME SYSTEMS
A discrete-time system is a computational process that transforms an input signal into an output
signal.

These systems are widely used in digital signal processing (DSP).

The system's behavior is typically represented using block diagrams.

Example Block Diagram:


𝒯
𝑥 𝑛 ՜ 𝑦 𝑛 where 𝒯 is the operator defining the transformation.

4
REPRESENTATION OF DISCRETE-TIME SYSTEMS
𝒯
The operation of a system is described by a mathematical mapping: 𝑥 𝑛 ՜ 𝑦 𝑛

The transformation 𝒯 can be defined by:

• Mathematical formulas
• Computational algorithms
• Difference equations
Example: Squaring System
𝑦 𝑛 = 𝑥[𝑛] 2

The output is simply the square of each input value.

5
MEMORYLESS VS. SYSTEMS WITH MEMORY
Memoryless System:

The output at any time depends only on the input at that same time.

Example: 𝑦[𝑛] = 2𝑥[𝑛]

System with Memory:

The output depends on past or future values of the input.

Example: 𝑦[𝑛] = 𝑥[𝑛] + 𝑥[𝑛 − 1]

Implication: Many real-world signal processing tasks involve memory-based systems.

6
THE RUNNING-AVERAGE FILTER
The running-average filter is a simple but effective way to smooth discrete-time signals.

It computes the average of two or more consecutive samples in a sequence, creating a new sequence
of averaged values.

This technique is commonly used in:

• Financial data smoothing (e.g., stock market prices)


• Credit-card balance calculations
• Noise reduction in signal processing
Key Concept: The running-average filter is a special case of Finite Impulse Response (FIR) filters.

7
3-POINT RUNNING AVERAGE
A 3-point running-average filter computes the average of three
consecutive input values:
1
𝑦[𝑛] = 𝑥[𝑛] + 𝑥[𝑛 + 1] + 𝑥[𝑛 + 2]
3
Here, the computed output at 𝑦[𝑛] depends on present sample: 𝑥[𝑛]
and future sample: 𝑥[𝑛 + 1]

Example: For 𝑥 = [2,4,6,4,2], the filter outputs is given by:


1 1
𝑦 −1 = 𝑥 −1 + 𝑥 0 + 𝑥[1 = 0 + 2 + 4 = 2
3 3
1 1
𝑦 0 = 𝑥 0 + 𝑥 1 + 𝑥[2] = 2 + 4 + 6 = 4
3 3
1 1
𝑦 1 = 𝑥 1 + 𝑥 2 + 𝑥[3] = (4 + 6 + 4) = 14/3
3 3

8
CAUSAL VS. NONCAUSAL RUNNING AVERAGE

Causal Running-Average Filter: Uses only present and past input values.
1
Example: 𝑦[𝑛] = (𝑥[𝑛] + 𝑥[𝑛 − 1] + 𝑥[𝑛 − 2])
3

Can be implemented in real-time systems.

Noncausal Running-Average Filter: Uses future values in computation.


1
Example: 𝑦[𝑛] = (𝑥[𝑛] + 𝑥[𝑛 + 1] + 𝑥[𝑛 + 2])
3

Not feasible for real-time applications.

Practical Consideration: Causal filters are preferred for real-world applications.

9
GENERAL CAUSAL FIR FILTER
A Finite Impulse Response (FIR) filter is a digital filter where the output is a finite weighted sum of
past and present input samples.

Key Equation of the General Causal FIR Filter:


𝑀

𝑦 𝑛 = ෍ 𝑏𝑘 𝑥 𝑛 − 𝑘 = 𝑏0 𝑥 𝑛 + 𝑏1 𝑥 𝑛 − 1 + ⋯ + 𝑏𝑀 𝑥[𝑛 − 𝑀]
𝑘=0

𝑥[𝑛] is the input signal, 𝑦[𝑛] is the output signal, ​ 𝑏𝑘 are the filter coefficients (weights), 𝑀 is the
filter order (M+1 is called filter length).
1
With the 3-point causal running average, 𝑀 = 2 and 𝑏𝑘 =
3

10
SLIDING WINDOW VISUALIZATION
How FIR Filtering Works?

The FIR filter applies a sliding window approach:

• The filter takes the current input sample and M previous samples.
• It applies the corresponding weights (𝑏𝑘 ).
• The sum produces the filtered output.

11
WEIGHTED RUNNING AVERAGE
In general FIR filters, the coefficients bk​ are not equal, resulting in a weighted average:
𝑦 𝑛 = 𝑏0 𝑥 𝑛 + 𝑏1 𝑥 𝑛 − 1 + ⋯ + 𝑏𝑀 𝑥[𝑛 − 𝑀]
Different weights allow for customized filtering, such as:

• Low-pass filtering (reducing high-frequency noise).


• High-pass filtering (emphasizing rapid changes in the signal).
Applications of FIR Filters

DSP: Noise reduction in EEG & ECG signals, and Smoothing stock market data in financial analysis.

Telecommunication and speech processing: Echo suppression in multipath propagation, and


Equalization in music production.

Image Processing: Edge detection and sharpening, and Noise filtering in medical imaging (CT, MRI).

12
EXAMPLE
In general, the FIR filter is completely defined once the set of filter coefficients {𝑏𝑘} are known.

For example, if the coefficients of a causal filter are


𝑏𝑘 = 𝑏0 , 𝑏1 , 𝑏2 , 𝑏3 = {3, −1, 2, 1}

then we have a length-4 filter with 𝑀 = 3, and filter difference equation is given as
3

𝑦 𝑛 = ෍ 𝑏𝑘 𝑥 𝑛 − 𝑘 = 𝑏0 𝑥 𝑛 + 𝑏1 𝑥 𝑛 − 1 + 𝑏2 𝑥[𝑛 − 2] + 𝑏3 𝑥[𝑛 − 3]
𝑘=0

= 3𝑥 𝑛 − 𝑥 𝑛 − 1 + 2𝑥 𝑛 − 2 + 𝑥[𝑛 − 3]

The parameter 𝑀 is the order of the FIR filter and the number of filter coefficients is also called the
filter length (𝐿 = 𝑀 + 1).

13
EXERCISE

14
EXAMPLE
Consider the signal

This signal, is the sum of exponential and sinusoidal components.


Consider the slowly varying exponential component as desired component and the sinusoidal as
noise or undesired (to be removed) component.
The outputs of 3-point running average given as

and 7-point running average given as , are shown in the next figure

15
EXAMPLE

16
UNIT IMPULSE RESPONSE & CONVOLUTION
In this section, we introduce three new ideas: the unit impulse sequence, the unit impulse response,
and the convolution sum.

We show that the impulse response provides a complete characterization of the FIR filter.

In addition, the convolution sum enables computing the output from the input when the unit impulse
response is known.

Unit Impulse Sequence: The unit impulse sequence is defined in term of Kronecker delta function

17
SEQUENCE REPRESENTATION USING 𝛿[𝑛]
The shifted impulse is a concept that is very useful in representing signals and systems.

For example, we can show that the formula

is equivalent to defining 𝑥[𝑛] by tabulating its five nonzero values

18
SEQUENCE REPRESENTATION USING 𝛿[𝑛]
This means that a sequence 𝑥[𝑛] can be represented as the sum of a scaled and shifted 𝛿[𝑛],
according to the following formula

19
UNIT IMPULSE RESPONSE OF CAUSAL FIR
The output of filter is often called the response to the input.

When the input is the unit impulse, 𝛿[𝑛], the output is called the unit impulse response, ℎ[𝑛].

The input-output relationship of causal FIR filter is given as


𝑀

𝑦 𝑛 = ෍ 𝑏𝑘 𝑥 𝑛 − 𝑘 = 𝑏0 𝑥 𝑛 + 𝑏1 𝑥 𝑛 − 1 + ⋯ + 𝑏𝑀 𝑥[𝑛 − 𝑀]
𝑘=0

By replacing 𝑥[𝑛] with 𝛿 𝑛 in the difference equation of a causal FIR,


𝑀

ℎ 𝑛 = ෍ 𝑏𝑘 𝛿 𝑛 − 𝑘 = 𝑏0 𝛿 𝑛 + 𝑏1 𝛿 𝑛 − 1 + ⋯ + 𝑏𝑀 𝛿[𝑛 − 𝑀]
𝑘=0

20
UNIT IMPULSE RESPONSE

In tabular for the impulse response 𝑀 − 𝑜𝑟𝑑𝑒𝑟 causal FIR is given as

The Impulse response of a 3 − 𝑝𝑜𝑖𝑛𝑡 𝑟𝑢𝑛𝑛𝑖𝑛𝑔 − 𝑎𝑣𝑒𝑟𝑎𝑔𝑒 filter, ℎ[𝑛] is shown below

21
THE UNIT-DELAY SYSTEM
One important system is the operator that performs a delay or shift by an amount 𝑛0

When 𝑛0 = 1, the system is called a unit delay.

The delay system is the simplest of FIR filters; it has only one nonzero coefficient.

Example: a system with 2-point delay has filter coefficients {𝑏𝑘 } = {0, 0, 1} and order 𝑀 = 2,
and its difference equation is

22
IMPULSE RESPONSE OF DELAY SYSTEM
The impulse response of the delay system by 𝑛0 is given as
ℎ 𝑛 = 𝛿[𝑛 − 𝑛0]

Thus for 2-point delay the impulse response is

Example: Delayed input signal by 2-points, 𝑦[𝑛] = 𝑥[𝑛 − 2].

{𝑏𝑘 } = {0, 0, 1}

23
FIR FILTER AND CONVOLUTION
Using the general expression for the FIR filter’s output, given as

Since the filter coefficients 𝒃𝒌 are identical to the impulse response values, we can replace 𝑏𝑘 by
ℎ[𝑘] to obtain

The above sum is called finite convolution sum and usually represented using star (*).

Thus input-output between relationship of the FIR filter can be expressed as 𝑦[𝑛] = 𝑥[𝑛] ∗ ℎ[𝑛].

24
FIR FILTER AND CONVOLUTION

Later, we will prove that convolution also applies to infinite-length sequences and has the
following form

This convolution sum has infinite limits to accommodate impulse responses of infinite
length, but reduces to

when ℎ[𝑛] = 0 for 𝑛 < 0 and 𝑛 > 𝑀, like in the FIR case.

25
COMPUTING THE OUTPUT OF A CONVOLUTION
The example below shows how to convolve 𝑥[𝑛] = {2, 4, 6, 4, 2} with ℎ[𝑛] = {3, −1, 2, 1}.

The first step is to write out the signal values of 𝑥[𝑛] and ℎ[𝑛] on separate rows.

Then, since ℎ[𝑛] = 0 for 𝑛 < 0 and 𝑛 > 3, we express the convolution formula as
3

𝑦 𝑛 = ෍ ℎ 𝑘 𝑥 𝑛 − 𝑘 = ℎ 0 𝑥 𝑛 + ℎ 1 𝑥 𝑛 − 1 + ℎ 2 𝑥 𝑛 − 2 + ℎ 3 𝑥[𝑛 − 3]
𝑘=0

26
LENGTH OF A CONVOLUTION
FIR filter is a system whose output is the convolution of the finite-length impulse response of the
system with the input to the system.

For FIR filter of length 𝐿ℎ = 𝑀 + 1 and an input sequence of length 𝐿𝑥 , the length of the output
sequence 𝑦 𝑛 = 𝑥 𝑛 ∗ ℎ[𝑛], is given as
𝐿𝑦 = 𝐿𝑥 + 𝐿ℎ − 1

Example:

𝐿𝑥 = 11 𝐿ℎ = 3 𝐿𝑦 = 11 + 3 − 1 = 13

27
CONCLUSION
Key Takeaways from the lecture
FIR Filters are characterized by a finite-duration impulse response, making them inherently stable.
The running-average filter is a simple FIR filter that smooths signals by averaging consecutive
samples.
Causal FIR filters depend only on past and present inputs, making them practical for real-time
applications.
The general FIR filter equation allows customization using different weight coefficients for filtering
purposes.
Unit impulse response and convolution provide a complete characterization of FIR filters and their
effect on input signals.
FIR filters are widely used in DSP, biomedical signal processing, telecommunications, and image
processing.

28

You might also like