Linear-phase FIR filter coefficient properties

  • Follow


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.


0
Reply m26k9 8/18/2010 3:46:01 AM

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
0
Reply allnor (8474) 8/18/2010 4:00:52 AM


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.
0
Reply m26k9 8/18/2010 5:00:30 AM

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.

So instead of talking about complex-valued filters, as are very hard
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
quadrature filters.

> 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
0
Reply Rune 8/18/2010 5:24:50 AM

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.


0
Reply m26k9 8/18/2010 6:01:13 AM

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
0
Reply Rune 8/18/2010 6:44:58 AM

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
0
Reply Jason 8/18/2010 12:39:46 PM

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.

So how exactly should I go about this? Do I need to use a complex-filter
because my signal samples are complex?

Your help is greatly appreciated.

Thank you very much.
0
Reply m26k9 8/18/2010 1:48:31 PM

On Aug 17, 11:46=A0pm, "m26k9"
<maduranga.liyanage@n_o_s_p_a_m.gmail.com> wrote:
>
> 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
0
Reply robert 8/18/2010 3:12:25 PM

m26k9 wrote:

> So how exactly should I go about this? Do I need to use a complex-filter
> 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
0
Reply Fred 8/18/2010 6:05:16 PM

Thank you very much r b-j.

@Fred
Thank you very much for that comprehensive explanation. I think I get the
idea you are saying, in a sort of theoretical way, but not clear as to use
this in a practical system.

>
>- 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.

I'm not sure which even and odd you are mentioning here. Is it about how a
sequence can be represented as a sum of conjugate symmetric and conjugate
antisymmetric parts as:

       x[n] = x_e[n] + x_o[n]
where,
       x_e[n] = 0.5*(x[n] + x*[-n])
       x_o[n] = 0.5*(x[n] - x*[-n])

and then
      DFT(x_e[n]) = Re{X[f]}
      DFT(x_o[n]) = Im{X[f]}




>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.
>

I understand this from a theoretical point, but couldn't grasp the idea
when I use this in a DMT  system. For example, at the transmitter, I get
the output from the IFFT, which is ofcourse complex, and the frequency
spectrum of these complex points are from -N/2 to N/2. Now this would make
the sequence (complex) baseband. Then again, -N/2 to 0 is the same as N/2
to (N-1). This would mean what you said about moving the lowest frequency
just above DC, I suppose.

When calculating (I)DFT, we can choose the summation from -N/2 to N/2, or
just as well use 0 to (N-1). Atleast that was my understanding. But does it
have an impact. For example if feed complex-points to ifft routine, it
outputs N complex values. How would I choose (or know) if it's baseband
(-N/2 to N/2) or not (0 to N-1)? Am I understanding this completely wrong?

As far as the channel goes, the channel gains, or subcarrier values, can go
from (-N/2 to N/2) or from (0 to N-1). What actually matters is that there
is a one-to-one correspondence between the complex-inputs (to the IDFT) and
 the corresponding channel value. I.e. at the output of the channel,
complex-input (-N/2) is multiplied by channel value (-N/2), or if we are
using the shifted one, complex-input point 0 multiplied by channel value at
0.

I'm sorry for the long post, but how does this all line up when we are
working on IDFT output samples?

Thank you very much.


0
Reply m26k9 8/19/2010 5:24:11 AM

On Aug 19, 1:24=A0am, "m26k9" <maduranga.liyanage@n_o_s_p_a_m.gmail.com>
wrote:
> Thank you very much r b-j.
>
> @Fred
> Thank you very much for that comprehensive explanation. I think I get the
> idea you are saying, in a sort of theoretical way, but not clear as to us=
e
> this in a practical system.
>
>
>
> >- 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.
>
> I'm not sure which even and odd you are mentioning here. Is it about how =
a
> sequence can be represented as a sum of conjugate symmetric and conjugate
> antisymmetric parts as:
>
> =A0 =A0 =A0 =A0x[n] =3D x_e[n] + x_o[n]
> where,
> =A0 =A0 =A0 =A0x_e[n] =3D 0.5*(x[n] + x*[-n])
> =A0 =A0 =A0 =A0x_o[n] =3D 0.5*(x[n] - x*[-n])
>
> and then
> =A0 =A0 =A0 DFT(x_e[n]) =3D Re{X[f]}
> =A0 =A0 =A0 DFT(x_o[n]) =3D Im{X[f]}
>
>
>
> >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. =A0It 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". =A0Just move it so the lowest frequencies end =
up
> >just above zero. =A0It takes twice the bandwidth but it remains real I
> >believe. =A0Then you can apply a real filter that is asymmetric relative
> >to the center frequency. =A0I 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. =A0This 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.
>
> I understand this from a theoretical point, but couldn't grasp the idea
> when I use this in a DMT =A0system. For example, at the transmitter, I ge=
t
> the output from the IFFT, which is ofcourse complex, and the frequency
> spectrum of these complex points are from -N/2 to N/2. Now this would mak=
e
> the sequence (complex) baseband. Then again, -N/2 to 0 is the same as N/2
> to (N-1). This would mean what you said about moving the lowest frequency
> just above DC, I suppose.
>
> When calculating (I)DFT, we can choose the summation from -N/2 to N/2, or
> just as well use 0 to (N-1). Atleast that was my understanding. But does =
it
> have an impact. For example if feed complex-points to ifft routine, it
> outputs N complex values. How would I choose (or know) if it's baseband
> (-N/2 to N/2) or not (0 to N-1)? Am I understanding this completely wrong=
?
>
> As far as the channel goes, the channel gains, or subcarrier values, can =
go
> from (-N/2 to N/2) or from (0 to N-1). What actually matters is that ther=
e
> is a one-to-one correspondence between the complex-inputs (to the IDFT) a=
nd
> =A0the corresponding channel value. I.e. at the output of the channel,
> complex-input (-N/2) is multiplied by channel value (-N/2), or if we are
> using the shifted one, complex-input point 0 multiplied by channel value =
at
> 0.

i lost track with what you're originally trying to do.  if i remember,
it had something to do with I and Q signals, no?

about complex vs. real signals; here is a little bit of philosophy and
i know some others will disagree.

in physical reality we only have "real quantities".  i know many
disagree, but i think the terms "real number" and "imaginary number"
are very appropriate.  anyway, you can conceptualize a complex signal

    x[n] =3D i[n] + j*q[n]

where i[n] and q[n] are both real and are the real and imaginary parts
of x[n].  if q[n] is non-zero, then we know that the DTFT of x[n] does
not have that conjugate symmetry property, but it is only if the
Hilbert Transform of i[n] is q[n] that the negative frequency
components of x[n] are zero.

anyway, *all* of this is conceptualization.  use it at the chalkboard,
but remember that you're dealing with real signals that are connected
to real I/O devices.  creating a complex signal out of two real
signals is something that exists only in the mind of the designer (and
you can pretend it exists in the mind of the DSP or CPU).

anyway, that's what i think.

r b-j
0
Reply rbj (3909) 8/19/2010 6:02:19 AM

>anyway, *all* of this is conceptualization.  use it at the chalkboard,
>but remember that you're dealing with real signals that are connected
>to real I/O devices.  creating a complex signal out of two real
>signals is something that exists only in the mind of the designer (and
>you can pretend it exists in the mind of the DSP or CPU).
>
>anyway, that's what i think.
>
>r b-j
>

Thank you very much r b-j.

So in that sense, a complex-filter, is a concept too? I mean we could have
a complex-signal (ex: IDFT output) and send it through a complex-filer.
Convolving two complex sequences. Then again, this is something I can do in
Matlab, not in a DSP I guess.

I guess I'm lost at what's theory and how it is actually done in a DSP. For
example, a Rayleigh channel is a complex filter. If I am going to make a
equalizer for this channel, I would have a complex filter, would I not? 

I guess in a DSP, the IDFT operation returns two real data streams, once
for the real part of the output, and the other for the imaginary part. And
I'm thinking I need to filter these two independently? In theory, when we
take the DFT of these complex signals, it has a frequency spectrum -N/2 to
N/2, or 0 to N-1. That would be different when we take the real and
imaginary parts separately? 

I'm just used to think of complex numbers as one composite number and it is
confusing to think of it as two real numbers. I guess too much Matlab.

Thank you very much again.
0
Reply m26k9 8/19/2010 6:51:23 AM

m26k9 wrote:
> Thank you very much r b-j.
> 
> @Fred
> Thank you very much for that comprehensive explanation. I think I get the
> idea you are saying, in a sort of theoretical way, but not clear as to use
> this in a practical system.
> 
>> - 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.
> 
> I'm not sure which even and odd you are mentioning here. Is it about how a
> sequence can be represented as a sum of conjugate symmetric and conjugate
> antisymmetric parts as:
> 
>        x[n] = x_e[n] + x_o[n]
> where,
>        x_e[n] = 0.5*(x[n] + x*[-n])
>        x_o[n] = 0.5*(x[n] - x*[-n])

***Yes, the formulation above.
> 
> and then
>       DFT(x_e[n]) = Re{X[f]}
>       DFT(x_o[n]) = Im{X[f]}

***Yes, as above, by superposition.

***Well, I chose to not get all twisted up with real/imaginary and 
conjugate because they are extensions of the idea.

> I understand this from a theoretical point, but couldn't grasp the idea
> when I use this in a DMT  system. For example, at the transmitter, I get
> the output from the IFFT, which is ofcourse complex, and the frequency
> spectrum of these complex points are from -N/2 to N/2. Now this would make
> the sequence (complex) baseband. This would mean what you said about moving the lowest frequency
> just above DC, I suppose.

