Week 2 ECE-852 Pak Austria
Week 2 ECE-852 Pak Austria
1
Outline
• Introduction
• Review of DSP
• FIR Filter Theory
2
Introduction to Filtering
3
Introduction
• Finite Impulse Response (FIR) filters are commonplace in
digital signal processing (DSP) applications
• Suited for hardware implementation
• Implementable as highly optimized architecture.
• FIR filters are a linear transform on contiguous elements of a
signal.
• Maps well to data structures efficiently implemented in hardware.
• Two fundamental uses for a filter are signal restoration and
signal separation.
4
Applications of FIR filters
• Signal separation is more common use case
• Isolate the input signal into different parts e.g.,
• Low pass filters remove unwanted high frequencies
• Bandpass filters particular frequency band to demodulate
it, e.g., frequency shift keying demodulation
• Signal restoration relates to removing noise and other
distortion artifacts
• e.g., as data is being transmitted across the wireless
channel
5
Sampling
• A discrete signal can be generated by sampling a
continuous signal.
• The most familiar sampling is performed in time
• The values of continuous signal saved at discrete instances
• The values are called samples of the discrete signal
• Often sampled at regular intervals
• Sampling period and sampling frequency
6
Sampling
• Examples of Sampling:
• The voltage across an antenna to
capture the electromagnetic signal.
• The current created by a photo-
diode to determine the light
intensity.
• The photo-diode current at different
locations in an image sensor
consisting of an array to create a
digital image.
10
Mathematical Background
• The output (signal) of a system/filter to a unit impulse input (signal) is
its impulse response.
• Denoted as a vector h[]
• The values of h[] are also called filter coefficients
• The duration of the impulse response of an FIR filter is finite i.e.,
• It has only finite number of non-zero samples
• If we know the impulse response of an FIR filter, its output signal can
be computed for any input signal
• Through the process of convolution
• h[] of a linear, time invariant (LTI) filter completely characterizes it.
11
Mathematical Background
• The output can also be computed in other ways
• e.g., frequency domain
• Here we will focus on computing in the time domain
• The convolution of impulse response of an N-tap FIR filter, h[], with an
input signal, x[]
• Described by the general difference equation:
12
13
Mathematical Background
• Unit impulse and general discrete signals
14
15
16
Mathematical Background
• Linearity and time invariance
17
18
19
Mathematical Background
• The convolution sum
20
21
FIR Filter Example (Moving Average Filter)
• Moving average filters are:
• simple form of lowpass FIR filter
• all the coefficients are identical and sum to one
• E.g., for a three-point moving filter h[] = [ 1/3 , 1/3 , 1/3 ]
• Average of several adjacent samples of the input signal.
22
FIR Filter Example (Moving Average Filter)
• The output of a general N-point moving average filter is:
23
Moving Average Filter
• Used to smooth out a signal
• To remove random (mostly high frequency) noise.
• As N gets larger
• Average is over a larger number of samples
• More computations.
24
Moving Average Filter
• Larger values of N correspond to reducing the bandwidth of
the output signal.
• Like a low pass filter (though not a very optimal one).
• Average over larger number of samples eliminates higher
frequency variations in the input signal
• “smoothing" is equivalent to reducing higher frequencies.
25
h[] for moving average filter
26
FIR Filters Design vs implementation
• Filter coefficients can be crafted to create variety of
filters:
• low pass, high pass, band pass, etc..
• A larger number of taps/coefficients
• Provides more degrees of freedom when designing a filter
• Generally, results in filters with better characteristics.
27
FIR Filters Design vs implementation
• Huge literature devoted to generating filter coefficients
for a given application
• We will not design filters but look at their implementation
• During filter implementation:
• The actual values of these coefficients mostly irrelevant
• The way these coefficients were found, is ignored
28
Manual Optimizations in FIR Filters
• However, the structure/pattern can impact the implementation E.g.,
• Structure of moving average filter, (coefficients) impact the number of
operations
• Symmetric filters have multiple taps with the same value which can be
grouped to reduce the number of multiplications
• Convert multiplication by constant coefficients into shift and add operations
• Coefficients values can drastically change the performance and area of the
filter implementations
• Ignore these optimizations for now
• Focus on generating architectures that have constant coefficients
• Do not take advantage of the values of the constants
29