DSPRelated.com
Forums

Hilbert Transformer questions..

Started by Bob June 11, 2009
Hi,

I'm implementing a HT with sampling freq 2 Mhz to convert a real
signal to complex.. The required passband goes down all the way to 50
hz. I have a couple of questions which hopefully the experts can give
me some advice. First of all. to get the required frequency response
and to keep the passband ripple as low as possible, I need a large
number of taps and this uses a lot of resources on an FPGA. Is there a
quick and dirty method to implement a HT which will reduce the number
of resources required? Would running the input signal through a simple
delay line to get the 90 degree phase shift work? I've thought about
it and I don't think it would because I don't think it would filter
out the negative frequencies but I would like confirmation of this or
not.


Tapping output from the centre tap...Can this output be just the input
delayed or does it have to be the result of the input convolved with
half the filter coefficients.

Many Thanks
Bob Carter

On Thu, 11 Jun 2009 07:39:22 -0700, Bob wrote:

> Hi, > > I'm implementing a HT with sampling freq 2 Mhz to convert a real signal > to complex.. The required passband goes down all the way to 50 hz. I > have a couple of questions which hopefully the experts can give me some > advice. First of all. to get the required frequency response and to keep > the passband ripple as low as possible, I need a large number of taps > and this uses a lot of resources on an FPGA. Is there a quick and dirty > method to implement a HT which will reduce the number of resources > required? Would running the input signal through a simple delay line to > get the 90 degree phase shift work? I've thought about it and I don't > think it would because I don't think it would filter out the negative > frequencies but I would like confirmation of this or not. > > > Tapping output from the centre tap...Can this output be just the input > delayed or does it have to be the result of the input convolved with > half the filter coefficients.
It's hardly quick and dirty, but you should consider using some IIR stages instead of starting with the assumption of an all-FIR transformer. You did not say what bandwidth you need good phase shifting over, nor what sort of phase precision -- both of these have a profound effect on filter complexity. If, for instance, you only need 90 degrees of phase shift between 50 and 60Hz, you should be able to filter, decimate, transform, and if necessary resample with a lot less math than if you had to have near-perfect phase shifting from 50Hz to 500000. Just delaying one signal isn't going to give you a good phase shift over a very wide band. "Tapping output from the center tap?" I think you mean you're delaying the un-transformed signal? If so, you just want it delayed -- you certainly don't want to run it through half your HT filter. -- www.wescottdesign.com
On 11 June, 16:13, Tim Wescott <t...@seemywebsite.com> wrote:
> On Thu, 11 Jun 2009 07:39:22 -0700, Bob wrote: > > Hi, > > > I'm implementing a HT with sampling freq 2 Mhz to convert a real signal > > to complex.. The required passband goes down all the way to 50 hz. I > > have a couple of questions which hopefully the experts can give me some > > advice. First of all. to get the required frequency response and to keep > > the passband ripple as low as possible, I need a large number of taps > > and this uses a lot of resources on an FPGA. Is there a quick and dirty > > method to implement a HT which will reduce the number of resources > > required? Would running the input signal through a simple delay line to > > get the 90 degree phase shift work? I've thought about it and I don't > > think it would because I don't think it would filter out the negative > > frequencies but I would like confirmation of this or not. > > > Tapping output from the centre tap...Can this output be just the input > > delayed or does it have to be the result of the input convolved with > > half the filter coefficients. > > It's hardly quick and dirty, but you should consider using some IIR > stages instead of starting with the assumption of an all-FIR transformer. > > You did not say what bandwidth you need good phase shifting over, nor > what sort of phase precision -- both of these have a profound effect on > filter complexity. &#4294967295;If, for instance, you only need 90 degrees of phase > shift between 50 and 60Hz, you should be able to filter, decimate, > transform, and if necessary resample with a lot less math than if you had > to have near-perfect phase shifting from 50Hz to 500000. > > Just delaying one signal isn't going to give you a good phase shift over > a very wide band. > > "Tapping output from the center tap?" &#4294967295;I think you mean you're delaying > the un-transformed signal? &#4294967295;If so, you just want it delayed -- you > certainly don't want to run it through half your HT filter. > > --www.wescottdesign.com
Hi Tim, I'm afraid the bandwidth is wideband... 50 Hz all the way to 700000 Hz. Regarding delaying the un-transformed signal...yep that is what I'm doing. I'm appling a sine wave at the input and tapping it off the middle delay..so I see a nice clean sine wave. The output is a little distorted but the phase shift looks correct though. Bob
On Jun 11, 11:30&#4294967295;am, Bob <sten...@yahoo.com> wrote:
> > > > I'm implementing a HT with sampling freq 2 Mhz to convert a real signal > > > to complex.. The required passband goes down all the way to 50 hz.
...
> I'm afraid the bandwidth is wideband... 50 Hz all the way to 700000 Hz.
Whoa, Nellie!!! okay, so yer gonna have a reasonably flat passband from 700 kHz down to 50 Hz, *then* the filter magnitude must necessarily drop to 0 (or - inf dB) at DC and pop back up to the flat level at -50 Hz where it stays reasonably flat until -700 kHz. in audio, when i've done an HT, it was a bitch just to have it flat from about 80 Hz to nearly 22 kHz. it's gonna be a *very* long FIR.
> Regarding delaying the un-transformed signal...yep that is what > I'm doing. I'm appling a sine wave at the input and tapping it off the > middle delay..so I see a nice clean sine wave. The output is a little > distorted but the phase shift looks correct though.
so how long is your FIR? you *could* use halfband symmetry, but the 50 Hz spec on your bottom will translate to a Nyquist-50Hz spec on the top, which is probably better than you need. tough spec. r b-j
>On Jun 11, 11:30=A0am, Bob <sten...@yahoo.com> wrote: >> >> > > I'm implementing a HT with sampling freq 2 Mhz to convert a real
sign=
>al >> > > to complex.. The required passband goes down all the way to 50 hz. > >... > >> I'm afraid the bandwidth is wideband... 50 Hz all the way to 700000
Hz.
> >Whoa, Nellie!!! > >okay, so yer gonna have a reasonably flat passband from 700 kHz down >to 50 Hz, *then* the filter magnitude must necessarily drop to 0 (or - >inf dB) at DC and pop back up to the flat level at -50 Hz where it >stays reasonably flat until -700 kHz. > >in audio, when i've done an HT, it was a bitch just to have it flat >from about 80 Hz to nearly 22 kHz. it's gonna be a *very* long FIR. > >> Regarding delaying the un-transformed signal...yep that is what >> I'm doing. I'm appling a sine wave at the input and tapping it off the >> middle delay..so I see a nice clean sine wave. The output is a little >> distorted but the phase shift looks correct though. > >so how long is your FIR? you *could* use halfband symmetry, but the >50 Hz spec on your bottom will translate to a Nyquist-50Hz spec on the >top, which is probably better than you need. > >tough spec.
There are ways to recast a Hilbert transform as an IIR, which can reduce the number of calculations, but the word length of the calculations becomes wacky. I don't think the overall computational complexity is any better. This is a problem in power measurement (I mean real power - the 50Hz/60Hz stuff you pay utilities cash for). To produce a genuine reactive power measurement, with all the harmonics handled correctly, you really want a Hilbert transform that's 0.05% flat in response and 90+-0.02 degrees in phase over the range 45Hz to a few kHz. Its a pain. Most applications of Hilbert are in comms, and those are pretty straightforward. A modest length FIR based Hilbert transform will do 80% of the band pretty well. A modest amount of ripple, and a minor phase error can also be tolerated, without significant performance degradation. You just keep away from DC, sample a bit faster, and chop the ends of the band off. :-) Steve
On 12 June, 01:35, robert bristow-johnson <r...@audioimagination.com>
wrote:
> On Jun 11, 11:30&#4294967295;am, Bob <sten...@yahoo.com> wrote: > > > > > > > I'm implementing a HT with sampling freq 2 Mhz to convert a real signal > > > > to complex.. The required passband goes down all the way to 50 hz. > > ... > > > I'm afraid the bandwidth is wideband... 50 Hz all the way to 700000 Hz. > > Whoa, Nellie!!! > > okay, so yer gonna have a reasonably flat passband from 700 kHz down > to 50 Hz, *then* the filter magnitude must necessarily drop to 0 (or - > inf dB) at DC and pop back up to the flat level at -50 Hz where it > stays reasonably flat until -700 kHz. > > in audio, when i've done an HT, it was a bitch just to have it flat > from about 80 Hz to nearly 22 kHz. &#4294967295;it's gonna be a *very* long FIR. > > > Regarding delaying the un-transformed signal...yep that is what > > I'm doing. I'm appling a sine wave at the input and tapping it off the > > middle delay..so I see a nice clean sine wave. The output is a little > > distorted but the phase shift looks correct though. > > so how long is your FIR? &#4294967295;you *could* use halfband symmetry, but the > 50 Hz spec on your bottom will translate to a Nyquist-50Hz spec on the > top, which is probably better than you need. > > tough spec. > > r b-j
There is no way on earth I can meet that spec using a conventional HT. If I change the passband to 10KHz to 990 KHz and have it symmetrical, then I begin to see a decent result using approx 100 taps...which I could implement on an FPGA. However, I need to get the lower edge of the passband down closer to 50 Hz. Is there any other way of achieving the same effect as a HT for baseband signals? Thanks Bob
On Jun 11, 10:39&#4294967295;am, Bob <sten...@yahoo.com> wrote:
> Hi, > > I'm implementing a HT with sampling freq 2 Mhz to convert a real > signal to complex.. The required passband goes down all the way to 50 > hz. I have a couple of questions which hopefully the experts can give > me some advice. First of all. to get the required frequency response > and to keep the passband ripple as low as possible, I need a large > number of taps and this uses a lot of resources on an FPGA. Is there a > quick and dirty method to implement a HT which will reduce the number > of resources required? Would running the input signal through a simple > delay line to get the 90 degree phase shift work? I've thought about > it and I don't think it would because I don't think it would filter > out the negative frequencies but I would like confirmation of this or > not. > > Tapping output from the centre tap...Can this output be just the input > delayed or does it have to be the result of the input convolved with > half the filter coefficients. > > Many Thanks > Bob Carter
Hello Bob, You have one set of crazy specs! I assume you are trying to make an analytic signal, so how about subdividing your original signal into bands using quadrature mirror filters with appropriate decimation after each bandsplit, and then forming each of these band outputs into analytic signals. Then when appropriately combined (after applying proper delays and interpolation) you can make your wideband analytic signal. But this may take several FPGAs. I don't think there is an easy answer to your problem without somehow relaxing your spec. Does your signal processing really require such a bandwidth all at the same time? Or does your process use a smaller bandwidth but just needs to be frequency agile? If you can reduce the bandwidth, then your Hilbert problem gets simpler. For efficiently making analytic signals I have an article that describes a way to do it that will be availible on July 1st in the Signal Processing Magazine. FWIW, Clay
On Jun 12, 5:22 am, Bob <sten...@yahoo.com> wrote:
> On 12 June, 01:35, robert bristow-johnson <r...@audioimagination.com> > wrote: > > > On Jun 11, 11:30 am, Bob <sten...@yahoo.com> wrote: > > > > > > I'm implementing a HT with sampling freq 2 Mhz to convert a real signal > > > > > to complex.. The required passband goes down all the way to 50 hz. > > > ... > > > > I'm afraid the bandwidth is wideband... 50 Hz all the way to 700000 Hz. > > > Whoa, Nellie!!! >
...
> > > so how long is your FIR? you *could* use halfband symmetry, but the > > 50 Hz spec on your bottom will translate to a Nyquist-50Hz spec on the > > top, which is probably better than you need. > > > tough spec.
...
> > There is no way on earth I can meet that spec using a conventional HT.
no shit. not without a lot of taps.
> If I change the passband to 10KHz to 990 KHz and have it symmetrical, > then I begin to see a decent result using approx 100 taps...which I > could implement on an FPGA.
with halfband symmetry, those 100 taps are interlaced with zero-valued taps, so the "reach" of the impulse response is about 200 taps. when you give up on symmetry, you lose those zero taps and then you have to pay for computing them. also, while this makes little difference with a DSP, in an FPGA you can take advantage of symmetry in the IR and have half (again) as many multiplications even though you still have the same number of memory accesses and additions.
> However, I need to get the lower edge of > the passband down closer to 50 Hz. Is there any other way of achieving > the same effect as a HT for baseband signals?
without bumping your signal spectrum up by (10000-50) Hz (and how're you gonna do that without an HT?) and bumping it back down, i dunno. maybe the old fashioned way we ham operators used to do it in single- sideband (SSB) with "mixers" and crystal-lattice filters. you'll need some pretty sharp IIR filters. it might not work so well. i dunno. it's a damn tough spec. r b-j
On 12 June, 23:42, robert bristow-johnson <r...@audioimagination.com>
wrote:
> On Jun 12, 5:22 am, Bob <sten...@yahoo.com> wrote: > > > > > On 12 June, 01:35, robert bristow-johnson <r...@audioimagination.com> > > wrote: > > > > On Jun 11, 11:30 am, Bob <sten...@yahoo.com> wrote: > > > > > > > I'm implementing a HT with sampling freq 2 Mhz to convert a real signal > > > > > > to complex.. The required passband goes down all the way to 50 hz. > > > > ... > > > > > I'm afraid the bandwidth is wideband... 50 Hz all the way to 700000 Hz. > > > > Whoa, Nellie!!! > > ... > > > > so how long is your FIR? &#4294967295;you *could* use halfband symmetry, but the > > > 50 Hz spec on your bottom will translate to a Nyquist-50Hz spec on the > > > top, which is probably better than you need. > > > > tough spec. > ... > > > There is no way on earth I can meet that spec using a conventional HT. > > no shit. &#4294967295;not without a lot of taps. > > > If I change the passband to 10KHz to 990 KHz and have it symmetrical, > > then I begin to see a decent result using approx 100 taps...which I > > could implement on an FPGA. > > with halfband symmetry, those 100 taps are interlaced with zero-valued > taps, so the "reach" of the impulse response is about 200 taps. &#4294967295;when > you give up on symmetry, you lose those zero taps and then you have to > pay for computing them. &#4294967295;also, while this makes little difference with > a DSP, in an FPGA you can take advantage of symmetry in the IR and > have half (again) as many multiplications even though you still have > the same number of memory accesses and additions. >
A halfband HT...hmm....didn't know such a beast existed...just interlace the coeffs with zeros you say...what happens with the sampling freq...do I double it? I've implemented half bands before to good effect and also taken advantage of IR symmetry to reduce logic count on FPGAs so that's an interesting possibility.
> > However, I need to get the lower edge of > > the passband down closer to 50 Hz. Is there any other way of achieving > > the same effect as a HT &#4294967295;for baseband signals? > > without bumping your signal spectrum up by (10000-50) Hz (and how're > you gonna do that without an HT?) and bumping it back down, i dunno. > maybe the old fashioned way we ham operators used to do it in single- > sideband (SSB) with "mixers" and crystal-lattice filters. &#4294967295;you'll need > some pretty sharp IIR filters. &#4294967295;it might not work so well. &#4294967295;i dunno.
Was thinking of moving up the spectrum and then mixing back down again, but that brings its own problems as you've alluded to above. May have to go down this route yet.
> > it's a damn tough spec.
Let's just say...It a challenging one !!
> > r b-j
On 12 June, 16:00, Clay <c...@claysturner.com> wrote:
> On Jun 11, 10:39&#4294967295;am, Bob <sten...@yahoo.com> wrote: > > > > > Hi, > > > I'm implementing a HT with sampling freq 2 Mhz to convert a real > > signal to complex.. The required passband goes down all the way to 50 > > hz. I have a couple of questions which hopefully the experts can give > > me some advice. First of all. to get the required frequency response > > and to keep the passband ripple as low as possible, I need a large > > number of taps and this uses a lot of resources on an FPGA. Is there a > > quick and dirty method to implement a HT which will reduce the number > > of resources required? Would running the input signal through a simple > > delay line to get the 90 degree phase shift work? I've thought about > > it and I don't think it would because I don't think it would filter > > out the negative frequencies but I would like confirmation of this or > > not. > > > Tapping output from the centre tap...Can this output be just the input > > delayed or does it have to be the result of the input convolved with > > half the filter coefficients. > > > Many Thanks > > Bob Carter > > Hello Bob, > > You have one set of crazy specs! I assume you are trying to make an > analytic signal, so how about subdividing your original signal into > bands using quadrature mirror filters with appropriate decimation > after each bandsplit, and then forming each of these band outputs into > analytic signals. Then when appropriately combined (after applying > proper delays and interpolation) you can make your wideband analytic > signal. But this may take several FPGAs. I don't think there is an > easy answer to your problem without somehow relaxing your spec. Does > your signal processing really require such a bandwidth all at the same > time? Or does your process use a smaller bandwidth but just needs to > be frequency agile? If you can reduce the bandwidth, then your Hilbert > problem gets simpler. For efficiently making analytic signals I have > an article that describes a way to do it that will be availible on > July 1st in the Signal Processing Magazine. > > FWIW, > Clay
Hi Clay, Yeah...trying to make an analytic signal, which is turning out to be a pain in the analytic area. The quadrature mirror filters idea would take up a lot of logic on the chip, so I'd rather not go down that road. It also looks to be a quite complex task and I'll have the usual time pressures to contend with. I'm currently investigating if I can relax the bandwidth requirements and R.B.J. has thrown up some interesting possibilities as well. However, I'm certainly looking forward to having a read of your article....any chance of a preview ??? Regards Bob