***I'm having a bit of a hard time following you here.  I don't much 
care *how* you get the "analytic signal" and don't know exactly *what* 
you're doing an IFFT on.

***I suggest we first settle on what is an analytic signal.  In my 
understanding the analytic signal is what results if you take a bandpass 
signal and move the center frequency to zero.  This makes the time 
series complex in general as the bandpass signal need not be even about 
the center frequency.  If it were, then the analytic signal could be 
real.  Anyway, when a signal is truly "baseband" then this is it.

***What I was suggesting as a "data point", was to shift the center 
frequency down to just >B/2 instead of to zero (where B is the bandwidth 
of the bandpass signal).  Then the component at f=0 would be zero (or 
close enough) and the spectrum would continue to be even about zero and 
the temporal sequence would continue to be real.  So, this isn't really 
a fully "basebanded" signal in normal terminology I think.  It's just a 
signal containing all the information but with a lower overall bandwidth.
And, I'm not even dealing with sampling here....... continuous signals 
are fine for this part of the discussion.

> 
> When calculating (I)DFT, we can choose the summation from -N/2 to N/2, or
> just as well use 0 to (N-1). Atleast that was my understanding. But does it
> have an impact. For example if feed complex-points to ifft routine, it
> outputs N complex values. How would I choose (or know) if it's baseband
> (-N/2 to N/2) or not (0 to N-1)? Am I understanding this completely wrong?

***I think you have it.  This was the "reference point" I mentioned. 
It's best to select a single method and stick with it so that the 
peculiarities will come out.  For example, I normally *think* in terms 
of an even function being even about zero but normally compute from zero 
to N-1.  That means that an even function has its upper half starting at 
zero and going up to N/2 and its lower half starting at N and going down 
to N/2.  Well, actually, there is no sample at N and we assume that it's 
the same value as the sample at zero.

> 
> As far as the channel goes, the channel gains, or subcarrier values, can go
> from (-N/2 to N/2) or from (0 to N-1). What actually matters is that there
> is a one-to-one correspondence between the complex-inputs (to the IDFT) and
>  the corresponding channel value. I.e. at the output of the channel,
> complex-input (-N/2) is multiplied by channel value (-N/2), or if we are
> using the shifted one, complex-input point 0 multiplied by channel value at
> 0.

***As above, it pays to not get wound up around the sequence indices too 
much (just get them correct).  In sampled data it's best to envision 
that the samples fall on a circular axis and repeat infinitely.  The 
question then is only: "where is the orgin?".  I'm still unclear what 
you're transforming and why......  But, this is an issue in the 
mechanics of doing the computations and not more than that.  Presumably 
you are wanting to convolve the signal by the channel unit sample 
response as if any other filter?

Fred
0
Reply Fred 8/19/2010 10:51:45 PM

Fred, Thank you very much for all the explanations.

I think I have tangled few things together and looking at this from a wrong
angle. Your explanation actually made it clear. I think I got it to some
extent.

Why I was mentioning IDFT was because I am working with an ADSL system. So
I input 'N' number of QAM points (complex data) to an IFFT routine, and I
get 'N' complex numbers as output. In a DSP this would be 2xN real values.

Now this is where I start to get confused. 

Suppose I get those 'N' complex outputs and put them to an FFT routine
(reverse). I get 'N' complex points (which are same as my QAM points), but
those 'N' points are the "frequency response". This frequency response can
be from -N/2 to N/2, OR it could be 0 to (N-1), depends on the range of the
summation, or the twiddle factors.

My confusion is here:
>***What I was suggesting as a "data point", was to shift the center 
>frequency down to just >B/2 instead of to zero (where B is the bandwidth 
>of the bandpass signal).  Then the component at f=0 would be zero (or 
>close enough) and the spectrum would continue to be even about zero and 
>the temporal sequence would continue to be real.

Now when I have my (I)DFT output points, how would I "shift" them so that
the lowest frequency is just above f=0? Do I multiply by e^(jf)? And isn't
this "shifting" same as doing the DFT summation from 0 to (N-1), instead of
(-N/2) to (N/2)? Because in both case I start with complex sequences and
end up with complex sequences.
Am I doing this all wrong? 

Thank you very much Fred. I will go back and read some again.  

0
Reply m26k9 8/20/2010 2:40:15 PM

>
> anyway, *all* of this is conceptualization. =A0use it at the chalkboard,
> but remember that you're dealing with real signals that are connected
> to real I/O devices. =A0creating a complex signal out of two real
> signals is something that exists only in the mind of the designer (and
> you can pretend it exists in the mind of the DSP or CPU).
>
> anyway, that's what i think.
>
> r b-j- Hide quoted text -
>
> - Show quoted text -

the way I think about it is:

real =3D one dimensional
complex =3D two dimensional

you can use two real signal to make a complex signal =3D
you can use two 1D signals to make a 2 D signal

in the lab, in order to move a 2D (analog) signal from one piece of
gear to another, there are always 2 BNC connectors, (usually labeled I
and Q)

Mark


0
Reply Mark 8/20/2010 2:51:26 PM

>
>the way I think about it is:
>
>real =3D one dimensional
>complex =3D two dimensional
>
>you can use two real signal to make a complex signal =3D
>you can use two 1D signals to make a 2 D signal
>
>in the lab, in order to move a 2D (analog) signal from one piece of
>gear to another, there are always 2 BNC connectors, (usually labeled I
>and Q)
>
>Mark
>

Thank you Mark.

I think the problem is me trying to think of a complex number as a one
quantity. 
The problem actually started because I cannot understand why filter
coefficients are real and not complex. I know this is something I cannot do
in a DSP, but theoretically filters could be complex. Example when
equalizing a channel. 

It's quite messed up for me at this moment.
0
Reply m26k9 8/20/2010 3:23:25 PM

m26k9 wrote:

> 
> Why I was mentioning IDFT was because I am working with an ADSL system. So
> I input 'N' number of QAM points (complex data) to an IFFT routine, and I
> get 'N' complex numbers as output. In a DSP this would be 2xN real values.
> 

Well, this isn't an implementation/application that I'm familiar with 
offhand.  The one paper I scanned quickly says this:
"The size is doubled by mirroring the data to impose conjugate symmetry 
in the frequency domain, which results in real-valued signal in the time 
domain after applying the IDFT."
from:
http://users.ece.utexas.edu/~bevans/courses/ee382c/projects/spring04/MustafaErwa/LitSurveyReport.pdf

I don't know if this helps but it makes some kinda sense to me...

Fred
0
Reply Fred 8/20/2010 7:52:59 PM

m26k9 wrote:
> 
> My confusion is here:
>> ***What I was suggesting as a "data point", was to shift the center 
>> frequency down to just >B/2 instead of to zero (where B is the bandwidth 
>> of the bandpass signal).  Then the component at f=0 would be zero (or 
>> close enough) and the spectrum would continue to be even about zero and 
>> the temporal sequence would continue to be real.
> 
> Now when I have my (I)DFT output points, how would I "shift" them so that
> the lowest frequency is just above f=0? Do I multiply by e^(jf)? And isn't
> this "shifting" same as doing the DFT summation from 0 to (N-1), instead of
> (-N/2) to (N/2)? Because in both case I start with complex sequences and
> end up with complex sequences.
> Am I doing this all wrong? 
> 

I may have been confused by the use of the term "baseband" as I 
associated that term with "analytic signal" - which is derived by 
"demodulating" a bandpass signal down to zero center frequency - 
generally resulting in a complex temporal baseband signal which does not 
have frequency symmetry about f=0.

So, my suggestion was to envision what happens when the demodulation is 
such that the lowest frequency components are at a bit higher frequency 
and the resulting temporal "baseband" signal would be purely real and 
the frequency components would be symmetric about f=0 (and maybe 
antisymmetric as well).

The "demodulation" or mixing isn't part of the IDFT - although there may 
be tricks to accomplish this in some combined way.
If one has a bandpass signal with center frequency f0 and bandwidth B, 
then it can be downconverted.  I'm referring here to something like what 
Lyons (2nd ed.) shows in 8.9 Figure 8-24 where, I believe, the result 
has to still be real in time and the important spectral content has 
considerably reduced bandwidth.

But, overall, I think maybe the key here is the "mirroring" before the 
IDFT in DMT in order to keep the temporal samples purely real.  See my 
earlier post.

Fred
0
Reply Fred 8/20/2010 8:23:11 PM

>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.
>
>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?

a complex filter can have linear phase or nonlinear phase and across
pos/neg frequency range(asymmetric).
>
>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.

If you just want a pre-equaliser for amplitude only then there are several
methods:

%examples for fir design for a given amplitude(e.g. inverse sinc)
%method 1: ifft (freq sampling)
n = 31;                  %taps
f =linspace(-.5,.5,n);   %freq grid
A = 1./sinc(f);
h = fftshift(ifft(fftshift(A)));
h = h/sum(h);


%Matlab fir2 is based on ifft. while firpm/cfirpm are iterative...

My favorite method is this:
%inverse sinc design using LMS method
n = 31;                    %number of taps

f =linspace(-.45,.45,n)';
A = 1./sinc(f);

F = exp(-j*2*pi*f*[-(n-1)/2:(n-1)/2]);   
h = pinv(F)*A;       % pseudo inverse

