Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

Digital Signal Processing

FIR Filtering and Convolution


Dr. Dung Trung Vo
Telecommunication Divisions
Department of Electrical and Electronics

September, 2013

Practical DSP methods

 Two basic classes:

 Block processing methods: data are collected and processed in blocks.


Some typical applications include:
- FIR filtering of finite-duration signals by convolution
- Fast convolution of long signals broken up in short segments
- DFT/FFT spectrum computations
- Speech analysis and synthesis
- Image processing

 Sample processing methods: data are processed one at a time—with


each input sample is transforms into an output sample. Some typical
applications include real-time applications:
- Realtime filtering of long signals
- Digital audio effects processing
- Digital control systems
- Adaptive signal processing

 Functional mapping:

 Linear systems: this mapping becomes a linear transformation


CuuDuongThanCong.com https://fb.com/tailieudientucntt
1
FIR filtering applications

 Chapter focus: consider block processing and sample processing methods for
FIR filtering applications

 Discuss computational aspects of the convolution equations

 Present various equivalent forms of convolution:


- Direct form
- Convolution table
- LTI form
- Matrix form
- Flip-and-slide form
- Overlap-add block convolution form.

Block Processing Methods - Convolution

 Finite set of samples:

 Duration of the data:

where T is the sampling time interval

 Number of time samples L:

CuuDuongThanCong.com https://fb.com/tailieudientucntt
2
Block Processing Methods – Convolution - cont

 Input block: is L collected signal samples:

 Direct and LTI forms of convolution:

 Sum of the indices notice:

 Convolution table form:

Block Processing Methods – Direct Form

 Block of impulse response: Consider a causal FIR filter of order M with impulse
response h(n), n = 0, 1, . . . , M:

 Filter’s length:

 Index determination requirement:


(i) the range of values of the output index n, and
(ii) the precise range of summation in m

 Range of indices h(m):

 Range of indices x(n − m):


or
or

This is the index range of the output sequence y(n)

CuuDuongThanCong.com https://fb.com/tailieudientucntt
3
Block Processing Methods – Direct Form - cont

 Output sequence:

 Output length:

where

y is longer than the input x by M samples, follows from the fact that a filter of order
M has memory M

 Relative lengths of filter, input, and output blocks:

Block Processing Methods – Direct Form - cont

 Filter index’s range:

or

 Direct form of convolution:

for n = 0, 1, . . . , L+M−1.

 Compact notation:

CuuDuongThanCong.com https://fb.com/tailieudientucntt
4
Block Processing Methods – Direct Form - cont

 Example: consider the case of an order-3 filter and a length-5 input signal

output length:

convolutional equation:

for example, at n = 5:

Block Processing Methods – Direct Form - cont

 All output samples:

CuuDuongThanCong.com https://fb.com/tailieudientucntt
5
Block Processing Methods – Convolution Table

 Note: each output yn is the sum of all possible products hixj with i + j = n
 Convolution table:

 Calculation: entries within each antidiagonal strip are summed together to form
the corresponding output value:

The convolution table is convenient for quick calculation by hand because it displays
all required operations compactly

Block Processing Methods – Convolution Table - cont

 Example: calculate the convolution of the following filter and input signals

Solution:

CuuDuongThanCong.com https://fb.com/tailieudientucntt
6
Block Processing Methods – LTI Form

 Input: as a linear combination of delayed impulses

or

 Output:

Block Processing Methods – LTI Form - cont

 Blocks of input and output signals:

 Linear combinations of right-hand side:

CuuDuongThanCong.com https://fb.com/tailieudientucntt
7
Block Processing Methods – LTI Form - cont

 LTI form of convolution:

 Calculation: the rows of the table correspond to the successive delays (right
shifts) of the h sequence—the mth row corresponds to delay by m units. Each row is
scaled by the corresponding input sample, that is, the mth row represents the term
xmhn-m in the LTI form. After the table is filled, the table entries are summed
column-wise to obtain the output samples y(n)

Block Processing Methods – LTI Form - cont

 Example: calculate the convolution of the following filter and input signals

Solution:

CuuDuongThanCong.com https://fb.com/tailieudientucntt
8
Block Processing Methods – Matrix Form

 Linear matrix form:

 Filter matrix H: must be rectangular with dimensions

 Matrix form: columns of H are the successively delayed replicas of the impulse
response vector h. H is Toeplitz matrix, which has the same entry along each
diagonal

Block Processing Methods – Matrix Form Form - cont

 Example: calculate the convolution using the matrix form

Solution:

CuuDuongThanCong.com https://fb.com/tailieudientucntt
9
Block Processing Methods – Matrix Form

 Alternative matrix form:

 Compact form:

 Data matrix X dimension:

Block Processing Methods – Matrix Form Form - cont

 Example: calculate the convolution using the matrix form

Solution:

CuuDuongThanCong.com https://fb.com/tailieudientucntt
10
Block Processing Methods – Flip-and-Slide Form

 Flip-and-slide form of convolution: filter h(n) is flipped around or reversed


and then slid over the input data sequence

 Calculation: output sample is obtained by computing the dot product of the


