Content uploaded by Safwan Arekat
Author content
All content in this area was uploaded by Safwan Arekat on Jun 19, 2021
Content may be subject to copyright.
1
Mathematical Techniques for Digital Filtering
FIR Filter Symmetry Theory
Dr. Safwan Arekat
s.r.arekat@gmail.com
Introduction
In this article we derive, discuss and apply an alternative formulation for the finite impulse response
(FIR) filter theory. The intention is to develop equations and methods that facilitate a conceptual
framework for comprehending the effect of the general complex filter impulse response symmetry,
phase and relative strength on the frequency magnitude and phase response of the FIR filter.
It is well known that the transfer function of the FIR filter has the form of a Discrete Time Fourier
Transform (DTFT) of the finite impulse response of the filter. In this form, the transfer function is
mathematically straightforward as the sum of complex sinusoids of increasing frequency, modulated
by the coefficients of the impulse response of the filter. Although the formula is simple to write,
program and use, it has the disadvantage of providing very little insight into the way the individual
complex sinusoids superpose and interfere together to give rise to the overall frequency response.
Although simplifying the math considerably, the unavoidable complex formulation itself hinders the
quest for a more intuitive understanding of the subject. The most advanced methods of filter design
involve numerical optimization techniques to achieve a set of desired filter characteristics, with little
emphasis on the shape of the optimal filter coefficients. For example, there is little
investigation, or even concern, for how the optimized Parks-McClellan coefficients for a low pass
filter differ from those of the ideal Sinc impulse response coefficients, and how this difference results
in improving the frequency response.
We shall see that the formulation herein contributes to harnessing some intuitive conclusions, even
within the midst of the complex formulation. The new formulation sheds light on the often-confusing
relationship between the symmetry of the frequency response and the nature of the impulse
response (real vs. complex). In addition, the formulation invites novel methods for designing FIR
filters. We shall start with a review of the conventional theory, and then derive the new equations.
The reader familiar with the theory and the terminology of the DTFT and FIR digital filter may skip
to the novel equations directly, and the discussion that follow. However, it is worthwhile to spend
time considering the frequency response oscillations section, since it provides the motivation for the
material that follow. Discrete Time Fourier Transform (DTFT)
The Fourier transform of a square integrable continuous time signal is given as :
This is called the Analysis Equation. The frequency is a real number, and in general, both and
are non-periodic square integrable complex functions. The Inverse Fourier Transform, which
is called the Synthesis Equation is given by
2
Let the signal be a discrete time signal given by an infinite sequence of periodic pulses occurring
at time instances that are integer multiples of the sampling time ,
Substituting this into the definition of the Fourier transform above gives
becoming
This equation defines the Discrete Time Fourier Transform (DTFT).
of multiplying both sides by and integrating from
, we can obtain the Inverse Discrete
Time Fourier Transform (synthesis equation) become
Some properties of the DTFT:
a) The time spectrum is discrete.
b) The frequency spectrum is continuous.
c) Unlike the regular continuous time Fourier transform, the DTFT is periodic in
frequency space with period
. This happens because is now a discrete sum of
scaled frequencies. Each term in the sum has the periodicity stated above, so the entire sum
has this same periodicity. This can be shown as:
This will make it clear why the frequency response of any digital filter is periodic although the filter
does not work for frequencies higher than the Nyquist frequency, which is half the sampling
frequency. This periodicity will allow us to cast the FIR filter and its theory in a new light.
Comparing DTFT and Fourier Series
The Fourier Series theory allows any complex continuous time periodic function with period T,
to be represented by the complex series:
with
3
Using
, we can rewrite this as:
So, in contrast to the DTFT, the Fourier series deals with continuous time signals but a discrete
frequency spectrum.
We wish to compare these equations to the DTFT equations stated earlier,
Since has a discrete spectrum, integer n is sufficient for identifying the particular impulse, so
we can rewrite as . Also by using
we can rewrite the DTFT equations as:
Comparing these DTFT with the rewritten equations for the Fourier series from above, we find that
the equations have similar form, but with switched roles. The analysis equation for in the DTFT
becomes a synthesis equation for a Fourier series in continuous frequency space. And the synthesis
equation of the DTFT becomes very similar to the analysis equations giving the coefficients for the
Fourier series (discrete Fourier spectrum). The sign of the exponent is reversed in the equations, but
it is well known that the exponent sign in the complex Fourier series formulation is only a matter of
convention. The major difference is the extra factor of T appearing in the integral.
For the case when (i.e. the standard case of normalized frequency, ), the equations
simplify to
corresponding to exactly a Fourier series construction of the periodic frequency signal in frequency
space with the discrete time impulses as series coefficients.
The motivation behind this comparison and analogy is to set the stage for the major proposal in this
article: It is possible to construct the periodic continuous frequency response of the DTFT in a
4
manner just like a continuous periodic time signal is synthesized from its discrete Fourier
components. As we shall see, the discrete time impulses, taken in pairs, can produce, in the frequency
spectrum, well defined oscillations with controllable discrete periods. These superpose with each
other to produce the overall frequency amplitude and phase response.
Signal Truncation and Causality
The need for truncation arises from practical considerations where only a finite number of time
pulses can be modelled. The need for causality arises only for real-time processing, as future values
of the signal are not available yet in real time processing.
The DTFT for a truncated and causal discrete time signal becomes (for T=1):
The same equation for is used to obtain the time coefficients.
The problem with these expressions is that they are one sided, lacking the symmetry in the synthesis
equation to be identified as a superposition of coherent oscillations (Fourier series). We will discuss
the symmetrizing of this equation in more detail later.
The FIR Filter
We concentrate on the finite impulse response (FIR) non-recursive method for filtering. Consider
the equation (called difference equation or time domain response). A signal is produced by the linear
superposition of the input signal from its present value, and multiple past values as
where is the output signal at the present time , is the input signal at time instant,
and are multipliers called FIR coefficients (real or complex). The output is recalculated at regular
time intervals T, at a sampling frequency of
. This is an FIR filter of order M, with M+1 terms
in the sum.
To study the resulting frequency response, a discrete z-transform of the equation is taken, it becomes:
The transfer function can be written as:
5
The transfer function gives complete information on the relation between output and input and
the frequency and phase response. Here at steady state conditions, and we can find the
frequency dependence of , is the amplitude response, and is the phase response.
They can be calculated as:
1) DTFT Construction of the Causal Transfer Function
A causal FIR filter with coefficients and order , has the general z-transfer function
This has the form of a DTFT,
Let be the desired filter magnitude and phase response.
Rewriting we get
Applying Fourier trick, the left hand side is zero except for the case , herewith
, with , give:
and with , , the integral transforms into
The integral transforms into a sum for a discrete sampling of and
These equations can be used to design filters by specifying and and solving for . But
as stated in the introduction, does not offer much insight to the magnitudes and symmetries of the
resulting coefficients.
6
Frequency-Response Oscillations
It was already elaborated that the equation
could be thought of as a Fourier
series synthesis equation in continuous frequency space, with the frequency response being
constructed from oscillations defined by the filter coefficients. Because of truncation, the Fourier
series has only a finite number of components (M+1). For a desired frequency response , we
can attempt to find that give this response. To be sure, any transfer function that is the z-
transform of an input-output difference equation with either zeros, poles or both, can be modelled.
But success in getting the coefficients that give the specified response is not always guaranteed, since
not any arbitrarily specified pair of magnitude and phase functions are simultaneously realizable.
Even though the same magnitude response could be obtained with different phase responses, still,
there exists only a limited class of phase functions that allow for this. An example is the phase
responses of the minimum phase, maximum phase and li
response having been properly designed. The Hilbert transform method accounts for the magnitude-
phase correlation of the asymmetric filter. However, this technique is not familiar to many, and one
still wonders if easier methods exists.
So, the coefficients defines which frequency-response oscillations are present. The following
discussion arranges the coefficients into singlets and symmetric and antisymmetric doublets to help
understand the role of the coefficients in the construction. Each one of these coefficient
configurations produces a signature oscillation, and constitute an orthogonal basis system from
which more complex frequency responses can be constructed (e.g. low pass, bandpass, notch etc.)
Singlet Impulse
Singlets appear in odd M filters (filter length M+1). It is the center tap itself, so it simply is an all-pass
filter, with a delay of
seconds (or samples). The impulse response is a unity impulse at N=0.
With z-domain transfer function
Symmetric Doublet Impulse (SD)
The impulse response is two non-zero impulses each equaling
. They are symmetrical about the
tap, a separation
N
away from it.
The z transfer function is:
for
To obtain the frequency response from the z-transfer function , replace
z
by
, and set T=1 sec:
having the frequency response
7
Antisymmetric Doublet Impulse (AD)
The impulse response is two non-zero impulses
. They are symmetrical about the
tap,
a separation
N
away from it.
for
To obtain the frequency response from the z-transfer function , replace
z
by
having the frequency response
Doublet Characteristics
Some of the characteristics of the response are:
-
M
can be either even or odd: For even
M, N
will be an integer (1,2,3, etc.) For odd
M, N
will be
half integral (1/2, 3/2, 5/2, etc.)
- Linear phase frequency relationship
for SD, and
for AD.
- The Group Delay is
for SD, and same for AD
- The period of the component is
frequency. The longest possible oscillation period is , and the shortest possible period is
. On the
f
(Hz) axis, these correspond
from 1.0 and
respectively. More
frequency bands.
- In the stop band, the wavelength of the magnitude response is
double
the period of oscillation
on the real amplitude frequency response because of the rectifying behavior of the absolute
sign, but this is not so in the pass band.
- Doublets looks like delayed comb filter, but since it will not be realized independently, it will
no longer exhibit the characteristic comb-like magnitude response thus the designation
- For whole delay (non-fractional integral delay),
M
is either even or odd. Here samples
different frequencies for even than for odd. The higher the
N
(i.e.
M
), the closer these will
approximate each other.
- The maximum frequency is half the sampling frequency
(Nyquest frequency). We
can choose the sampling frequency to be , the the maximum radial frequency will
be . Or we can use a normalized frequency by dividing by . The frequencies
that are accessible by the doublets are in the range .
8
Superposition of the Doublets
It is clear from the frequency response of the symmetric SD doublets that they are all in phase with
each other, sharing the phase
. This means that their superposition, when simultaneously
present, is simply the trigonometric sums of their cosine terms. The same can be said for the AD
doublets, except the common phase they share is
. Although the SD and AD have the
same group delay, they are not in phase with each other, and cannot be simply superposed
trigonometrically. This presents a complication in the analysis of the response of asymmetrical filters
having both SD and AD coefficients. The singlet impulse has the same phase as the SD, and can
therefore be categorized as such, and superposed .
Symmetry Deconstruction of the Impulse Response of FIR Filters
A causal FIR filter with complex coefficients and order , has the general z -transfer function
The frequency response FR of the transfer function is:
Let be the desired filter magnitude and phase response.
Rewriting we get
Factor as:
The right-hand side, the sum expansion can be expanded as (this works for both even and odd values
for M except for the absence of the center tap for M even):
9
We deconstruct the complex coefficients as a sum of symmetric and antisymmetric sequences
centered around
Let
First, separate the terms according to symmetry type and group complimentary pairs together:
Then, apply the symmetry relations for the coefficients, ( i.e.
), and factor
Notice that if
then
Also
appears only once in the sum.
Applyis Relation:
This can be written using sum convention:
At this stage we recall that both and are complex, they can therefore be written as :
Putting these in the above equation yields:
10
The real and imaginary parts of this equation are identified as:
Applying Fourier trick, multiply each of the two equations by
and then by
and integrating yields :
Remember that each term in the expansion defines a complex coefficient doublet (except for
). We construct the full coefficients by again using :
11
This gives the filter coefficient sequence:
n
0
1
2
M/2
M-2
M-1
M
h(n)
,
The oscillation period of the component is
on the axis scale (maximum is ), and
on the axis scale (maximum is 0.5) . The period is double the period of the magnitude
response because of the rectifying behavior of the absolute sign.
Symmetry Classification, Inphase (Real) and Quadrature (Imaginary) Filters
The presence of the coefficient quartet depends on the symmetries of the
functions in the integrals. The table below lists the functions, their symmetries and possible symmetries and
conclusions regarding the possible presence of the coefficients. We note that some of the functions cannot be
either pure even or odd. For example, cannot be odd since it is always a positive quantity.
Coefficient Presence
Even
Even
Mixed
Even
Possible
Even
Odd
Even
Even
Possible
Mixed
Even
Mixed
Even
Possible
Mixed
Odd
Even
Even
Possible
Coefficient Presence
Even
Even
Mixed
Odd
Possible
Even
Odd
Odd
Odd
Possible
Mixed
Even
Mixed
Odd
Possible
Mixed
Odd
Odd
Odd
Possible
Coefficient Presence
Even
Even
Mixed
Even
Possible
Even
Odd
Odd
Even
Zero Not Possible
Mixed
Even
Mixed
Even
Possible
Mixed
Odd
Odd
Even
Possible
Coefficient Presence
Even
Even
Mixed
Odd
Possible
Even
Odd
Even
Odd
Zero Not Possible
Mixed
Even
Mixed
Odd
Possible
Mixed
Odd
Even
Odd
Possible
Remark: The possibility of the presence of a coefficient does not indicate certainty, the coefficient
might still vanish for specific phase functions .
12
An Important Conclusion:
The combination of even magnitude response and odd phase response
means the prohibition of imaginary coefficients. The filter would be pure real. This allows the
construction of only real coefficients a, b of the Fourier series representation from the complex
coefficients c for every frequency component since
. The transfer function of a filter with real
coefficients must be Hermitian. For a real input signal, the output is real. If it were not pure real, the
real component by itself would be incomplete to describe the output of the system, and distortion
will result.
In the remainder of this article we will focus on only real coefficient FIR with Hermitian transfer
functions. Magnitude and Phase Analysis of the Transfer Function for Real Coefficients
With symmetry deconstruction, the transfer function was derived as
This has a magnitude response as
while phase can be written as:
Where the deviation from linear phase, the skew phase , is given by
It is important to remember that each term in the expansion corresponds to SD or AD doublets
combining two coefficients positioned symmetrically about the center tap. The low n values towards
the edges and give the high frequency oscillations.
It is generally difficult to analyze the full behavior of the frequency response from the above
equations for the asymmetrical impulse response. However, one can make some observations that
help understand some aspects of the behavior. Some of these are:
1- For the asymmetrical case, zero-phase or constant-phase for the entire spectral range are
impossible.
2- Linear phase requires that all This is the case for a symmetric FIR.
3- Linear phase may also be obtained if all This is the case for an antisymmetric FIR.
4- In a certain frequency range, linear phase is possible if the skew phase is constant or nearly constant.
5- Minimizing the group delay can be achieved by suitable .
6- .
13
7- For LPF we normalize the coefficients such that , this calls for dividing the
coefficients by a normalization factor of
.
8- For HPF we normalize the coefficients such that , for even M, this calls for dividing
the coefficients by a normalization factor of
9- For BPF with band pass center and resonant (peak) filter at we normalize the
coefficients be dividing by and respectively.
10- Low frequency phase response: Consider
At low frequencies
and
, this reduces
to :
Again for small ,
We define the low frequency skew slope function as :
So that the total low frequency response of the filter is:
This allows us to study the group delay (G.D.) at low frequencies. G.D. is given as:
G.D. is lower for a positive value of , which is possible if the sum of all the symmetric and all the
weighted antisymmetric coefficients up to the center tap have the same sign. In the case
,
the group delay is zero at .
14
Application, Low Pass Filter with Asymmetrical Impulse Response
We demonstrate some of the conclusions relating to the symmetries of the frequency response and the real
coefficient filter. We will also test the formula which was derived for calculating the group delay at low
frequencies. Consider the asymmetrical impulse response simulation in the figure below, with M=20.
The coefficients can be decomposed into symmetric and antisymmetric components as shown below.
These will be used to estimate the group delay at low frequency.
The frequency magnitude and phase response is found from the DTFT
The even magnitude and odd phase of the frequency response confirm that this is a real filter,
(inphase), with no imaginary coefficients (quadrature). The group delay is relatively small,
indicating this filter is suitable as a low lag low pass filter. However, the nonlinear phase relation
might limit its application to noise reduction (low lag smoother) The delay at zero frequency has
a value of 1.195 seconds.
15
The coefficients set for this filter with real asymmetric coefficients having. Only the
coefficients up to
are shown. With
n
(n)
0
0.263426
0.131708
0.131753
10
1.317533
1
0.305321
0.152683
0.152679
9
1.37411
2
0.242581
0.121366
0.121248
8
0.969981
3
0.152163
0.076249
0.075934
7
0.531537
4
0.073872
0.037234
0.036648
6
0.219891
5
0.021332
0.011097
0.010238
5
0.051191
6
-0.00649
-0.00276
-0.00373
4
-0.01491
7
-0.01653
-0.00795
-0.00858
3
-0.02574
8
-0.01642
-0.0085
-0.00793
2
-0.01585
9
-0.01205
-0.00755
-0.0045
1
-0.0045
10
-0.00703
-0.00703
0
0.500067
4.403237
We calculate the low frequency skew slope value as:
This predicts the calculated low frequency group delay to be
Which agrees very well with the value of simulated in the graph above.
16
Aspects of Phase Design
We saw in article in this article that the phase of an asymmetrical filter is given by
Where the deviation from linear phase, the skew phase , is given by
We also saw that the first order approximation for the phase at low frequencies is given as:
With the low frequency slope factor
Giving a constant group delay of
We also saw through the low lag low pass filter example that this is accurate at =0, but the group
delay response looked like
Since the phase is an odd function for a real filter, we expect the group delay, which is the derivative
of the phase, to be an even frequency dependence, and this is obvious in the plot above. Because the
group delay is not constant, we expect the next dominating term to be quadratic, and we proceed to
investigate. We need to make a better approximation for the phase response at low frequencies.
First, we re-write more terms for the expansion of the sine term in the numerator
Neglecting higher order terms and substituting in the equation above gives
17
If we still consider to allow the approximation , then
The total phase response becomes
with , and are the coefficients in front of the frequency terms. The group delay becomes
This demonstrates the even power behavior of the group delay at low frequencies. The derivative of
the G.D. is
This predicts three extrema. At and
if and have different signs.
For the low lag smoother given in article (1), we calculate and . From
these numbers we calculate the second derivative of G.D. at zero frequency to be
This positive second derivative confirms a minimum in group delay at =0, as observed.
The other two extrema are found to be
This gives a frequency of
G.D. =
G.D. = 13.7
This agrees with the extrema being maxima because of the down concavity. However, direct
simulation gives a maximum frequency location to be around 0.06 as shown in the plot above. Using
18
this value in the
gives a reasonable value of
around G.D=2.0, which is closer to the true value.
A better approximation is expected by using the first several Taylor series for the sinusoidal terms
in both numerator and denominator
The skew phase will have the form
This can be written as the ratio of two polynomials in as
where
19
And the derivative
Assuming +is non-zero which, for the purpose of finding the roots, is similar to making a
small angle approximation for the tan term, we investigate the zeros of the derivative of the polynomial ratio,
The extrema are found by setting
This term again gives an extremum at = 0, as expected. In addition, solving the power eight
polynomial we expect at most four other extrema that are symmetrical in the frequency range. This
is possible by the power reduction of the polynomial by defining .
The root gives a frequency
of
, and calculates a
group delay of GD = 7.9.
Conclusion
C5 8
C4
C3 C4
3C5
C2
( ) 6
3C1
C4
C3 C2
5C5
Co
( ) 4
C1 C2
3C3
Co
( ) 2
C1 Co
Co C2 2
C4 4
2
2
C3 C42
C5 C4
C2
8
3C5
C22
6C5
C4
Co
6C1
C42
3C3
C4
C2
6
12 C3
C4
Co
3C1
C4
C2
9C5
C2
Co
( ) 4
10 C5
Co2
10 C1
C4
Co
C1 C22
C3 C2
Co
2
3C1
C2
Co
3C3
Co2
Co C2 2
C4 4
3
0.986064 8.806442 38.502337 113.2792423 254.3932481 462.5154225( )
2
8.806442
113.2792423 3
462.5154225 5
0.986064 38.502337 2
254.3932481 4
d
d
2
20
Although one can obtain the group delay and phase through a straightforward computation from
the full theory, making approximations for the main features like zero crossings and maxima and
minima is not straight forward. Searching for coefficient ranges that give desirable features might
be possible. However, the complexity involved in the use of the methods above to do any kinds of
design or prediction is too complicated to a degree that it does not justify the effort.
It is much more rewarding to proceed directly to methods that are based on certain rationalizations
to achieve desired response.