If your signal is complex pair then you need a complex filter to
pre-correct amplitude of final channel signal. You can also include phase
correction by having vector of Amp/phase or I/Q channel data e.g. from
spectrum analyser. When correcting phase make sure you don't correct time
delay as it is unneccessary burden on filter(subtract time delay or use
groupdelay)

The above methods yield real and imaginary h. 


0
Reply kaz 8/20/2010 8:54:15 PM

@Fred Thank you very much. The paper on mirroring was very useful. No need
to deal with complex numbers that way.
>
>So, my suggestion was to envision what happens when the demodulation is 
>such that the lowest frequency components are at a bit higher frequency 
>and the resulting temporal "baseband" signal would be purely real and 
>the frequency components would be symmetric about f=0 (and maybe 
>antisymmetric as well).
>

I get what you are saying now. I read again on the analytic signal and I
think it a representation of a passband signal in baseband. I'm used to go
from baseband (ifft output) to passband. I'm not clear yet as to how the
temporal signal will be purely real in the case when we demodulate to just
above f=0, but I will go back to the equation and see.

Thank you very much.
0
Reply m26k9 8/20/2010 9:29:53 PM

Thank you very much Kaz.

>If your signal is complex pair then you need a complex filter to
>pre-correct amplitude of final channel signal. You can also include phase
>correction by having vector of Amp/phase or I/Q channel data e.g. from
>spectrum analyser. When correcting phase make sure you don't correct time
>delay as it is unneccessary burden on filter(subtract time delay or use
>groupdelay)
>
>The above methods yield real and imaginary h. 

Could you please clear this for me. 
Why do I need a complex filter if I have a complex signal? Doesn't it
depend on the kind of filtering I want to perform? Or is it because I have
two numbers in each sample?

Also, if I am to do this in a DSP, i.e. if I have complex signals, I would
have to filter the real stream and the imaginary stream separately with the
same filter, right?


Thank you very much.

0
Reply m26k9 8/20/2010 9:34:19 PM

>Thank you very much Kaz.
>
>>If your signal is complex pair then you need a complex filter to
>>pre-correct amplitude of final channel signal. You can also include
phase
>>correction by having vector of Amp/phase or I/Q channel data e.g. from
>>spectrum analyser. When correcting phase make sure you don't correct
time
>>delay as it is unneccessary burden on filter(subtract time delay or use
>>groupdelay)
>>
>>The above methods yield real and imaginary h. 
>
>Could you please clear this for me. 
>Why do I need a complex filter if I have a complex signal? Doesn't it
>depend on the kind of filtering I want to perform? Or is it because I
have
>two numbers in each sample?

Imagine the case of pulse shaping: You only need to shape each channel
separately so you use two parallel real filters.
However for channel correction, the distortion is likely to be asymmetric
and additionally you may need to correct phase.
If you only want to correct amplitude and that amplitude distortion is
symmetrical(on both sidebands) then real filter is enought.

Thus the main target is the assymetric correction which is only achievable
by complex filtering.

>
>Also, if I am to do this in a DSP, i.e. if I have complex signals, I
would
>have to filter the real stream and the imaginary stream separately with
the
>same filter, right?

Not separately. each tap will require 4 multipliers:
xr.hr - xi.hi => yr 
xr.hi + xi.hr => yi
the final output y = sum of all products

best of luck

Kaz
0
Reply kaz 8/20/2010 9:52:15 PM

>Thank you very much Kaz.
>
>>If your signal is complex pair then you need a complex filter to
>>pre-correct amplitude of final channel signal. You can also include
phase
>>correction by having vector of Amp/phase or I/Q channel data e.g. from
>>spectrum analyser. When correcting phase make sure you don't correct
time
>>delay as it is unneccessary burden on filter(subtract time delay or use
>>groupdelay)
>>
>>The above methods yield real and imaginary h. 
>
>Could you please clear this for me. 
>Why do I need a complex filter if I have a complex signal? Doesn't it
>depend on the kind of filtering I want to perform? Or is it because I
have
>two numbers in each sample?

Imagine the case of pulse shaping: You only need to shape each channel
separately so you use two parallel real filters.
However for channel correction, the distortion is likely to be asymmetric
and additionally you may need to correct phase.
If you only want to correct amplitude and that amplitude distortion is
symmetrical(on both sidebands) then real filter is enought.

Thus the main target is the assymetric correction which is only achievable
by complex filtering.

>
>Also, if I am to do this in a DSP, i.e. if I have complex signals, I
would
>have to filter the real stream and the imaginary stream separately with
the
>same filter, right?

Not separately. each tap will require 4 multipliers:
xr.hr - xi.hi => yr 
xr.hi + xi.hr => yi
the final output y = sum of all products

best of luck

Kaz
0
Reply kaz 8/20/2010 10:00:50 PM

m26k9 wrote:
> @Fred Thank you very much. The paper on mirroring was very useful. No need
> to deal with complex numbers that way.
>> So, my suggestion was to envision what happens when the demodulation is 
>> such that the lowest frequency components are at a bit higher frequency 
>> and the resulting temporal "baseband" signal would be purely real and 
>> the frequency components would be symmetric about f=0 (and maybe 
>> antisymmetric as well).
>>
> 
> I get what you are saying now. I read again on the analytic signal and I
> think it a representation of a passband signal in baseband. I'm used to go
> from baseband (ifft output) to passband. I'm not clear yet as to how the
> temporal signal will be purely real in the case when we demodulate to just
> above f=0, but I will go back to the equation and see.
> 
> Thank you very much.

If the original signal in frequency has a real IFFT, then moving 
components around by translation should keep its odd/even real/imaginary 
character.  Then the new IFFT should result in a real sequence.

Fred
0
Reply Fred 8/20/2010 11:34:49 PM

Thank you very much Kaz. This is exactly where I lose it.

>However for channel correction, the distortion is likely to be asymmetric
>and additionally you may need to correct phase.
>If you only want to correct amplitude and that amplitude distortion is
>symmetrical(on both sidebands) then real filter is enought.
>

When you say "ONLY want to correct amplitude", does it mean that filter
will have linear-phase?

Also, if we suppose the channel is asymmetric, can we double the number of
points and mirror the channel frequency spectrum and make the filter?
wouldn't it make the filter real?

Thank  you.
0
Reply m26k9 8/21/2010 5:21:38 AM

Thank you very much Fred.

>If the original signal in frequency has a real IFFT, then moving 
>components around by translation should keep its odd/even real/imaginary 
>character.  Then the new IFFT should result in a real sequence.
>

I'm starting to slowly get it. Atleast I hope so. 
I think the way "frequency sampling method" using is same as the mirroring
method given in the paper you referred. If we mirror the filter spectrum
(which we want to find the coefficients), then we'd get real filter
coefficients, right?

Thank you.
0
Reply m26k9 8/21/2010 5:25:50 AM

>Thank you very much Kaz. This is exactly where I lose it.
>
>>However for channel correction, the distortion is likely to be
asymmetric
>>and additionally you may need to correct phase.
>>If you only want to correct amplitude and that amplitude distortion is
>>symmetrical(on both sidebands) then real filter is enought.
>>
>
>When you say "ONLY want to correct amplitude", does it mean that filter
>will have linear-phase?


Yes, if you run my above examples in Matlab, you will see that inverse sinc
amplitude is corrected while the complex filter maintains linear phase
because I did not enter any phase corrections.

>
>Also, if we suppose the channel is asymmetric, can we double the number
of
>points and mirror the channel frequency spectrum and make the filter?
>wouldn't it make the filter real?
>
>Thank  you.

There are two perspectives:
(1)If you are filtering in the baseband to correct a signal later
translated up in frequency then only complex filter can do the job.

(2) if you are filtering the translated signal itself (in the high speed
domain) then you can use a real bandpass filter with the required response

Kaz
>
0
Reply kaz 8/21/2010 7:45:39 AM

Thank you very much Kaz.

>(1)If you are filtering in the baseband to correct a signal later
>translated up in frequency then only complex filter can do the job.
>

Is this because the signals are complex? For example, as the reference by
Fred says, the output of a IFFT in a DSL system is real. Because the input
(to the IFFT) is mirrored so that the IFFT output is real. But this output
is still 'baseband', in the sense that it is not up converted. Do we still
need a complex filter for this baseband signal?

I'm trying to confirm whether the fact that a complex filter is required
because the input is complex, or it is because of the channel.

Thank you.
0
Reply m26k9 8/21/2010 8:09:45 AM

>Thank you very much Kaz.
>
>>(1)If you are filtering in the baseband to correct a signal later
>>translated up in frequency then only complex filter can do the job.
>>
>
>Is this because the signals are complex? For example, as the reference by
>Fred says, the output of a IFFT in a DSL system is real. Because the
input
>(to the IFFT) is mirrored so that the IFFT output is real. But this
output
>is still 'baseband', in the sense that it is not up converted. Do we
still
>need a complex filter for this baseband signal?
>
>I'm trying to confirm whether the fact that a complex filter is required
>because the input is complex, or it is because of the channel.
>
>Thank you.
>

Because of the channel requirements...

From the perspective of our discussion, complex filter in the baseband is
solely for asymmetric filtering around dc which then translates to the two
sidebands upon upconversion for channel correction. If baseband filtering
is not complex then the correction on either side of dc will mirror and the
asymmetric correction fails.

just because a signal is complex does not mean you must apply complex
filter. In fact you shouldn't. Remember the I/Q are both real in design, we
only assume they are members of a complex pair when we do computations. So
as I said in pulse shaping of I/Q you don't need complex filter but two
identical real filters because you are not targetting any assymetric
response but just pulse shaping of each member.

