0% found this document useful (0 votes)
2 views

Lecture24 Signal Proc

The document discusses signal processing in embedded systems, focusing on the use of filters to enhance and analyze digital signals. It explains the types of filters, their characteristics, and how they can be implemented, particularly highlighting Finite Impulse Response (FIR) and Infinite Impulse Response (IIR) filters. Additionally, it covers the application of moving average filters for noise reduction and the optimization of filter algorithms for efficient computation.
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)
2 views

Lecture24 Signal Proc

The document discusses signal processing in embedded systems, focusing on the use of filters to enhance and analyze digital signals. It explains the types of filters, their characteristics, and how they can be implemented, particularly highlighting Finite Impulse Response (FIR) and Infinite Impulse Response (IIR) filters. Additionally, it covers the application of moving average filters for noise reduction and the optimization of filter algorithms for efficient computation.
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
You are on page 1/ 16

Charles W.

Davidson College of Engineering


Department of Computer Engineering

Real-Time Embedded System


Co-Design
CMPE 146 Section 1
Spring 2025
Signal Processing

2
Signal Processing

• In many embedded applications, we periodically sample a sensor’s output


to produce a time-series digital signal (basically a sequence of numbers)
• Then we process those numbers with a software algorithm to enhance,
modify, or analyze the signal to extract specific information
• During the process, we quite often apply a filter using mathematical
techniques to modify the signal to another form

Original Signal Filtered Signal

Filter

3
Filter

• Filters have two general purposes


• Separation of signals that have been combined
– Example 1: Taking the ECG (Electrocardiogram) of the heart
• also captures breathing activities
– Example 2: Sampling a light sensor’s output in a sensitive instrument
• may also captures other activities: 60-Hz AC power line, 100-kHz switching power
supply, 680-kHz broadcast from a local AM radio station

• Restoration of signals that have been distorted in some way


– Example: Audio recording made with low-quality equipment may be filtered to
better represent the sound as it actually occurred

4
Signal Components

• Any periodic waveform can be expressed in a Fourier series

• A signal’s waveform can be viewed as being composed of sinusoids of


different amplitudes and frequencies
– The entire signal can be considered as a summation of many sine and cosine
waves, and a DC offset (a0 )
– The an and bn coefficients are amplitudes of the cosine and sine waves,
respectively
– Each individual frequency is a multiple of the fundamental frequency, ω0

• With a signal broken down into individual frequency components, it is quite


often easier to analyze it in the frequency domain, rather in the time
domain
• A filter can be viewed as a tool to change the amplitudes of certain
frequency components
• A filter’s characteristics can be defined by its responses to various
frequencies in the input signal
5
Filter Frequency Response

• Example: A low-pass filter that removes the high-frequency components of


the input signal
Gain vs. Frequency

Gain

Frequency (Hz)

Original Signal Filter Filtered Signal

Filter
6
Filter Characteristics
• The frequency spectrum is divided into three regions
– Passband
• The filter should pass its input signal through to its output with unit gain
• Defined by the cutoff frequency where the gain is 0.707 (where the power of signal
is halved), or -3 dB
– Stopband
• The filter does not let its input signal pass through
• Defined by the frequency where the gain starts to drop below 0.1
– Transition band
• A transition region between passband and stopband; the narrower, the better
Low-pass Filter
1
0.7

Gain

0.1

0 fc fs/2 Frequency

7
Filter Types

• Filters are designed for a specific purpose


• Four common types:
– Low-pass, high-pass, band-pass, band-stop

Low-pass Band-pass

Gain Gain

High-pass Band-stop

Gain Gain

8
Filter Formation

• With the basic low-pass design, it can be used to construct other types
• High-pass
– Original signal – low-passed original signal = high-passed signal
All-pass Low-pass High-pass

- =
• Band-pass
– Pass original signal through a low-pass then a high-pass (with lower cutoff
frequency)

=
Low-pass High-pass Band-pass


• Band-stop
– Low-passed original signal + high-passed original signal = band-stopped signal
Low-pass High-pass Band-stop

+ = 9
Filter Implementation

• There are two classes of filters that can be implemented on a computer


– Finite Impulse Response (FIR)
– Infinite Impulse Response (IIR)

• Mathematical equations
– IIR filter

– FIR filter

– x is the input signal and y is the filtered signal


– a and b are weighting factors on the output and input values, respectively
– The number of terms used on x minus one is the order of the filter
• Higher order means narrower transition band (good) but slower computation (bad)

• IIR filters use some of the filter’s output as input


– A feedback loop exists 10
Common FIR Filters

• 28th Order low-pass filter (29 coefficients)


• Cutoff frequency = 5 kHz

11
Moving Average Filter

• Also known as Rectangular filter, the most commonly used filter in digital
signal processing
– Very easy to understand and use
– Optimal for reducing random noise

• Very useful for many applications!


• Mathematical equation:

– Note that all coefficients are the same


• For example, for a 5-point (M=5) moving average filter, point 80 in the
output signal is given by:

• Alternatively, the group of points from the input signal can be chosen
symmetrically around the output point (j=-(M-1)/2 to (M-1)/2):

12
Random Noise Filtering

• Example: A rectangular pulse is buried in random noise


• A 11-point filter greatly reduces the noise and makes the pulse stand out

13
Random Noise Filtering (cont’d)

• A 51-point filter reduces the noise even further


• As the number of points in the filter
increases, the noise becomes lower
– But edges become less sharp

• The filter is the optimal solution for


providing the lowest random noise
possible
• Since the noise is random, it makes
sense to have all coefficients with equal
value (or weight)
– It is useless to give preferential treatment to any one of the input points by
assigning it a larger coefficient
• The amount of noise reduction is equal to the square-root of the number of
points in the average
– For example, a 100-point moving average filter reduces the noise by a factor of
10
14
Frequency Response

• Transition band is wide


• Stopband attenuation is not quite uniform
• Passband is narrow, not an ideal low-pass filter
• Using the filter multiple times can improve the situation
– Effectively making the coefficients not equal and closer to other filter types
15
Implementation

• A tremendous advantage of the filter is that it can be implemented with an


algorithm that is very fast
• Let’s look at one example of a 7-point filter
• Two adjacent output points, y[50] and y[51], are computed as

• Notice that the two calculations are nearly the same


– Points x[48] through x[53] are added for y[50], and again for y[51]

• Calculation of y[51] can be optimized as

• This algorithm saves a lot of computations


– Only two operations per point, no matter how large the filter is!
– No multiplication is needed
– No floating point arithmetic is needed
• Most other filters’ coefficients must be represented by floating point numbers 16

You might also like