Forums

Hilbert Transform in verilog or VHDL -- it has got to be out there somewhere

Started by Austin Lesea September 19, 2006
OK,

I have looked through a lot of places, but it seems that opencores.org,
etc. just do not have any Hilbert transform blocks.

I would think that this is not exactly rocket science, as the common
ways to do this are posted all over the place, and there are c programs
for DSP also posted.  Even the Xilinx DSP libraries don't seem to have a
free Hibert transformer (even one for $?).

Yes, I know how to go about doing one, but, if its already done, why
recode the wheel?  After all, there are probably at least three good
ways to do it on an FPGA, and ten bad ones.

Since I have "friends in low places" in ham radio, having a public
domain Hilbert would be useful for SSB, FM, AMSAT and other SDR
applications.

Some FIR, IIR, FFT, mixers, accumulators, DDFS, and so forth that are
pretty easily found plus a Digilent $99 S200 pcb could make a useful
foundation for software defined radio experiments (that and a
http://www.digilentinc.com/Products/Detail.cfm?Prod=AIO1&Nav1=Products&Nav2=Accessory
analog accessory pcb, or make your own A/D, D/A pcb).

If anyone can point me to some sources, it would be appreciated.

By the way, the TAPR class went well on Sunday in Tuscon, and now there
are 28 more crazy hams out there who are really dangerous...

The talk and slides will be posted when they do their web page for the
2006 25th anniversary meeting.

http://www.tapr.org

Austin
Austin Lesea wrote:
> OK, > > I have looked through a lot of places, but it seems that opencores.org, > etc. just do not have any Hilbert transform blocks. > > I would think that this is not exactly rocket science, as the common > ways to do this are posted all over the place, and there are c programs > for DSP also posted. Even the Xilinx DSP libraries don't seem to have a > free Hibert transformer (even one for $?). >
This paper has something on page 11: http://www.xilinx.com/ipcenter/catalog/logicore/docs/da_fir.pdf Cheers, Guenter
Guenter,

Boy, is that embarrassing: it is right where it is supposed to be, on
the free logic cores stuff.

But, in my defense, it was 'hidden' in with the FIR filter wizard, as
that is how they chose to implement it.

Now if only the search engine would have found it?

Maybe if I didn't look for "Hilbert", but instead looked for "FIR filters"?

Who would have guessed?

It is not only there where you pointed me, but also:
http://www.xilinx.com/bvdocs/ipcenter/data_sheet/fir_compiler_ds534.pdf

Veil dank Guenther,

Austin

Guenter wrote:
> Austin Lesea wrote: >> OK, >> >> I have looked through a lot of places, but it seems that opencores.org, >> etc. just do not have any Hilbert transform blocks. >> >> I would think that this is not exactly rocket science, as the common >> ways to do this are posted all over the place, and there are c programs >> for DSP also posted. Even the Xilinx DSP libraries don't seem to have a >> free Hibert transformer (even one for $?). >> > > This paper has something on page 11: > > http://www.xilinx.com/ipcenter/catalog/logicore/docs/da_fir.pdf > > Cheers, > > Guenter >
On Tue, 19 Sep 2006 10:21:17 -0700, Austin Lesea <austin@xilinx.com>
wrote:

>OK, > >I have looked through a lot of places, but it seems that opencores.org, >etc. just do not have any Hilbert transform blocks. > >I would think that this is not exactly rocket science, as the common >ways to do this are posted all over the place, and there are c programs >for DSP also posted. Even the Xilinx DSP libraries don't seem to have a >free Hibert transformer (even one for $?). > >Yes, I know how to go about doing one, but, if its already done, why >recode the wheel? After all, there are probably at least three good >ways to do it on an FPGA, and ten bad ones. > >Since I have "friends in low places" in ham radio, having a public >domain Hilbert would be useful for SSB, FM, AMSAT and other SDR >applications. > >Some FIR, IIR, FFT, mixers, accumulators, DDFS, and so forth that are >pretty easily found plus a Digilent $99 S200 pcb could make a useful >foundation for software defined radio experiments (that and a >http://www.digilentinc.com/Products/Detail.cfm?Prod=AIO1&Nav1=Products&Nav2=Accessory >analog accessory pcb, or make your own A/D, D/A pcb). > >If anyone can point me to some sources, it would be appreciated. > >By the way, the TAPR class went well on Sunday in Tuscon, and now there >are 28 more crazy hams out there who are really dangerous... > >The talk and slides will be posted when they do their web page for the >2006 25th anniversary meeting. > >http://www.tapr.org > >Austin
An opamp-based allpass 90 degree phase shifter is pretty simple; 8 opamp sections, 8 caps, 24 resistors gives nice quadrature signals over the voice range. And simulating a R-C section in an FPGA is trivial. So it seems to me that one could do a nice Hilbert with a fairly small amount of FPGA resources by just mimicing the opamp circuit in discrete time. That would be a lot smaller than a FIR implementation. Anybody done it this way? John
John Larkin wrote:

> > > An opamp-based allpass 90 degree phase shifter is pretty simple; 8 > opamp sections, 8 caps, 24 resistors gives nice quadrature signals > over the voice range. And simulating a R-C section in an FPGA is > trivial. So it seems to me that one could do a nice Hilbert with a > fairly small amount of FPGA resources by just mimicing the opamp > circuit in discrete time. That would be a lot smaller than a FIR > implementation. > > Anybody done it this way? > > John >
That's an IIR implementation. Generally speaking, IIR filters do not have the phase linearity required by many of the modern modulation schemes. They are fine for AM/FM, but when you start dealing with phase modulation, the non-linearity can make it extremely difficult to demodulate the signal.
On Mon, 25 Sep 2006 22:26:56 -0400, Ray Andraka <ray@andraka.com>
wrote:

