# Linear-phase FIR filter coefficient properties

Started by August 18, 2010
```Hello,

I have some unclear points about FIR filter coefficients which I would like
to get some help on.

First, what I want to do is to design a simple pre-equalizer for a DMT
system. I have the frequency transfer function (magnitude) of the channel
and want to design a pre-equalizer for that.

I have been reading "Understanding Digital Signal Processing - Lyons",
"Digital Signal Processing - Tan", "The Scientist and Engineer's Guide to
Digital Signal Processing", etc., but still couldn't find a clear answer.
Although there are discussion in great depth about low-pass filter design,
there isn't much about designing a filter with a known frequency response.

The main point I want to confirm is:

Does a FIR filter with linear-phase has all-real coefficients?

I know that linear-phase requires that filter coefficients to be symmetric,
but does it also need to have real coefficients? Could they be complex and
symmetric-conjugate?

Books briefly mention about real coefficients and linear-phase, but does
not confirm that real coefficients are a requirement for linear phase. Why
exactly we cannot have complex coefficients?

Also,

For designing a filter with a frequency response of choice, is "frequency
sampling method" the best option?

I want to design a simple filter with only very few taps. If somebody could
recommend me some text that would also be great.

Thank you very much.

```
```On Aug 18, 5:46=A0am, "m26k9" <maduranga.liyanage@n_o_s_p_a_m.gmail.com>
wrote:
> Hello,
>
> I have some unclear points about FIR filter coefficients which I would li=
ke
> to get some help on.
>
> First, what I want to do is to design a simple pre-equalizer for a DMT
> system. I have the frequency transfer function (magnitude) of the channel
> and want to design a pre-equalizer for that.
>
> I have been reading "Understanding Digital Signal Processing - Lyons",
> "Digital Signal Processing - Tan", "The Scientist and Engineer's Guide to
> Digital Signal Processing", etc., but still couldn't find a clear answer.
> Although there are discussion in great depth about low-pass filter design=
,
> there isn't much about designing a filter with a known frequency response=
.
>
> The main point I want to confirm is:
>
> Does a FIR filter with linear-phase has all-real coefficients?

Not necessarily. But real-valued FIRs are the ones of practical
interest.

> I know that linear-phase requires that filter coefficients to be symmetri=
c,
> but does it also need to have real coefficients?

No.

> Could they be complex and
> symmetric-conjugate?

Yes. For instance,

h[n] =3D w[n]*exp[ j 2 pi n / N ]

where w[n] is some real-valued symmetric window function.

> Books briefly mention about real coefficients and linear-phase, but does
> not confirm that real coefficients are a requirement for linear phase. Wh=
y
> exactly we cannot have complex coefficients?

One can have them, but again, the practical interest is with real-
valued
systems. Mostly for historical reasons, but still.

Rune
```
```Thank you very much Rune.

Why isn't complex coefficient filters not practical? For example in a DMT
baseband with complex inputs. Just to make clear, the input to the filter
being real or complex has no effect on the filter being real or complex
does it?

Not considering filtering complexity, are there any other pros or cons in
using a complex coefficient filter?

I'm a little confused now because I thought linear-phase property comes
with real coefficients, because the filter coefficient finding algorithm
(by use of IDFT) results in real coefficients (only one cosine term in the
summation, no complex parts).

Thank you again.
```
```On Aug 18, 7:00=A0am, "m26k9" <maduranga.liyanage@n_o_s_p_a_m.gmail.com>
wrote:
> Thank you very much Rune.
>
> Why isn't complex coefficient filters not practical? For example in a DMT
> baseband with complex inputs. Just to make clear, the input to the filter
> being real or complex has no effect on the filter being real or complex
> does it?

As I said, things are de way they are, mainly for historical reasons:
Filtering as done in DSP traces its rootsto analog filters,
implemented
in terms of resistors, capacitors and coils etc. The people who first
entered the realm of DSP were well-verwed in analog cirquits, so it
was natural for them to just take the methods they already knew from
the analog world, and emulate them directly in the discrete world.

to implement in the analog world, one emulates the functionality
by means of quadrature filters, where the complex-valued signal is
emulated by an I/Q signal, where each channel is filtered with a
real-valued signal.

This convention stuck, even if the concept of complex-valued signals
make perfect sense in the world of DSP.

> Not considering filtering complexity, are there any other pros or cons in
> using a complex coefficient filter?

There aren't many situations where you need a complex-valued filter.
Most of those are already covered - by tradition - by means of

> I'm a little confused now because I thought linear-phase property comes
> with real coefficients, because the filter coefficient finding algorithm
> (by use of IDFT) results in real coefficients (only one cosine term in th=
e
> summation, no complex parts).

That's the practical, easy-to-teach, adaption of the general theory.
One *could* derive the results in general, spending 10 times more
work on the algebra, and then throw 90% of the results away at the
end.
Maybe somebody tried that, once upon a time. Don't be surprised if
there are very good pedagogical reasons for doing things the way
they are. It is far easier to handle the odd, bright student who
sees the problem with generalization, than handling full classes
of people who don't understand why they have to do all that general
work only to throw away the bulk of the results.

Rune
```
```Thank you very much Rune.
That explains a lot. I guess I will go through the derivation and see where
the complex part is getting eliminated and on what reason.

Sorry for asking again Rune, but would this mean, that if you are
implementing a filter in baseband with complex signals, for example IDFT
outputs of a DMT, I need to have two filters two use in the I-Q lines?

I'm new to the real-world of doing things. In literature you write the
equalizer filter as 1/H* and not really think about how it will be
implemented in a DSP.

Thank you again.

```
```On Aug 18, 8:01=A0am, "m26k9" <maduranga.liyanage@n_o_s_p_a_m.gmail.com>
wrote:
> Thank you very much Rune.
> That explains a lot. I guess I will go through the derivation and see whe=
re
> the complex part is getting eliminated and on what reason.

That's easy: If H(w) is conjugate symmetric, H(-w) =3D conj(H(w)),
then the corresponding h[n] is real-valued. You will find the
proof in the section 'Properties of the Fourier Transform' in
any good book on DSP.

> Sorry for asking again Rune, but would this mean, that if you are
> implementing a filter in baseband with complex signals, for example IDFT
> outputs of a DMT, I need to have two filters two use in the I-Q lines?

You don't *need* to do anything where there are more than one
way of achieving a desired result. There might be some ways that
are smarter than others, for any number of reasons:

- Implementation complexity
- Computation speed
- Accuracy of results
- Familiarity in the user community

The latter point tends to come as a surprise on a lot of people,
and is one strong argument in favour of the I/Q method.

Rune
```
```On Aug 18, 1:00=A0am, "m26k9" <maduranga.liyanage@n_o_s_p_a_m.gmail.com>
wrote:
> Thank you very much Rune.
>
> Why isn't complex coefficient filters not practical? For example in a DMT
> baseband with complex inputs. Just to make clear, the input to the filter
> being real or complex has no effect on the filter being real or complex
> does it?
>
> Not considering filtering complexity, are there any other pros or cons in
> using a complex coefficient filter?
>
> I'm a little confused now because I thought linear-phase property comes
> with real coefficients, because the filter coefficient finding algorithm
> (by use of IDFT) results in real coefficients (only one cosine term in th=
e
> summation, no complex parts).
>
> Thank you again.

There are some contexts in which filters with complex coefficients are
used. One example is in a linear equalizer used in a communications
receiver. Once you have your signal in complex baseband form, it is
likely that the channel frequency response you're trying to equalize
out is not symmetric with respect to the carrier frequency (i.e. DC
once your signal is at baseband). Therefore, you need complex
coefficients to define a linear filter that has a non-symmetric
frequency response.

Jason
```
```Thank you very much Rune and Jason.

@Jason:
An equalizer is exactly what I'm trying to design. Actually a pre-equalizer
for DMT, but in any case I want to invert the channel. And if doing this in
baseband, do I have to use a complex filter? Is it because of complex
signals?

I'm reading the "Digital Signal Processing" by Li Tan, and he has given a
derivation of using the "frequency sampling method" for filter design.

I'm completely confused at this moment. The book goes on with the
derivation, starting with the IDFT of the known H[k], and in the middle
says "... sequence h[n] must be real." And doesn't explain why.

I'm not sure in what context h[n] *must* be real. Is it because filters are
"generally" real valued or does it have to do with linear phase property?

I have the frequency response of the channel, say subcarriers from 0 to 256
. These are just channel attenuation magnitudes (no phase information). And
I want to invert the channel, with linear phase. The book follows the
procedure with the condition that H*[k] = H[N-k] (conjugate symmetry
because h[n] is real). But if I want a complex filter, I cannot use this
fact.

because my signal samples are complex?

Thank you very much.
```
```On Aug 17, 11:46=A0pm, "m26k9"
>
> The main point I want to confirm is:
>
> Does a FIR filter with linear-phase has all-real coefficients?
>

real coefficients has little to do with linear phase.  if you are
processing real signals with real inputs (coming from an A/D
converter) and real outputs (going to a D/A), then the impulse
response is real and the coefficients are real.

now if you're processing I/Q signals, you can think of the pair as a
pair of real signals (in which your FIRs have real coefficients) or
you can construct a complex signal, I + j*Q, in the mind of the
computer or DSP.

>
> For designing a filter with a frequency response of choice, is "frequency
> sampling method" the best option?

no, not usually.  but it's inexpensive and you should be able to do it
without buying an expensive filter design package.

> I want to design a simple filter with only very few taps. If somebody cou=
ld
> recommend me some text that would also be great.

to design something optimally, you might need to use a package like in
MATLAB.  myabe somebody knows what you can do regarding filter design
with Octave (which is free).

r b-j
```
```m26k9 wrote:

> because my signal samples are complex?
>

No.

I don't know if this will help but I'll try.  I like things like this
because they often help provide insight.

- A purely real sequence can be split into even and odd parts.
- An even sequence will yield an even and real Fourier Transform.
- An odd sequence will yield an odd and imaginary Fourier Transform.
And, you can substitute Inverse Fourier Transform above.

So, if you are starting with a frequency magnitude response (which is
real of course) and if it has an odd part that's nonzero, then its IFT
will have an imaginary part.  It makes a lot more sense to ask why the
freq mag response has an odd part than it makes to ask about the IFT
being complex.  That's because any number of perfectly reasonable
functions can have either a real or a complex FFT or IFT if the
reference point is moved around.  So, unless one is being reasonably
sophisticated in analysis and thought, one may be "seeing" a "real"
function as being "complex".  So, it's best to keep the things that are
intended to be real, real by paying close attention to where they are
placed in time or frequency before doing an FT/IFT.

One can compute the analytic signal of a real bandpass signal and end up
with a complex baseband signal.  I understand that's what you're doing.  OK.

But now one needs to ask what kind of baseband filtering is needed and,
by itself, that has nothing to do with whether the baseband signal is
real or complex.  It has everything to do with what filtering you want
to perform ... an how you want to do it.

One way to think of this situation is to compute an analytic signal that
isn't fully "basebanded".  Just move it so the lowest frequencies end up
just above zero.  It takes twice the bandwidth but it remains real I
believe.  Then you can apply a real filter that is asymmetric relative
to the center frequency.  I think this is right .. haven't done it.
(And then, you might conceptually baseband the result).

But, if you must baseband to center at zero then a channel equalizer may
be asymmetric in frequency and, thus have an odd part.  This non-even
magnitude response will yield a complex IFT and, thus, a complex-valued
filter.

Now, as others have pointed out, if you have a complex signal sequence
then, by superposition, you handle it like a "real" sequence and an
"imaginary" sequence and you apply "the filter" to both of these
sequences. In general, this will yield two complex sequences that would
be combined (summed) into one real sequence and one imaginary sequence.
Now you have a filtered version of the analytic signal sequence.

Looking at it this way, in pieces, it's pretty easy to see that if the
signal sequence is complex has nothing to do with the shape or nature
(real/complex) of the filter unit sample response.  That's why the
answer above was "no".  It's only if you choose an asymmetric frequency
magnitude response that requires a complex-valued filter.

Fred
```