flipped filter vector h with the M+1 input samples aligned below it. The input
sequence is assumed to have been extended by padding M zeros to its left and to
its right.

Block Processing Methods – Flip-and-Slide Form - cont

 Input-on transient: At time n = 0, the only nonzero contribution to the dot


product comes from h0 and x0 which are time aligned. It takes the filter M time units
before it is completely over the nonzero portion of the input sequence. The first M
outputs correspond to the input-on transient behavior of the filter

 Steady-state: for a period of time M ≤ n ≤ L−1, the filter remains completely


over the nonzero portion of the input data, and the outputs are given by the form

 Input-off transients: During this period the filter slides over the last M zeros
padded at the end of the input

CuuDuongThanCong.com https://fb.com/tailieudientucntt
11
Block Processing Methods – Transient and Steady-
State Behavior
 Time index n range:

 Three subranges:

 Transient and steady-state filter outputs:

Block Processing Methods – Transient and Steady-


State Behavior
 LTI form:

 Transient and steady-state filter outputs:

CuuDuongThanCong.com https://fb.com/tailieudientucntt
12
Block Processing Methods – Convolution of Infinite
Sequences
 LTI form:

 Three cases of infinite Sequences:


1. Infinite filter, finite input; i.e., M =∞, L < ∞.
2. Finite filter, infinite input; i.e.,M <∞, L=∞.
3. Infinite filter, infinite input; i.e., M =∞, L=∞.
 Output of these three cases of infinite Sequences:

Block Processing Methods – Convolution of Infinite


Sequences
 Example: An IIR filter has impulse response h(n)= (0.75)nu(n). Using
convolution, derive closed-form expressions for the output signal y(n) when the
input is:
(a) A unit step, x(n)= u(n).
(b) An alternating step, x(n)= (−1)nu(n).
(c) A square pulse of duration L = 25 samples, x(n)= u(n)−u(n − 25).
In each case, determine the steady-state response of the filter.

 Solution:

CuuDuongThanCong.com https://fb.com/tailieudientucntt
13
Block Processing Methods – Overlap-Add Block
Convolution Method
 Infinite or extremely long input: divide the long input into contiguous non-
overlapping blocks of manageable length, say L samples, then filter each block and
piece the output blocks together to obtain the overall output:

Block Processing Methods – Overlap-Add Block


Convolution Method
 Example: calculate the convolution using the matrix form

using the overlap-add method of block convolution. Use input blocks of length L =
3. Perform the required individual convolutions of using the convolution table
Solution:

CuuDuongThanCong.com https://fb.com/tailieudientucntt
14
Block Processing Methods – Form Advantages

 Form advantages:

 LTI form is of fundamental importance because it incorporates the


consequences of linearity and time invariance;

 Direct form leads directly to block diagram realizations of the filter and the
corresponding sample-by-sample processing algorithms;

 Convolution table is convenient for quick computations by hand;

 Flip-and-slide form shows clearly the input-on and input-off transient and
steady-state behavior of a filter;

 Matrix form provides a compact vectorial representation of the filtering


operation and is widely used in some applications such as image processing;

 Overlap-add form is used whenever the input is extremely long or infinite in


duration.

Sample Processing Methods – FIR direct form

 Basic building blocks of DSP systems:

 Single delay:

 Internal state of the filter

CuuDuongThanCong.com https://fb.com/tailieudientucntt
15
Sample Processing Methods – FIR direct form

 Two processing steps:

 Table of values:

 Output:

Sample Processing Methods – FIR direct form

 Double delay:

 I/O equations:

 Table of values:

CuuDuongThanCong.com https://fb.com/tailieudientucntt
16
Sample Processing Methods – FIR direct form

 D unit delay:

 I/O equations:

Sample Processing Methods – FIR direct form

 I/O equation of a third-order filter:

In order to mechanize this equation, we need to use an adder to accumulate the


sum of products in the right-hand side; we need multipliers to implement the
multiplications by the filter weights; and, we need delays to implement the delayed
terms x(n − 1), x(n − 2), x(n − 3)

CuuDuongThanCong.com https://fb.com/tailieudientucntt
17
Sample Processing Methods – FIR direct form

 Three internal states w1(n), w2(n), w3(n):

Output:

Sample Processing Methods – FIR direct form

 I/O equation:

 Block diagram form

CuuDuongThanCong.com https://fb.com/tailieudientucntt
18
Sample Processing Methods – FIR direct form

 Direct form realization of Mth order filter:

Sample Processing Methods – FIR direct form

 Example: Determine the sample processing algorithm which had filter and input

Then, using the algorithm compute the corresponding output, including the input-off
transients.

Solution:

CuuDuongThanCong.com https://fb.com/tailieudientucntt
19
Sample Processing Methods – FIR direct form

 Example: Determine the sample processing algorithm of Example 4.1.1, which


had filter and input

Then, using the algorithm compute the corresponding output, including the input-off
transients.

Solution:

Stability

 Homework: provided in class

CuuDuongThanCong.com https://fb.com/tailieudientucntt
20

You might also like