DSPRelated.com
Forums

Linear-phase FIR filter coefficient properties

Started by m26k9 August 18, 2010
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.
>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
>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.
> >>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
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
>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.
> >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
> >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.
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.
On Aug 22, 1:34&#4294967295;am, "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 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?
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