The ST10F2xx family provides a 16-bit multiply and accumulate unit (MAC) allowing control-oriented
signal processing and filtering widely used in digital applications.
An ST10 DSP software library, developed by STMicroelectronics, contains a set of basic arithmetic
operations such as multiplication as we ll as two main filter functions , FIR (finite impulse response) and IIR
(infinite impulse response), mainly used in digital signal processing.
The first chapter of this application note describes a theoretical digital implementation of four different
filters:
■ Low-pass filter
■ High-pass filter
■ Passband filter
■ Cut-band filter
The method adopted for each filter is th e approximation of the ideal filter model by a FIR filter . This th eory
aims to compute the FIR’s coefficients by truncating the real signal with a known window.
The second chapter illustrates a practical implementation of a low-pass filter using the ST10 DSP library,
its results and its limitations.
The ST10 DSP free library is a set of arithmetic and signal processing functions based on the
ST10 MAC unit. These functions are callable from C and fully compatible with the Tasking
compiler.
This library manipulates signed integers coded on 16 or 32 bits. These integers represent
numbers belonging to the interval [–1, 1[. We name these formats: Q1.31 and Q1.15.
For a detailed description of the ST10 DSP libra ry, please refer to the application note AN1442
“Signal processing with ST10-DSP”.
3/18
Digital filtering principlesAN2182
2 Digital filtering principles
Assume a continuous signal x(t) (the complex form corresponds to the signal’s phase and
magnitude at the instant t) with a pass band B. Assume that this signal will be filtered using a
filter with a continuous impulse response h(t).
When digital processing has to be used, it is necessary to sample the input signal with a
frequency of F
from the samples obtained at the filter’s output.
Figure 1.Example of input and output signals
Input signal Output signal
The Shannon theorem states that when sampling a signal at discrete intervals, the sampling
frequency F
= 1/Ts (Ts being the sampling period). The output signal is then reconstituted
s
Filter h
should be greater than twice the highest frequency of the input signal.
s
2.1 Fourier transform of a sampled signal
Signals are converted from the time domain to the frequency domain usually through the
Fourier transf orm. With the Fo urier transf orm, the signal is conv erted to a magnitude and pha se
at each frequency.
The Fourier transform of the sampled signal x(k) has the following expression:
∞
Xf()xk()e
=
∑
The time representation can be computed f rom the X(f) as follows:
=
xk()Xf()e
i2kπf
∞–
∞
i– 2kπf
∑
∞–
2.2 Linear filtering
Using the notations defined in the previous section, the output signal y(n) is the convolution of
the input signal x(k) and the filter impulse response h(k) .
yn()hn k–()xk()
∞
==
∑
∞–
hk() xk()⊗()
n
where x(n) = x(nT
4/18
), h(n – k) = h((n – k)Ts) and y(n) = y(nTs).
s
AN2182Digital filtering principles
The output signal frequency response is given by the following expression:
Yf()Hf() Xf()⋅=
where H(f), X(f) and Y(f) are the respective Fourier transforms of h(k), x(k) and y(k).
2.3 Finite impulse response filters
The FIR (Finite Impulse Response) a re non-recu rsiv e filters , mean ing that the outp ut signal y( i)
is a linear combination of N input samples x(k) in the case of a N–1 order filte r. Its equation is
N1–
⎛⎞
yn()akxn k–()
⎜⎟
=
∑
⎜⎟
⎝⎠
k0=
where a
are the FIR’s coefficients.
k
A FIR filter is characterized by its order and its coefficients and can be used to implement any
kinds of filters (low-pass, high-pass, pass-band or cutoff band).
5/18
Low-pass filterAN2182
3 Low-pass filter
The aim of this section is to create a low-pass filter with a cutoff frequency Fc and a gain G = 1,
by determining a FIR filter using the digital approach. The FIR coefficien ts correspond to h(n)
where h is its continuous time response and h(n) = h(nT
In the frequency domain, the ideal filter corresponding to these criteria has the following
response:
Figure 2.Ideal low-pass filter frequency response
Magnitude
1
).
s
-F
c
F
0
c
This filter’s impulse response in the time domain is
∞
(1)
ht()Hf()e
∫
This response is sampled with a rate F
2πift
fd
2Fcc2tF
∞–
()sin==
c
= 1/Ts (sampling frequency), so the discrete response
s
has the followi ng expression
∞
( 2)
hst()hnTs()δtnT
=
∑
∞–
The impact of sampling h(t) with a rate F
around F
and a gain of Fs. In fact, the frequency response corresponding to the sampled
s
–()
s
is a periodization of the analog signal spectrum
s
impulse response is
∞
Hsf()FsHf nF
=
Therefore , t o obtain a gain o f 1, t he h
–()
∑
∞–
s
response filter should be divided by Fs. Using equations
s
(1) and (2), the low-pass filter time response becomes:
∞
F
(3)
hst()2
=
c
------c 2 n FcT
∑
F
s
∞–
()δtns–()sin
s
Frequency
The impulse response is a sinus cardinal (sinc) function centered at the origin.
6/18
Loading...
+ 12 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.