>John Larkin wrote: > >> >> >> An opamp-based allpass 90 degree phase shifter is pretty simple; 8 >> opamp sections, 8 caps, 24 resistors gives nice quadrature signals >> over the voice range. And simulating a R-C section in an FPGA is >> trivial. So it seems to me that one could do a nice Hilbert with a >> fairly small amount of FPGA resources by just mimicing the opamp >> circuit in discrete time. That would be a lot smaller than a FIR >> implementation. >> >> Anybody done it this way? >> >> John >> > >That's an IIR implementation. Generally speaking, IIR filters do not >have the phase linearity required by many of the modern modulation >schemes. They are fine for AM/FM, but when you start dealing with phase >modulation, the non-linearity can make it extremely difficult to >demodulate the signal.
Maybe so, but my trusty old Williams filter book has, for a 10-element opamp-based allpass network, 26:1 frequency range, 0.007 degree error 57:1, 0.026 286:1, 0.21 1146:1, 0.66 which look pretty good. And a digital implementation should nail the pole/zero locations exactly. I do lowpass filters this way some times... just design an active analog filter, and simulate it digitally. John
John Larkin wrote:

> On Mon, 25 Sep 2006 22:26:56 -0400, Ray Andraka <ray@andraka.com> > wrote: > > >>John Larkin wrote: >> >> >>> >>>An opamp-based allpass 90 degree phase shifter is pretty simple; 8 >>>opamp sections, 8 caps, 24 resistors gives nice quadrature signals >>>over the voice range. And simulating a R-C section in an FPGA is >>>trivial. So it seems to me that one could do a nice Hilbert with a >>>fairly small amount of FPGA resources by just mimicing the opamp >>>circuit in discrete time. That would be a lot smaller than a FIR >>>implementation. >>> >>>Anybody done it this way? >>> >>>John >>> >> >>That's an IIR implementation. Generally speaking, IIR filters do not >>have the phase linearity required by many of the modern modulation >>schemes. They are fine for AM/FM, but when you start dealing with phase >>modulation, the non-linearity can make it extremely difficult to >>demodulate the signal. > > > Maybe so, but my trusty old Williams filter book has, for a 10-element > opamp-based allpass network, > > 26:1 frequency range, 0.007 degree error > > 57:1, 0.026 > > 286:1, 0.21 > > 1146:1, 0.66 > > > which look pretty good. And a digital implementation should nail the > pole/zero locations exactly. I do lowpass filters this way some > times... just design an active analog filter, and simulate it > digitally. > > John >
Those don't have linear phase. There are also the issues with finite precision in IIR filters which lead to limit cycles and misplaced poles/zeros. For digital comms applications, we generally use FIR filters because they eliminate those issues, albiet with some added computational complexity. For downconversion, the Hilbert transform can generally be done with a complex mixer and the low pass filters you'd need anyway.
On Tue, 26 Sep 2006 14:48:28 -0400, Ray Andraka <ray@andraka.com>
wrote:

>John Larkin wrote: > >> On Mon, 25 Sep 2006 22:26:56 -0400, Ray Andraka <ray@andraka.com> >> wrote: >> >> >>>John Larkin wrote: >>> >>> >>>> >>>>An opamp-based allpass 90 degree phase shifter is pretty simple; 8 >>>>opamp sections, 8 caps, 24 resistors gives nice quadrature signals >>>>over the voice range. And simulating a R-C section in an FPGA is >>>>trivial. So it seems to me that one could do a nice Hilbert with a >>>>fairly small amount of FPGA resources by just mimicing the opamp >>>>circuit in discrete time. That would be a lot smaller than a FIR >>>>implementation. >>>> >>>>Anybody done it this way? >>>> >>>>John >>>> >>> >>>That's an IIR implementation. Generally speaking, IIR filters do not >>>have the phase linearity required by many of the modern modulation >>>schemes. They are fine for AM/FM, but when you start dealing with phase >>>modulation, the non-linearity can make it extremely difficult to >>>demodulate the signal. >> >> >> Maybe so, but my trusty old Williams filter book has, for a 10-element >> opamp-based allpass network, >> >> 26:1 frequency range, 0.007 degree error >> >> 57:1, 0.026 >> >> 286:1, 0.21 >> >> 1146:1, 0.66 >> >> >> which look pretty good. And a digital implementation should nail the >> pole/zero locations exactly. I do lowpass filters this way some >> times... just design an active analog filter, and simulate it >> digitally. >> >> John >> > >Those don't have linear phase. There are also the issues with finite >precision in IIR filters which lead to limit cycles and misplaced >poles/zeros. For digital comms applications, we generally use FIR >filters because they eliminate those issues, albiet with some added >computational complexity. > >For downconversion, the Hilbert transform can generally be done with a >complex mixer and the low pass filters you'd need anyway.
Given a signal frequency range F1 to F2, and, say 0.5 degree or less error, do you have any wild/rough guess as to the minimum clock frequency and number of taps for an FIR Hilbert phase shifter? I assume that, as absolute minimum conditions, the delay line must be at least long enough to store 180 degrees of the waveform at F1, and that the clock has to be at least 2 times F2. What sort of real-life numbers do people use? I'm thinking here about digitizing AC voltage and current waveforms in stationary and aircraft power systems and extracting the real and imaginary power components, so I'd need a wideband (say, 40 to 800 Hz) 90 degree phase shifter good to a fraction of a degree. John