DSPRelated.com
Forums

FIR filter with arbitrary and phase responses

Started by klayman December 11, 2011
>On 12/18/11 5:04 AM, kaz wrote: >> >> However, the original post is about complex filter. Above trick implies >> real filter I think. > >lessee, what's a complex filter? one with complex voltages going in and >coming out? (i would like to get my hands on a voltmeter that would >measure the real and imaginary parts of an instantaneous voltage value.) > >a complex filter is one that has derived or contrived imaginary parts in >the input and output signals and, assuming it's LTI, really is 4 real >filters: real in to real out summed with imag in to real out, real in to >imag out and imag in to imag out (also summed). > >and the imag out is a label. not a physical thing. > >now, i think, if that filter behaves appropriately (analytically), the >real to real and imag to imag must be the same transfer function (with a >real impulse response), and the real to imag and imag to real are the >same transfer function (also with a real impulse response), but >negatives of each other. since the two impulse responses are real, if >the two real filters are both causal, the real and imag parts of the >frequency responses are Hilbert pairs, and if the filters are meant to >be minimum phase, the log magnitude and phase responses are Hilbert
pairs.
> >so there are really two real filters with arbitrary magnitude and >*perhaps* arbitrary phase response (it doesn't *have* to be minimum >phase and maybe not even causal). and they can be designed optimally >(in the sense of the minmax norm, not a Euclidian norm) by that trick >that Eric put on the dspguru site. or, as Vlad mentioned, you can >design it less optimally, but easily, by computing the impulse response >of the arbitrary filter and windowing it. i would suggest using a >Kaiser window with beta somewhere around 5. > > >-- > >r b-j rbj@audioimagination.com > >"Imagination is more important than knowledge." >
I assume a complex filter is needed at times e.g. if you want asymmetrical control of frequency shaping of signal where filter is applied at baseband but distortion occurs in higher RF frequency with asymmetrical channel effect on sidebands. Two real filters on I and Q separately will always have mirrored response. It will be great saving of multipliers if one can get away with complex filtering but can we in such situations? kadhiem
>> I assume a complex filter is needed at times e.g. if you want
asymmetrical control of frequency shaping you can do that. For example, the equalizer chapter in Proakis / Digital Communications shows how to find the complex-valued coefficients LMS-optimally. But: a "true" complex-valued filter and the discussed structure with four real-valued filters are one and the same thing. A complex-valued multiplication needs four real-valued multiplications. That's no coincidence.
On 12/18/11 3:18 PM, mnentwig wrote:
> > But: a "true" complex-valued filter and the discussed structure with four > real-valued filters are one and the same thing. > A complex-valued multiplication needs four real-valued multiplications.
i dunno, but a long time ago someone posted here how to do an arbitrary complex multiplication with *three* real mults and a whole shitload of addition operations. can't remember how it was done (someone like Clay will know, i'll bet).
> That's no coincidence.
i wonder what implication that three-mult complex multiplication might have on a complex-in, complex-out filter. can that be done with 3 real filters (and a shitload of adds)? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
On 12/18/11 3:27 PM, robert bristow-johnson wrote:
> On 12/18/11 3:18 PM, mnentwig wrote: >> >> But: a "true" complex-valued filter and the discussed structure with four >> real-valued filters are one and the same thing. >> A complex-valued multiplication needs four real-valued multiplications. > > i dunno, but a long time ago someone posted here how to do an arbitrary > complex multiplication with *three* real mults and a whole shitload of > addition operations. can't remember how it was done (someone like Clay > will know, i'll bet). >
check out http://mathworld.wolfram.com/ComplexMultiplication.html . Re{z*w} = Re{z}*Re{w} - Im{z}*Im{w} Im{z*w} = (Re{z}+Im{z})*(Re{w}+Im{w}) - Re{z}*Re{w} - Im{z}*Im{w}
>> That's no coincidence. > > i wonder what implication that three-mult complex multiplication might > have on a complex-in, complex-out filter. can that be done with 3 real > filters (and a shitload of adds)?
would that also work to accomplish arbitrary complex convolution with 3 different real impulse responses??? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
you're right:
http://mathworld.wolfram.com/ComplexMultiplication.html
>>Surprisingly, complex multiplication can be carried out using only three
real multiplications
>you're right: >http://mathworld.wolfram.com/ComplexMultiplication.html >>>Surprisingly, complex multiplication can be carried out using only
three
>real multiplications >
I have already snippet on that not far away: http://www.dsprelated.com/showcode/227.php kadhiem
Alright, never mind my comment counting the multipliers. 
What I was trying to say is: A complex-valued FIR convolves complex-valued
data with a complex-valued impulse response. I can treat it as a "black
box", and won't be able to tell from the outside, how exactly it is
implemented.

robert bristow-johnson <rbj@audioimagination.com> wrote:
> >> But: a "true" complex-valued filter and the discussed structure with four >> real-valued filters are one and the same thing. >> A complex-valued multiplication needs four real-valued multiplications.
> i dunno, but a long time ago someone posted here how to do an arbitrary > complex multiplication with *three* real mults and a whole shitload of > addition operations. can't remember how it was done (someone like Clay > will know, i'll bet).
It is, at least, in Knuth's "The Art of Computer Programming." I should know which volume, but I am not so sure right now. Best is to have them all.
> i wonder what implication that three-mult complex multiplication might > have on a complex-in, complex-out filter. can that be done with 3 real > filters (and a shitload of adds)?
The multiplication algorithms generalize such that you can do multiple precision (as many digits as you want) faster than N**2 though the use of the FFT. Yes, it is a strange place to put the FFT, but it is fast. Using this, pi has been computed to a really huge number of digits and verified. -- glen