For channel correction If your baseband signal to be filtered is real then
you need to break it up into two vertical components to become "complex".

You can also apply complex filter to real signal for some other purposes:

There is at least one more case to use complex filter: to break up a real
signal to two components (just like Hilbert transform) but this is not our
issue here and in that case you feed one real signal to get Re/Im(two
multipliers per tap).
If you apply complex filter to real signal only i.e. (x) is just x not
xr/xi but filter is hr/hi then we are talking about converting real x to a
complex pair and if your cutoff is brickwall at dc then you have broken up
the real signal to good complex pair.

Regards

Kaz


0
Reply kaz 8/21/2010 9:09:54 AM

Thank you very much Kaz.

>From the perspective of our discussion, complex filter in the baseband is
>solely for asymmetric filtering around dc which then translates to the
two
>sidebands upon upconversion for channel correction. If baseband filtering
>is not complex then the correction on either side of dc will mirror and
the
>asymmetric correction fails.

So for example if I am trying to equalize a Rayleigh fading channel, then I
must have a complex filter, regardless my signal is complex or not?

>just because a signal is complex does not mean you must apply complex
>filter. In fact you shouldn't. Remember the I/Q are both real in design,
we
>only assume they are members of a complex pair when we do computations.
So
>as I said in pulse shaping of I/Q you don't need complex filter but two
>identical real filters because you are not targetting any assymetric
>response but just pulse shaping of each member.
>

Sorry for troubling you so much. But just to clear up, if I say my baseband
signal is:

x(t) = x_r(t) + i*x_i(t)

Then my passband signal will be:

x_p(t) = x_r(t)cos(2.pi.f.t) - x_i(t)sin(2.pi.f.t)

Now the passband is purely real, with an in-phase component and a
quadrature. If I am filtering this signal ofcourse need a single filter
right? What you are saying about two pulse shaping filters are the filters
for I and Q are to shape x_r(t) and x_i(t) right?

Thank you very much Kaz.

0
Reply m26k9 8/21/2010 9:57:14 AM

>Thank you very much Kaz.
>
>>From the perspective of our discussion, complex filter in the baseband
is
>>solely for asymmetric filtering around dc which then translates to the
>two
>>sidebands upon upconversion for channel correction. If baseband
filtering
>>is not complex then the correction on either side of dc will mirror and
>the
>>asymmetric correction fails.
>
>So for example if I am trying to equalize a Rayleigh fading channel, then
I
>must have a complex filter, regardless my signal is complex or not?
>
>>just because a signal is complex does not mean you must apply complex
>>filter. In fact you shouldn't. Remember the I/Q are both real in design,
>we
>>only assume they are members of a complex pair when we do computations.
>So
>>as I said in pulse shaping of I/Q you don't need complex filter but two
>>identical real filters because you are not targetting any assymetric
>>response but just pulse shaping of each member.
>>
>
>Sorry for troubling you so much. But just to clear up, if I say my
baseband
>signal is:
>
>x(t) = x_r(t) + i*x_i(t)
>
>Then my passband signal will be:
>
>x_p(t) = x_r(t)cos(2.pi.f.t) - x_i(t)sin(2.pi.f.t)
>
>Now the passband is purely real, with an in-phase component and a
>quadrature. If I am filtering this signal ofcourse need a single filter
>right? What you are saying about two pulse shaping filters are the
filters
>for I and Q are to shape x_r(t) and x_i(t) right?
>
>Thank you very much Kaz.

To me, a pair of Re/Im vectors or I/Q is the complex signal. In
implementation each member is real but the pair is complex if treated so.

Now I will put the concepts as follows:

(1) ideal case: you have complex(xr,xi) signal inputing a
complex(hr,hi)filter outputing complex(yr,yi).
In this case you have full control over amplitude/phase across both sides
of 0 frequency.

The phase is controllable through ampl of both channels.

requires 4 mult per tap, can be reduced to 3/tap.

(2) subset 1: you have x only inputing into complex(hr,hi) outputing
complex(yr,yi);
you can control amplitude of yr/yi and hence the output phase as well.
But controlling phase of x is more difficult now.

requires 2 mult/tap

(3) subset 2: real x into real h outputing real y. The real filter as we
know it.

requires 1 mult/tap

It is then up the application which one to choose.

Regards

Kaz


0
Reply kaz 8/21/2010 12:44:07 PM

>Now I will put the concepts as follows:
>
>(1) ideal case: you have complex(xr,xi) signal inputing a
>complex(hr,hi)filter outputing complex(yr,yi).
>In this case you have full control over amplitude/phase across both sides
>of 0 frequency.
>
>The phase is controllable through ampl of both channels.
>
>requires 4 mult per tap, can be reduced to 3/tap.
>
>(2) subset 1: you have x only inputing into complex(hr,hi) outputing
>complex(yr,yi);
>you can control amplitude of yr/yi and hence the output phase as well.
>But controlling phase of x is more difficult now.
>
>requires 2 mult/tap
>
>(3) subset 2: real x into real h outputing real y. The real filter as we
>know it.
>
>requires 1 mult/tap
>
>It is then up the application which one to choose.
>

Thank you very much Kaz. Those are very helpful points. I'm going to back
to the text books and comparing with the points here. I think I have the
baseband case figured out. 

Please excuse me. I just one more question.
When I want to make a filter for a passband, do I make an equivalent
baseband filter and then shift it to the carrier frequency? For example, I
know the frequency spectrum (or just magnitude) and I want to make a filter
for that. Say from (f_c-W/2) to (f_c+W/2). How would I know if it is
symmetric or not? 

The "frequency sampling method" of making a filter says that I define the
number of taps I want, say M, and then chose my number of sample points N,
as M=2N+1. Then I define a symmetric frequency response (which I desire),
from 0 to N/2, and mirror it for N/2+1 to N-1, and do the calculations.
This will give a real-coefficient, linear-phase filter. The same method
used in fir2() of Matlab I think.

I;m very sorry for bothering you. And thank you so much for all the help.
They real cleared lot of doubtful points to me.

Cheers. 


0
Reply m26k9 8/21/2010 2:18:22 PM

>
>>Now I will put the concepts as follows:
>>
>>(1) ideal case: you have complex(xr,xi) signal inputing a
>>complex(hr,hi)filter outputing complex(yr,yi).
>>In this case you have full control over amplitude/phase across both
sides
>>of 0 frequency.
>>
>>The phase is controllable through ampl of both channels.
>>
>>requires 4 mult per tap, can be reduced to 3/tap.
>>
>>(2) subset 1: you have x only inputing into complex(hr,hi) outputing
>>complex(yr,yi);
>>you can control amplitude of yr/yi and hence the output phase as well.
>>But controlling phase of x is more difficult now.
>>
>>requires 2 mult/tap
>>
>>(3) subset 2: real x into real h outputing real y. The real filter as we
>>know it.
>>
>>requires 1 mult/tap
>>
>>It is then up the application which one to choose.
>>
>
>Thank you very much Kaz. Those are very helpful points. I'm going to back
>to the text books and comparing with the points here. I think I have the
>baseband case figured out. 
>
>Please excuse me. I just one more question.
>When I want to make a filter for a passband, do I make an equivalent
>baseband filter and then shift it to the carrier frequency? For example,
I
>know the frequency spectrum (or just magnitude) and I want to make a
filter
>for that. Say from (f_c-W/2) to (f_c+W/2). How would I know if it is
>symmetric or not? 
>
>The "frequency sampling method" of making a filter says that I define the
>number of taps I want, say M, and then chose my number of sample points
N,
>as M=2N+1. Then I define a symmetric frequency response (which I desire),
>from 0 to N/2, and mirror it for N/2+1 to N-1, and do the calculations.
>This will give a real-coefficient, linear-phase filter. The same method
>used in fir2() of Matlab I think.
>

Please feel free to ask, it is helpful to us all.

when you target a given frequency response, you design it relative to
filter's sampling frequency (Fs). Normally you do that directly and can
control the range (-5Fs ~ +.5Fs, mirrored if real)

But it is possible - if desired - to frequency translate the response i.e.
shape the response in a lower band then multiply by a sine to move the
response from its dc centre to higher required fc but this should not
violate the sampling rule that the filter response is only correct within
-.5Fs to +.5Fs

This is just another way for designing filter. In all cases, your reference
point is the Fs of your filter. 

When you upconvert the filtered signal further, the upconversion will
respect your original response but will push the two sides around zero to
the new centre as two sidebands which will be symmetrical unless your
filter was complex.

At the limit, you can shift it right to .5Fs by changing sign of every
other coeff and this means the first Nyquist zone becomes mirror image of
second zone(inverted left right).

Regards

kaz

0
Reply kaz 8/21/2010 3:19:05 PM

m26k9 wrote:
> Thank you very much Fred.
> 
>> If the original signal in frequency has a real IFFT, then moving 
>> components around by translation should keep its odd/even real/imaginary 
>> character.  Then the new IFFT should result in a real sequence.
>>
> 
> I'm starting to slowly get it. Atleast I hope so. 
> I think the way "frequency sampling method" using is same as the mirroring
> method given in the paper you referred. If we mirror the filter spectrum
> (which we want to find the coefficients), then we'd get real filter
> coefficients, right?
> 
> Thank you.

Hmmmm...

I'm afraid there may be a lingering misconception that I'd thought 
we/you had gotten past by now.

