This site uses cookies to deliver our services and to show you relevant ads and job listings. By using our site, you acknowledge that you have read and understand our Cookie Policy , Privacy Policy , and our Terms of Service . Your use of the Related Sites, including DSPRelated.com, FPGARelated.com, EmbeddedRelated.com and Electronics-Related.com, is subject to these policies and terms.

This blog discusses a little-known filter characteristic that enables real- and complex-coefficient tapped-delay line FIR filters to exhibit linear phase behavior. That is, this blog answers the question:

What is the constraint on real- and complex-valued FIR filters

that guarantee linear phase behavior in the frequency domain?

I'll declare two things to convince you to continue reading.

Declaration# 1:

"That the coefficients must be symmetrical" is not a correct

answer to the Question.

Declaration# 2:

The complex-valued FIR filter coefficients shown in Figure 1(a),

whose positive-frequency magnitude response is shown in Figure 1(b),

exhibit linear phase in the frequency domain. However, interestingly,

neither the real nor the imaginary parts of the coefficients are

symmetrical!



Figure 1: Complex-valued FIR coefficients: (a) the

complex coefficients; (b) the coefficients'

frequency magnitude response.

If you would like to know why the asymmetrical coefficients in Figure 1(a) yield a linear-phase FIR filter, please read on.

Real-Valued FIR Filter Coefficients

Let's consider real-coefficient tapped-delay line FIR filters first, such as that shown in Figure 2.



Figure 2: N-tap tapped-delay line FIR filter.

The contraint on the $ h(n) $ coefficients of a real-coefficient FIR filter guaranteeing linear phase is:

$$ \sum_{n=0}^{N-1} h(n) sin [(n - D) \omega] = 0. \tag{1}$$

Equation (1) tells us that if the sum of the products of the FIR filter's N-length $ h(n) $ real-valued coefficients times an N-length sine wave sequence, for all $ \omega $ in the range of $ - \pi \le \omega \le \pi $ radians/sample, is equal to zero then the real-coefficient filter will have a linear phase response. Variable $ D $ is the time delay through the filter measured in samples and the integer n index has the range $ 0 \le n \le N-1 $.

The earliest mention of Eq. (1) that I could find in the DSP literature is reference [1]. The Eq. (1) constraint is revisited in reference [2], and mentioned (without a formal proof) in reference [3]. My derivation of Eq. (1) is given in Appendix A of the downloadable PDF file associated with this blog. (To keep this blog manageable in length, all Appendices are only included in the associated PDF file.)

If you model Eq. (1) in software using various values of $ D $ and $ \omega $, as I did, you'll find that the only way to satisfy that constraint for an N-tap FIR filter, over the full range of $ \omega $, is to: (1) let $ D = (N - 1) / 2 $ and (2) ensure that your real-valued $ h(n) $ coefficients are symmetrical. That is, for real-coefficient FIR filter linear phase,

$$ h(n) = h(N-1-n). \tag{2} $$

So this reinforces what we already knew about FIR filters having real-valued coefficients. However, Eq. (1) does not help us explain how the complex-valued coefficients in Figure 1(a) yield a linear-phase filter.

Complex-Valued FIR Filter Coefficients

In trying to learn why the asymmetrical complex coefficients in Figure 1(a) produce a linear-phase filter I generated an expression similar to Eq. 1. For an N-tap FIR filter having complex coefficients in the form of $ h(n) = h_I(n) + jh_Q(n) $ my derivation, given in Appendix B of the downloadable PDF file associated with this blog, produced the following Eq. (3).

$$ \sum_{n=0}^{N-1} h_Q(n) cos [(n-D) \omega + \beta] = \sum_{n=0}^{N-1} h_I(n) sin[(n-D) \omega + \beta] \tag{3}$$

So, Eq. (3) is the constraint on the coefficients that must be satisfied for an N-tap complex-coefficient FIR filter to have linear phase.

Sadly, while studying Eq. (3), my limited analysis skills did not enable me to find an easier to understand expression for the constraint on the coefficients that must be satisfied for an N-tap complex-coefficient FIR filter to have linear phase. I wanted an expression that was as easy to understand as Eq. (2)! Fortunately there is a way to obtain the expression I wanted.

A More Understandable Complex FIR Filter Constraint Expression

The derivations of Eqs. (1) and (3) used the forward discrete time Fourier transform (DTFT). If we, instead, use the inverse DTFT we can obtain an easy to understand expression for the constraint on an FIR filter's complex coefficients. (For a detailed description of the forward and inverse DTFT, see reference [4].)

Using the inverse DTFT, as was done in my derivation in Appendix C of the downloadable PDF file associated with this blog, the simple expression I obtained is:

$$ h(n) = e^{j2\beta}h^*(N-1-n) \tag{4}$$

where $ \beta $ is the phase of the complex filter at $ \omega = 0 $ radians (zero Hz), $ N $ is the number of filter taps, index variable $ n $ satisfies $ 0 \le n \le N-1 $, and the '$ * $' symbol means complex conjugate.

The easy to understand Eq. (4) is the little-known constraint on the coefficients that must be satisfied for an N-tap complex-coefficient FIR filter to have linear phase! And happily, Eq. (4) also applies to real-coefficient FIR filters because in that case, since $ \beta = 0 $, Eq. (4) simplifies to our above Eq. (2). And, of course, Eq (4) is valid for both odd and even values of $ N $.

Due to the popularity of complex FIR filtering in recent years, I believe Eq. (4) should be included in every new DSP textbook . Let the record show that I now formally nominate Eq. (4) as 'The Most Interesting FIR Filter Equation in the World'.





A Matlab Example

For those readers who find this topic interesting, and have Matlab software, I supplied the Matlab code I used to generate the $ h(n) $ coefficients in Figure 1(a) and verify the properties of Eq. (4) in the downloadable PDF file associated with this blog. Executing that Matlab code gives us the following complex values for Figure 1(a)'s nine $ h(n) $ complex-valued coefficients:

h(0) = -0.0592

h(1) = 0.1132 + 0.0822i

h(2) = 0.0562 + 0.1729i

h(3) = -0.0721 + 0.2218i

h(4) = -0.2061 + 0.1497i

h(5) = -0.2332 + 0.0000i

h(6) = -0.1471 - 0.1069i

h(7) = -0.0432 - 0.1330i

h(8) = -0.0183 + 0.0563i



For Further Study

The next thing I need to figure out is: When the complex-coefficients are quantized what effect does that have on a complex FIR filter's phase linearity.

References

[1] L. Rabiner and B. Gold, "The Theory and Application of Digital Signal Processing", Prentice Hall, Englewood Cliffs, New Jersey, 1975, pp. 78-79.

[2] A. Oppenheim, R. Schafer, and J. Buck, "Discrete-Time Signal Processing", 2nd Ed., Prentice Hall, Englewood Cliffs, New Jersey, 1999, Section 5.7.3, pp. 296-297.

[3] Wikipedia: "Linear Phase", https://en.wikipedia.org/wiki/Linear_phase

[4] Sabanci University, Istanbul, Turkey, 2004, http://abut.sdsu.edu/TE302/Chap4.pdf