FIR Filters
Sources:
- James McClellan, Ronald Schafer & Mark Yoder. (2015). FIR Filters. DSP First (2nd ed., pp. 147-193). Pearson.
Discrete-Time Systems
Sequence: a discrete-time signal1.
Discrete-time system or filter2: a function for transforming one sequence, called the input signal, into another sequence called the output signal.
In general, we represent the operation of a discrete-time system by the notation
: input sequence : output sequence : the operator, aka computational process, mapping or function.
The Running-Average Filter
A running average or moving average system: the output is the average of some consecutive values of the input. Such as
You can also define a running average as , or whatever.The equation like
is called a difference equation. It is a complete description of the FIR system because we can use to compute the entire output signal for all index values .A filter that uses only the present and past values of the input is called a causal filter. Thus
is a causal running average.
Example
For a input sequence

we define an output sequence
with
The General FIR Filter
Definition
We define a
- FIR system: Finite Input Response system. Because the impulse response sequence
is finite(Illustrated later). can be infinite since can be infinte: . But for FIR, the must be finite.
- The 3-point noncausal running average
is the case where and in . - the coefficients
are fixed numbers. - According to
, an FIR filter is causal.- Note that a noncausal system can be represented by altering
to include negative values of the summation index .
- Note that a noncausal system can be represented by altering
- Usually the
coefficients are not all the same, and then we say that is "weighted". - It follows from
that the computation of involves the samples for (i.e., , etc):
A second defnition:
which can be extended to
Example
Figure 5.4 llustrates how the causal FIR filter uses

- the weighted average is calculated over the (gray) sliding window of
samples. - When the input signal
has finite length ( samples), the sliding window runs onto and off of the input data, so the resulting output signal also has finite length.
The Unit Impulse Response and 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, because the convolution sum gives a formula for computing the output from the input when the unit impulse response is known.
Unit Impulse Sequence
The unit impulse:
This notation is also known as the Kronecker delta function.
Shifted Unit Impulse Sequence
Here is the tabular of

For a shifted unit impulse such as
The shifted impulse is a concept that is very useful in representing signals and systems. For example, we can show that the formula

It turns out that any sequence3 can be represented by a sum of scaled shifted impulses . The equation
Unit Impulse Response Sequence
The output from a filter is often called the response to the input.
When the input is the unit impulse,
, the output is called the unit impulse response (Or impulse response, with unit being understood).Notation of unit impulse response:
.When the input to the FIR filter
is a unit impulse sequence, , the output is the (unit) impulse response . Substituting in gives the output :Note that because each
is nonzero only when , or , the impulse response is:In other words, the impulse response
of the FIR filter is identical to the sequence of difference equation coefficients. So the FIR filter is completely defined by the impulse response.- In following chapter, we'll show that this characterization is also true for the much broader class of linear time-invariant (LTI) systems.
Since
for and for , the "length"4 of the impulse response sequence is finite. This is why the system is called a FIR system.
The Unit-Delay System
One important system is the operator that performs a delay or shift by an amount
When
The delay system is actually the simplest of FIR filters.
The impulse response of the delay system is obtained by substituting
for . is a delay-by-2 system with coefficients , its impulse response is:
FIR Filters and Convolution
Since the filter coefficients in
The terminology convolution emphasizes that it's an operation between two sequences.
We use a star
to represent the operation of evaluating (5.13) for by writing which is read as "the output sequence is obtained by convolving the impulse response with the input sequence ."
Later, in Section 5-7, we will prove that convolution is the fundamental input-output algorithm for a large class of very useful filters that includes FIR filters as a special case. We will show that a general form of convolution that also applies to infinite-length signals is
This convolution sum
The Length of a Convolution
If
通俗地说,
以下面example为例,
而convolution是从下标0开始的(
When the signals start at
Example

Given impulse response
The output
Filtering the Unit-Step Signal
In previous sections, we have described the FIR filtering of finite-length signals.
But the input signal can also have infinite duration.
An example is the unit-step signal which is zero for
The symbol
So when we want the input signal to be the unit step we write
Property of Convolution
convolution is:
- commutative:
//Proof: TODO
See↩︎
Strictly speaking, a filter is a system that is designed to remove some component or modify some characteristic of a signal, but often the two terms are used interchangeably.↩︎
Remember that a sequence is a discrete-time signal.↩︎
这里所谓"length"指的是support set的长度. n可以是无限的, 因此
也可以是无限的. 但是它们的suport set未必无限. 特别是 的长度已经被 固定为 .↩︎