I didn't dig into the mirroring part - I just noticed it, thought it was 
pertinent, and mentioned it.  But, with that limited view, I thought it 
applied to a *signal* representation - not a filter.

So, to shift gears.  The original post and the continuing thread title 
includes "Linear-ophase FIR" and, in that same post, you said:
"I have the frequency transfer function (magnitude) of the channel
and want to design a pre-equalizer for that."

I have a very hard time imagining that the frequency transfer function 
comes about due to a linear phase channel (with time-symmetric 
spreading).  But, maybe for a limited bandwidth that's an OK assumption. 
  Still, it raises the question: "Why linear phase?"

The frequency sampling method is just a rather simple approach to 
practical filter design.  It's not a direct approximation method so, I 
think, it's not an optimum design approach in any particular sense for a 
filter - even though the window used may have some optimum properties of 
one kind or another - that part is treated rather extensively 
referencing Temes, Harris, Nuttall papers.

Or, you might use the Parks-McClellan program to design a filter of 
choice - and that program sticks with linear phase designs.

No matter the approach, you start with a real "ideal" real frequency 
response that is symmetrical about zero in frequency which when windowed 
remains so.  When inverse transformed it ends up with a filter that has 
real coefficients.  That's just the normal thing.

The less normal thing so to speak would be this:
You have basebanded (to zero) a bandpass function and want to filter it 
somehow.
Part of your filter specification makes it to be *not* symmetrical about 
zero frequency.  In that case you'd have a complex filter that would 
generally be applied to a complex sequence.  For example, a filter to 
remove the resulting negative frequencies of a waveform that's been 
basebanded about zero frequency would be asymmetrical in frequency and 
have complex temporal coefficients.

Given a filter with real coefficients, you apply it to the signal.
- By superposition, you can apply it to the signal components first and 
then combine the results.
- Those parts might be anything including even/odd (which might be hard 
to do in a streaming context) or real/imaginary.
The resulting sum can be complex if the input is complex.

If the input is complex and the filter is complex then you have 4 
outputs to combine into 2:
you combine the real outputs resulting from:
- the real inputs and the real coefficients
- the imaginary inputs and the imaginary coefficients
you combine the imaginary outputs resulting from:
- the real coefficients and the imaginary coefficients
- the imaginary inputs and the real coefficients.

I think it helps to consider this question:
"What does it mean to have a FIR filter with complex coefficients?"
Take a very simple 1-coefficient FIR filter with complex coefficient
"0 + 1j"
A purely real input will result in a purely imaginary output.  Why would 
you want that?
In the real world this filter does *nothing* except add a "label" to the 
real output - a label that you can use or ignore.

Now you can read about Hilbert transforms and Hartley modulators, etc. 
if you'd rather see the math in better form or gain more insight.

In the real world, getting a 90 degree phase shift at all frequencies is 
a bit of a challenge.  The Parks-McClellan program designs a Hilbert 
Transformer FIR filter - which approximates a 90 degree phase shift at 
all frequencies and, of course, everything is "real".

I might suggest this:

- If you want to equalize a dispersive channel with a FIR filter then 
that implies a deconvolution.  e.g. pulse spreading would be sharpened, 
etc.  I don't relate that to linear phase.  And, linear phase isn't 
minimum delay which is often a consideration.  But, linear phase filters 
are likely easier to design in view of the tools that are available. 
Presumably there is already phase distortion that you'd like to remove - 
and linear phase means that it won't do anything to delay except add a 
constant.

- If the signal to be filtered is in a complex form then that just means 
the signal has multiple "parts" to be filtered separately.

- It likely pays to separate the objectives from the implementation 
details.  First the objectives, then answer "how to do this?" and 
consider the alternatives both in the objectives and the 
implementations.  So far the two seem a bit mixed together....

Fred





0
Reply Fred 8/21/2010 7:04:13 PM

>Please feel free to ask, it is helpful to us all.
>
>when you target a given frequency response, you design it relative to
>filter's sampling frequency (Fs). Normally you do that directly and can
>control the range (-5Fs ~ +.5Fs, mirrored if real)
>
>But it is possible - if desired - to frequency translate the response
i.e.
>shape the response in a lower band then multiply by a sine to move the
>response from its dc centre to higher required fc but this should not
>violate the sampling rule that the filter response is only correct within
>-.5Fs to +.5Fs
>
>This is just another way for designing filter. In all cases, your
reference
>point is the Fs of your filter. 
>
>When you upconvert the filtered signal further, the upconversion will
>respect your original response but will push the two sides around zero to
>the new centre as two sidebands which will be symmetrical unless your
>filter was complex.
>
>At the limit, you can shift it right to .5Fs by changing sign of every
>other coeff and this means the first Nyquist zone becomes mirror image of
>second zone(inverted left right).
>

Thank you very much Kaz. For once in this thread I *think* the answer was
what I thought it would be. 
As you said all along, it's the filter response that decides whether the
coefficients will be real or complex. And mirroring the frequency response
is not going to give the response I desire. 

So even if the input signal is complex, which will have asymmetric
frequency response around f=0, if I *want* to filter this signal such that
frequencies f and (-f) multiplies by the same magnitude, I can still use a
real filter? I know this is a very unlikely case, but just to confirm if I
understood this correctly.

Thank you very much Kaz. 

@Fred: Thank you very much again for the very comprehensive explanation. I
going through it couple of times to really understand it. I have
misunderstood number of things. I will post again after reading in
throughly again. Thank you both very much. 
0
Reply m26k9 8/22/2010 5:34:03 AM

>
>Thank you very much Kaz. For once in this thread I *think* the answer was
>what I thought it would be. 
>As you said all along, it's the filter response that decides whether the
>coefficients will be real or complex. And mirroring the frequency
response
>is not going to give the response I desire. 
>
>So even if the input signal is complex, which will have asymmetric
>frequency response around f=0, if I *want* to filter this signal such
that
>frequencies f and (-f) multiplies by the same magnitude, I can still use
a
>real filter? I know this is a very unlikely case, but just to confirm if
I
>understood this correctly.
>
>Thank you very much Kaz. 

Yes you can, input is asymmetric but real filtering will be symmetric and
so will pass the input asymmetry unmodified. If you target to equalise the
input including its asymmetry then you need "reverse the asymmetry by
opposite asymmetry".

Regards

kaz
0
Reply kaz 8/22/2010 7:35:05 AM

>
>Yes you can, input is asymmetric but real filtering will be symmetric and
>so will pass the input asymmetry unmodified. If you target to equalise
the
>input including its asymmetry then you need "reverse the asymmetry by
>opposite asymmetry".
>

Thank you very much Kaz. I'm putting everything I got in this thread
together now. Hope everything falls in to the right pieces. Thank you very
much for all the help in this matter.
0
Reply m26k9 8/22/2010 9:10:58 AM

Fred thank you very much for taking time to explain this in detail. I'm
going through your points and trying to fit in things I understood so far.
Please bear with me.


>I have a very hard time imagining that the frequency transfer function 
>comes about due to a linear phase channel (with time-symmetric 
>spreading).  But, maybe for a limited bandwidth that's an OK assumption. 
>  Still, it raises the question: "Why linear phase?"

Actually the specification I have is just the frequency magnitudes so I was
working under the assumption that the channel phase distortion is linear.
This could very well not be the case, but right now I am only worried about
getting the theory understood.


>No matter the approach, you start with a real "ideal" real frequency 
>response that is symmetrical about zero in frequency which when windowed 
>remains so.  When inverse transformed it ends up with a filter that has 
>real coefficients.  That's just the normal thing.

Why do I start with a "real" frequency and then window it to get real
coefficients? This seems like the "frequency sampling method" algorithm. 

Let me give this example, which is also what I actually want to do, and
please tell me if I am wrong.

Consider a DMT system, the transmitter end. The ifft routine is input with
'N' complex QAM symbols. The output is then complex and asymmetric about
f=0 (because the input QAM data are complex). Now this output has frequency
components going from (-N/2) to (N/2), where H[f]!=H*[-f], 0<f<N/2. It is
asymmetric.

Case 1)
I want to equalize this (complex and asymmetric) output according to a
desired frequency response G[f], where -N/2<f<N/2. And the response of G[f]
is asymmetric (as will be in most cases). So  G[f]!=G*[-f], 0<f<N/2. 

Now, since the frequency response of G[f] is asymmetric, I must have a
complex filter, right?

Case 2)
Although my signal spectrum is asymmetric, I want to equalize them in a
symmetric way (just a hypothetical case probably not done is practice). My
filter response is  thus, symmetric, giving  G[f]=G*[-f], 0<f<N/2.

Now in "this" case, I can have a filter that has real coefficients because
it is symmetric, right?

Few questions I want to ask.

Q1) In both case 1 and case 2, whether the filter is real or complex was
dependent on the frequency spectrum of the filter (symmetric or
asymmetric), and not whether the input signal is real or complex.

Q2) I have not taken in to account of the phase response of the filter.
Does the phase response have connection to whether the filter is real or
complex? I mean, I could have a symmetric filter without it being
linear-phase right? In other words, a filter can be real but not linear
phase, can it not?


Thank you very much Fred. I am greatly sorry for bothering you with all
these questions. These are information I find hard to get from standard DSP
text books. If you could recommend me a text that would also be very
helpful. Thank you very much once again.


0
Reply m26k9 8/22/2010 1:26:13 PM

On Aug 22, 1:34=A0am, "m26k9" <maduranga.liyanage@n_o_s_p_a_m.gmail.com>
wrote:
> >Please feel free to ask, it is helpful to us all.
>
> >when you target a given frequency response, you design it relative to
> >filter's sampling frequency (Fs). Normally you do that directly and can
> >control the range (-5Fs ~ +.5Fs, mirrored if real)
>
> >But it is possible - if desired - to frequency translate the response
> i.e.
> >shape the response in a lower band then multiply by a sine to move the
> >response from its dc centre to higher required fc but this should not
> >violate the sampling rule that the filter response is only correct withi=
n
> >-.5Fs to +.5Fs
>
> >This is just another way for designing filter. In all cases, your
> reference
> >point is the Fs of your filter.
>
> >When you upconvert the filtered signal further, the upconversion will
> >respect your original response but will push the two sides around zero t=
o
> >the new centre as two sidebands which will be symmetrical unless your
> >filter was complex.
>
> >At the limit, you can shift it right to .5Fs by changing sign of every
> >other coeff and this means the first Nyquist zone becomes mirror image o=
f
> >second zone(inverted left right).
>
> Thank you very much Kaz. For once in this thread I *think* the answer was
> what I thought it would be.
> As you said all along, it's the filter response that decides whether the
> coefficients will be real or complex. And mirroring the frequency respons=
e
> is not going to give the response I desire.
>
> So even if the input signal is complex, which will have asymmetric
> frequency response around f=3D0, if I *want* to filter this signal such t=
hat
> frequencies f and (-f) multiplies by the same magnitude, I can still use =
a
> real filter?

it's a filter with real coefficients.  if your input is complex, then
either internally, the FIR knows how to do a real x complex + complex -
> complex  multiply-accumulate.  or, it's like to have two parallel
real filters with identical real coefficients, and one is working on
the real part of your complex input and the other is working on the
imaginary part.  since all of the coefficients are real, there is no
crosstalk between these two filters.  reals stay real, imaginary parts
stay imaginary.

r b-j
0
Reply robert 8/22/2010 6:07:29 PM

Thank you very much r b-j.

>it's a filter with real coefficients.  if your input is complex, then
>either internally, the FIR knows how to do a real x complex + complex -
>> complex  multiply-accumulate.  or, it's like to have two parallel
>real filters with identical real coefficients, and one is working on
>the real part of your complex input and the other is working on the
>imaginary part.  since all of the coefficients are real, there is no
>crosstalk between these two filters.  reals stay real, imaginary parts
>stay imaginary.

I understand that it can two parallel filters working on the real and
imaginary parts of a complex signal, but this is only if the filter has
real coefficients.

In case the filter is complex, then we cannot have two parallel filters,
can we? We need to do 4 multiplications/tap and cannot process the real and
imaginary parts individually, right?

Or are you implying that all filters have real coefficients only when you
say "it's a filter with real coefficients"?

Thank you very much.
0
Reply m26k9 8/23/2010 3:35:58 AM

On Aug 22, 11:35=A0pm, "m26k9"
<maduranga.liyanage@n_o_s_p_a_m.gmail.com> wrote:
> Thank you very much r b-j.
>
> >it's a filter with real coefficients. =A0if your input is complex, then
> >either internally, the FIR knows how to do a real x complex + complex -
> >> complex =A0multiply-accumulate. =A0or, it's like to have two parallel
> >real filters with identical real coefficients, and one is working on
> >the real part of your complex input and the other is working on the
> >imaginary part. =A0since all of the coefficients are real, there is no
> >crosstalk between these two filters. =A0reals stay real, imaginary parts
> >stay imaginary.
>
> I understand that it can two parallel filters working on the real and
> imaginary parts of a complex signal, but this is only if the filter has
> real coefficients.
>
> In case the filter is complex, then we cannot have two parallel filters,
> can we? We need to do 4 multiplications/tap and cannot process the real a=
nd
> imaginary parts individually, right?

not precisely.  now there are 4 FIR filters, two identical pairs, one
pair has the real part of the complex h[n], the other pair has the
imaginary part of h[n].

you can process each of the real input and the imaginary input
individually with one each of the pair... so far everything is
separate, then at the final real and imaginary outputs, you combine
the FIR outputs according to the rules of complex number
multiplication.


                                          .------------.
               .----> Re{ x[n] }  --.---->| Re{ h[n] } |----> y1[n]
               |                    |     '------------'
               |                    |
               |                    |     .------------.
               |                    '---->| Im{ h[n] } |----> y2[n]
               |                          '------------'
     x[n] ---->|
               |
               |
               |                          .------------.
               '----> Im{ x[n] }  --.---->| Re{ h[n] } |----> y3[n]
                                    |     '------------'
                                    |
                                    |     .------------.
                                    '---->| Im{ h[n] } |----> y4[n]
                                          '------------'



then  y[n]  =3D Re{ y[n] }  +  j*Im{ y[n] }

and

       Re{ y[n] } =3D y1[n]  -  y4[n]

       Im{ y[n] } =3D y2[n]  +  y3[n]


> Or are you implying that all filters have real coefficients only when you
> say "it's a filter with real coefficients"?

when you actually do something real in reality, you will be doing it
with real numbers.  *even* if you are doing DSP on complex-valued
signals.  you are really doing it to their real and imaginary parts
according to sensible rules we learned about arithmetic regarding
complex numbers.

now, all of this complex coefficient thingie is *independent* of
whether or not it is linear phase.

r b-j
0
Reply robert 8/23/2010 2:21:41 PM

m26k9 wrote:
>> "Why linear phase?"
> 
> Actually the specification I have is just the frequency magnitudes so I was
> working under the assumption that the channel phase distortion is linear.
> This could very well not be the case, but right now I am only worried about
> getting the theory understood.

***OK.  It is almost certainly *not* linear phase.  That would be most 
unusual.

> 
> 
>> No matter the approach, you start with a real "ideal" real frequency 
>> response that is symmetrical about zero in frequency which when windowed 
>> remains so.  When inverse transformed it ends up with a filter that has 
>> real coefficients.  That's just the normal thing.
> 
> Why do I start with a "real" frequency and then window it to get real
> coefficients? This seems like the "frequency sampling method" algorithm. 

***The algorithm has nothing to do with it.  This applies to all 
methods.  You can skip the windowing or not ... that's a choice you make.

> 
> Let me give this example, which is also what I actually want to do, and
> please tell me if I am wrong.
> 
> Consider a DMT system, the transmitter end. The ifft routine is input with
> 'N' complex QAM symbols. The output is then complex and asymmetric about
> f=0 (because the input QAM data are complex). Now this output has frequency
> components going from (-N/2) to (N/2), where H[f]!=H*[-f], 0<f<N/2. It is
> asymmetric.

***OK - I don't understand DMT well but OK.

> 
> Case 1)
> I want to equalize this (complex and asymmetric) output according to a
> desired frequency response G[f], where -N/2<f<N/2. And the response of G[f]
> is asymmetric (as will be in most cases). So  G[f]!=G*[-f], 0<f<N/2. 
> 
> Now, since the frequency response of G[f] is asymmetric, I must have a
> complex filter, right?

***Yes, a filter designed to meet the specified frequency response will 
generally have complex coefficients.

> 
> Case 2)
> Although my signal spectrum is asymmetric, I want to equalize them in a
> symmetric way (just a hypothetical case probably not done is practice). My
> filter response is  thus, symmetric, giving  G[f]=G*[-f], 0<f<N/2.
> 
> Now in "this" case, I can have a filter that has real coefficients because
> it is symmetric, right?

***Yes ... as long as the real and complex modifiers are being applied 
to the temporal filter - which is what you mean when you say 
"coefficients".  Just to make sure I'm being clear what "yes" means.

> 
> Few questions I want to ask.
> 
> Q1) In both case 1 and case 2, whether the filter is real or complex was
> dependent on the frequency spectrum of the filter (symmetric or
> asymmetric), and not whether the input signal is real or complex.

***Correct.

> 
> Q2) I have not taken in to account of the phase response of the filter.
> Does the phase response have connection to whether the filter is real or
> complex? 

***Just consider that phase is computed from the real and imaginary 
parts arctan(Im/Re) in its simplest form.  So, that's like asking if 
either the real or the imaginary part has anything to do with whether 
the filter is real or complex (in time).

I mean, I could have a symmetric filter without it being
> linear-phase right? 

***No.

In other words, a filter can be real but not linear
> phase, can it not?
> 

***Yes - but not "in other words"
Example [1 1 0.5] is real and not linear phase.
The difference or confusion here is between "symmetric" in the first 
statement and "real" in the second statment.
Unless you meant "real" in the frequency domain.  In that case "it depends".
I'll start in the time domain:
- If the filter is real and even about its center then the Fourier 
Transform (for the center at t=0) is real and even and the phase is 
linear (fixed delay).
- If the filter is real and not even about its center (which means it 
also has an odd part) then the Fourier Transform is complex and phase is 
generally not linear (even for the center at t=0).
[As I mentioned earlier, indexing can cloud this.  For example, if you 
take the time response of a filter and *start* it at t=0 then it will 
perforce be not purely even about t=0 and the Fourier Transform will be 
complex.  But, if it's even about its own center then it will still be 
linear phase.  So, the idea is to put t=0 at the center of the filter 
unit sample response for analysis purposes.]
- If the filter is real in time that doesn't make it even about its 
center.  If it's not even then it's not linear phase.
- If the filter is real in frequency then the imaginary part in 
frequency is zero and the phase is zero (for the temporal center at t=0) 
-  a special case of linear phase.  For this to be the case, the 
temporal filter is purely even.
If the temporal center isn't at zero but the evenness remains then the 
filter will be (nonzero) linear phase.

Flat delay means Linear phase.
A delay D causes a phase shift according to wT where D=T is the delay. 
Thus phase varies in direct proportion to the frequency when the delay D 
is fixed.  If the delay D is a function of frequency D(w) then this 
relationship doesn't hold and you have not-linear phase.

FIR filters can be described as:
1) minimum delay
2) linear phase (flat delay)
3) maximum delay
For minumum delay, the filter's zeros are all inside the unit circle.
For flat delay, the filter's zeros appear in reciprocal-magnitude pairs 
inside and outside the unit circle and the imaginary parts are mirrored 
to form a quad.
For maximum delay, the filter's zeros are all outside the unit circle.

Fred
0
Reply Fred 8/23/2010 4:48:40 PM

Thank you very much r b-j.
>
>
>                                          .------------.
>               .----> Re{ x[n] }  --.---->| Re{ h[n] } |----> y1[n]
>               |                    |     '------------'
>               |                    |
>               |                    |     .------------.
>               |                    '---->| Im{ h[n] } |----> y2[n]
>               |                          '------------'
>     x[n] ---->|
>               |
>               |
>               |                          .------------.
>               '----> Im{ x[n] }  --.---->| Re{ h[n] } |----> y3[n]
>                                    |     '------------'
>                                    |
>                                    |     .------------.
>                                    '---->| Im{ h[n] } |----> y4[n]
>                                          '------------'
>


This one helped a lot! 
Thank you very much.
0
Reply m26k9 8/24/2010 3:23:29 AM

Thank you very much Fred once again for taking time to give a very
comprehensive explanation. 

>I'll start in the time domain:
>- If the filter is real and even about its center then the Fourier 
>Transform (for the center at t=0) is real and even and the phase is 
>linear (fixed delay).

*** OK. Understood this part. Phase is linear because phase=0 (imaginary
parts are all zero).

>- If the filter is real and not even about its center (which means it 
>also has an odd part) then the Fourier Transform is complex and phase is 
>generally not linear (even for the center at t=0).

*** Right. Understood so far.
I also want to confirm that a filter with even coefficients also means that
the filter is symmetric (in time). And this makes the frequency response
also real and even (symmetric).

>[As I mentioned earlier, indexing can cloud this.  For example, if you 
>take the time response of a filter and *start* it at t=0 then it will 
>perforce be not purely even about t=0 and the Fourier Transform will be 
>complex.  But, if it's even about its own center then it will still be 
>linear phase.  So, the idea is to put t=0 at the center of the filter 
>unit sample response for analysis purposes.]

*** To confirm that I understood what you mean, this sequence is even (and
symmetric), right? (It gives real and even frequency components).
h = [4 3 2 1 1 2 3];


>- If the filter is real in time that doesn't make it even about its 
>center.  If it's not even then it's not linear phase.

*** It's a little difficult to confirm from the texts because the keywords
even, real and symmetry usually go together with linear-phase. I want to
confirm, that property of linear phase is a consequence of evenness
(conjugate symmetry) of the filter frequency response?

Like you mentioned, if the filter (in time) is real and even, the frequency
response is even and 'real'. Because it is real, the phase response is
linear (phase=0). But this is just one special case. The property of linear
phase comes from conjugate symmetry of frequency response, or there is no
definite relation between linear phase and frequency response symmetry?

>If the temporal center isn't at zero but the evenness remains then the 
>filter will be (nonzero) linear phase.
>

*** Little confused here Fred. Would you be kind enough give me a simple
sequence that is even but not centered at zero? Does it mean a circularly
shifted version of a even sequence?


I'm very to trouble you with questions Fred. Thank you very much for all
the effort and time. I very much appreciate it.
0
Reply m26k9 8/24/2010 5:23:25 AM

m26k9 wrote:
> Thank you very much Fred once again for taking time to give a very
> comprehensive explanation. 
> 
>> I'll start in the time domain:
>> - If the filter is real and even about its center then the Fourier 
>> Transform (for the center at t=0) is real and even and the phase is 
>> linear (fixed delay).
> 
> *** OK. Understood this part. Phase is linear because phase=0 (imaginary
> parts are all zero).

***Not exactly.  If the filter is real and even about its center but 
*not* centered at t=0 then the Fourier Transform is complex and the 
phase is linear (fixed delay).  The phase is only zero if the delay is 
zero and that's only the case when it's even and centered at t=0.
> 
>> - If the filter is real and not even about its center (which means it 
>> also has an odd part) then the Fourier Transform is complex and phase is 
>> generally not linear (even for the center at t=0).
> 
> *** Right. Understood so far.
> I also want to confirm that a filter with even coefficients also means that
> the filter is symmetric (in time). And this makes the frequency response
> also real and even (symmetric).

***You have to be careful.  I would say it this way:

A filter with even coefficients also means that
the filter is symmetric (in time) *about its own center*. It's only when 
the center is at t=0 that the frequency response is also real and even 
(symmetric).
> 
>> [As I mentioned earlier, indexing can cloud this.  For example, if you 
>> take the time response of a filter and *start* it at t=0 then it will 
>> perforce be not purely even about t=0 and the Fourier Transform will be 
>> complex.  But, if it's even about its own center then it will still be 
>> linear phase.  So, the idea is to put t=0 at the center of the filter 
>> unit sample response for analysis purposes.]
> 
> *** To confirm that I understood what you mean, this sequence is even (and
> symmetric), right? (It gives real and even frequency components).
> h = [4 3 2 1 1 2 3];

***Yes, in a Matlab notation and FFT sense, this "h" represents a 
sequence that is even around the first sample and repeats at the 
presumed 8th sample or the repetition of the first sample.

> 
> 
>> - If the filter is real in time that doesn't make it even about its 
>> center.  If it's not even then it's not linear phase.
> 
> *** It's a little difficult to confirm from the texts because the keywords
> even, real and symmetry usually go together with linear-phase. I want to
> confirm, that property of linear phase is a consequence of evenness
> (conjugate symmetry) of the filter frequency response?

***Yes, as above.
> 
> Like you mentioned, if the filter (in time) is real and even, the frequency
> response is even and 'real'. Because it is real, the phase response is
> linear (phase=0). But this is just one special case. The property of linear
> phase comes from conjugate symmetry of frequency response, or there is no
> definite relation between linear phase and frequency response symmetry?

***Well, again it pays to be careful and I've probably not been as 
careful as one might be.  If a function is even then that implies it's 
center is at zero really doesn't it?  So, in that case then real/even 
gets real/even and, yes, zero phase.
But if you take one of these real/even temporal sequences and time shift 
it so that it's causal for example then the phase is due to that time 
shift / pure delay and the phase is linear.
> 
>> If the temporal center isn't at zero but the evenness remains then the 
>> filter will be (nonzero) linear phase.

***We probably shouldn't call it "even" then....  Even about its center 
perhaps or symmetric about its center might be better.  But, I'm sure by 
now we know what we're referring to.
>>
> 
> *** Little confused here Fred. Would you be kind enough give me a simple
> sequence that is even but not centered at zero? Does it mean a circularly
> shifted version of a even sequence?

h = [0 0 0 0 4 3 2 1 1 2 3 4 0 0 0 0 0 0 0 0 0 0 0]

This one is symmetric about its center and not centered at zero....
And, yes it could be circularly shifted to take the case you used:

h = [2 1 1 2 3 4 4 3 ]

I think that's right.... it gets just a little tricky when dealing with 
sequences that are thought of as periodic and here we are dealing with 
not quite a single period.

Of course, if we were not assuming a DFT then we could just talk about a 
Fourier Transform of the sequence and, in that case might want to 
include the last sample as in:
h = [4 3 2 1 1 2 3 4]
I'm not sure how to explain this further without thinking about it as 
I've not spent much time explaining it....

Fred
0
Reply Fred 8/25/2010 7:29:32 AM

Thank you very much again Fred. I really appreciate all your effort and
time.

I'm little confused about couple of points. If you could please explain a
bit I'd be really grateful.

I'm having trouble grasping these two points:
1) Even about its center
2) Centered at t=0

How do these two differ? For example cos[n] is even about n=0,pi,2pi,...
So we can't possibly assign a 'center' to cos[n], right? But  it's even and
the FT has real and even components. 

But I am thinking about a filter h[n], from a coefficients point of view,
and no as a function which I can define in 'n'. So filter h[n] will be a
sequence of coefficients. These coefficients can be real or positive. 

Now when we have a sequence h[n], how do we define it's center?

For example, when I gave the sequence h=[4 3 2 1 1 2 3] in the previous
post, I was thinking
h[0]=4;
h[1]=3;
h[2]=2;
h[3]=1;
h[4]=1;
h[5]=2;
h[6]=3;

And h[n]=h[7-n], making it even. I meant that (4,3,2,1) is mirrored by
(1,2,3) and that makes this sequence even. But you said "even around the
first sample and repeats at the presumed 8th sample".

Or we could also have a sequence:
h[-4]=4;
h[-3]=3;
h[-2]=2;
h[-1]=1;
h[ 0]=0;
h[ 1]=1;
h[ 2]=2;
h[ 3]=3;

This sequence is even about n=0, with h[n]=h[-n]. Both these sequences are
even (symmetric) and give real and even FT's.

If we take for example cos(x), and we take a sequence from -pi to pi, it
will be an even sequence about x=0. But if we take x from -0.3*pi to 1.3*pi
(arbitrary multipliers), then this sequence will not be even.

Am I going down a completely wrong line here?

You also mentioned "in FFT sense", do you mean there is a difference if I
consider DFT?

Again I'm very sorry to bother you Fred. I really want to get the theory
understood correctly. Thank you very much for your help.



0
Reply m26k9 8/25/2010 9:08:10 AM

m26k9 wrote:
> Thank you very much again Fred. I really appreciate all your effort and
> time.
> 
> I'm little confused about couple of points. If you could please explain a
> bit I'd be really grateful.
> 
> I'm having trouble grasping these two points:
> 1) Even about its center
> 2) Centered at t=0

1) Its center means, for a sequence indexed from 1 to N the center is at 
1 + (N-1)/2.  So, if N=3 then the center is at 2 and if N=4 then the 
center is at 2 1/2.

The normal test for evenness is:
f(t) = f(-t)
The normal test of oddness is:
f(t) = -f(-t)

So, in the case of an offset T, we can substitute t-T for t.  So, by 
even about its center, I meant a function that has this property:

f(t-T) = f(-t+T)
which is a more general case than just for T=0.  It takes out the time 
offset, if any.

Your (1) and (2) are a bit sloppy terminology:
"1) Even about its center" means the above.
"2) Centered at t=0" means that the sequence runs from -(N-1)/2 to (N-1)/2.
If N is an odd number then there is a sample at t=0.
If N is an even number then there is not a sample at zero and samples 
occur at noninteger values of time (of the sample interval) because 
(N-1)/2 has a fractional part.
So, I'll add (3):
3) Not centered at t=0 but at T means that the sequence runs from [T - 
(N-1)/2] to [T + (N-1)/2].  This could be an example of a causal 
sequence where T is a positive number and >= (N-1)/2.

> 
> How do these two differ? 
***As stated, they don't relate very well.  That's why I restated and added.

For example cos[n] is even about n=0,pi,2pi,...
> So we can't possibly assign a 'center' to cos[n], right? But  it's even and
> the FT has real and even components. 

***I would say "it depends".  Are we talking now about continuous and 
infinite functions like a sinusoid?  That seems a switch in focus.  If 
they are infinite then the same test above applies but you may as well 
use zero as the "center" or whatever point you decide is useful in your 
purpose.
But, if we are talking about sampled data (I thought we were) and finite 
sequences then there is the matter of indexing and where you define zero 
time, etc.
> 
> But I am thinking about a filter h[n], from a coefficients point of view,
> and no as a function which I can define in 'n'. So filter h[n] will be a
> sequence of coefficients. These coefficients can be real or positive.

*Does that mean if they are positive that they can't be real???  :-(

> 
> Now when we have a sequence h[n], how do we define it's center?
> 
> For example, when I gave the sequence h=[4 3 2 1 1 2 3] in the previous
> post, I was thinking
> h[0]=4;
> h[1]=3;
> h[2]=2;
> h[3]=1;
> h[4]=1;
> h[5]=2;
> h[6]=3;
> 
> And h[n]=h[7-n], making it even. I meant that (4,3,2,1) is mirrored by
> (1,2,3) and that makes this sequence even. But you said "even around the
> first sample and repeats at the presumed 8th sample".

***You've taken what I said out of context.  The complete statement was:
"***Yes, in a Matlab notation and FFT sense, this "h" represents a 
sequence that is even around the first sample and repeats at the 
presumed 8th sample or the repetition of the first sample."

In a Matlab notation and FFT sense it would be written:
 > h[1]=4;
 > h[2]=3;
 > h[3]=2;
 > h[4]=1;
 > h[5]=1;
 > h[6]=2;
 > h[7]=3;
where h[1] is aligned with t=0.
And, since it's treated as if circular then
mapping this into sample times as g(n)and extending it:

..
..
..
..
g[-10]=1
g[-9]=2
g[-8]=3
g[-7]=4
g[-6]=3
g[-5]=2
g[-4]=1
g[-3]=1
g[-2]=2
g[-1]=3
g[0]=4
g[1]=3
g[2]=2
g[3]=1
g[4]=1
g[5]=2
g[6]=3
g[7]=4
g[8]=3
g[9]=2
g[10]=1
..
..
..
So, as you should be able to observe, this sequence is even about t=0 
where the g[0] sample resides.

Converting this to Matlab notation,
g(n)=h(n+1)
(where the negative and zero indices are undefined)
and the sequence repeats after g(6) or h(7) at f(7) or the nonexistent 
h(8) which we assume is h(1).

Thus as I said:
"even around the first sample and repeats at the presumed 8th sample".

> 
> Or we could also have a sequence:
> h[-4]=4;
> h[-3]=3;
> h[-2]=2;
> h[-1]=1;
> h[ 0]=0;
> h[ 1]=1;
> h[ 2]=2;
> h[ 3]=3;
> 
> This sequence is even about n=0, with h[n]=h[-n]. Both these sequences are
> even (symmetric) and give real and even FT's.

***I don't know what notation you're using but it isn't the Matlab that 
I know where indices start at 1.  If these are arbitrary sample indices 
then OK.  But somehow you would need to resolve your time reference for 
the FFT so that phase is correct.  Maybe you've done that and maybe not. 
   I can't tell.

As far as I know, most of the FFT programs take a real time sequence as 
input with the first sample of the sequence assumed to be at zero time. 
  So, that's what I mean....  If you want to input for negative time 
(and because we are assuming the temporal sequence to be periodic and 
the sequence to be one period), then you put the negative time samples 
at the upper end of the sequence.  So, your example here would look like:
[0 1 2 3 4 3 2 1] *IF* by h[-4] you mean "the sample taken at time -4T" 
and -4T is on the time axis referenced to t=0 coinciding with h(0).
> 
> If we take for example cos(x), and we take a sequence from -pi to pi, it
> will be an even sequence about x=0. But if we take x from -0.3*pi to 1.3*pi
> (arbitrary multipliers), then this sequence will not be even.
> 
> Am I going down a completely wrong line here?

***No you have it right I think.  The issue is where in the FFT input 
sequence is the sample at t=0 located and is there any wrapping for 
samples taken at negative time?
> 
> You also mentioned "in FFT sense", do you mean there is a difference if I
> consider DFT?

No.  An FFT is an implementation of the DFT.  Both terms mean a DFT from 
a mathematical point of view.
0
Reply Fred 8/27/2010 5:24:32 PM

Thank you very much again Fred. 


>3) Not centered at t=0 but at T means that the sequence runs from [T - 
>(N-1)/2] to [T + (N-1)/2].  This could be an example of a causal 
>sequence where T is a positive number and >= (N-1)/2.

This point is very useful. Cleared quite a bit. Thank you.


>*Does that mean if they are positive that they can't be real???  :-(

I actually meant to say real or complex. Sorry for the mistake.


>***I don't know what notation you're using but it isn't the Matlab that 
>I know where indices start at 1.  If these are arbitrary sample indices 
>then OK.  But somehow you would need to resolve your time reference for 
>the FFT so that phase is correct.  Maybe you've done that and maybe not. 
>   I can't tell.

Sorry. They are supposed to be arbitrary sample indices. What I wanted to
say was that, when we take a sequence of values it could be from 0 to (N-1)
or (-N+3 to 2) or any other arbitrary range. But when we feed those values
to a FFT routine, they it assumes the samples are from (-N/2 to N/2) or (0
to N-1) or a period therewith. But as you said, if the sequence is even in
the range from [T -(N-1)/2] to [T + (N-1)/2], then I guess there is no
ambiguity.



Thank you so very much Fred. I think I have the basics down. Need to put
those together in to one big picture now. Thank you very much for your
time, effort and patience. 
0
Reply m26k9 8/30/2010 2:39:35 AM

m26k9 wrote:
.......................ell.
> 
> Sorry. They are supposed to be arbitrary sample indices. What I wanted to
> say was that, when we take a sequence of values it could be from 0 to (N-1)
> or (-N+3 to 2) or any other arbitrary range. But when we feed those values
> to a FFT routine, they it assumes the samples are from (-N/2 to N/2) or (0
> to N-1) or a period therewith. But as you said, if the sequence is even in
> the range from [T -(N-1)/2] to [T + (N-1)/2], then I guess there is no
> ambiguity.
> 



***Well, there won't be any ambiguity if you consider a circular 
rotation that makes it even about the presumed zero-time sample before 
you do an FFT.

***Otherwise the result will be complex and you may be confused.The 
point of discussing indices was that a sequence *can* result in a 
real/even FFT but you have to index it properly.  i.e. time shift it, 
circularly shift it first perhaps so that it goes to the FFT being even 
in time about t=0.  If it's even about some other point then the FFT 
will be complex.  That's often fine but if it's not what you expect then 
it could be a concern or a confusion factor.

> 
> Thank you so very much Fred. I think I have the basics down. Need to put
> those together in to one big picture now. Thank you very much for your
> time, effort and patience. 

You're welcome!
0
Reply Fred 8/30/2010 6:52:11 AM

>***Well, there won't be any ambiguity if you consider a circular 
>rotation that makes it even about the presumed zero-time sample before 
>you do an FFT.
>

Thank you very much Fred.
I'm doing trying out some sequences in Matlab to confirm that the FFT
process does indeed the give the what I expect. I'm doing good so far :)

Thank you again Fred.
0
Reply m26k9 8/30/2010 9:22:00 AM

50 Replies
321 Views

(page loaded in 0.518 seconds)

Similiar Articles:


















7/24/2012 8:30:42 PM


Reply: