Reply by Al Clark March 30, 20062006-03-30
Jerry Avins <jya@ieee.org> wrote in
news:j4CdnQ2WfeXFZLbZnZ2dnUVZ_tWdnZ2d@rcn.net: 

> Al Clark wrote: > > ... > >> If I need a Hilbert transform that extends over a very large >> frequency range, I use remez exchange to minimize the ripple. The >> catch is that you don't get to throw out every other coefficient >> since in general, all the coefficients are non zero. > > I concluded, from the few simulations I ran, that a filter with > alternate zeros, while longer than an optimized filter of the same > ripple, has fewer taps that need computing.* It isn't that multiplying > by zero is easy; by marching through the data buffer with a stride of > two, the zeros might as well not exist. Windows that best remove > ripple reduce bandwidth the most, requiring more taps to get it back.
I thought this might be the case. Maybe the window version is 1.5 x longer, but you skip the trivial zeros which still makes it a better choice.
> >> I think that sometimes people forget that it takes a very long filter >> to create a 90 degree phase shift at low frequency. It's easy to >> visualize why if you think about how to create a 90 degree phase >> shift at DC. > > I've had a computer tied up since New Years calculating a filter to do > that. :-)
Must not have been a Windows machine. They don't operate long enough without a crash. It seems to me that a very long Digital FIR will also be constrained to a maximum size as the theoretical coefficients of the impulse response become too small to quantize for the given word size. I calculated a hilbert FIR using a Kaiser Window with 2047 taps. The smallest tap was 12.76 x 10^-6 (0x00006B25). The sample rate was 96000 and the hilbert transform was good to about 80 Hz. After that the low frequencies start to roll off fast. If this was designed for wide band audio, I would probably need about 8000 taps (with 4000 non zero coefficents).
> >> The other thing that I find is that in many cases I actually don't >> need the envelope, I just need the mean squared (I^2 + Q^2) vs >> SQRT(I^2 + Q^ 2). In a detector, I might just compare the result to >> some arbitrary level. This means I can skip the SQRT. > > I've seen programs that calculate the square root and then convert to > decibels.
If they didn't also need the linear result, then I think they should go back and review basic 9th grade algebra.
> > Jerry > ___________________________ >
* "My mind is made up. Don't confuse me with facts" Jerry, Are you commenting about our "fine" President? -- Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com
Reply by Randy Yates March 30, 20062006-03-30
"Anonymous" <someone@microsoft.com> writes:
> [...] > If I want to take the envelope of a signal I just mix it to baseband and ...
That's actually one step further than the HT - the HT provides the so-called analytic signal. Mixing the analytic signal to baseband provides the equivalent of your operation. -- % Randy Yates % "Bird, on the wing, %% Fuquay-Varina, NC % goes floating by %%% 919-577-9882 % but there's a teardrop in his eye..." %%%% <yates@ieee.org> % 'One Summer Dream', *Face The Music*, ELO http://home.earthlink.net/~yatescr
Reply by Jerry Avins March 30, 20062006-03-30
Anonymous wrote:

   ...

> I guess it's been a while. The only time I ever used HT was in a doppler > ultrasound where the positve frequencies mapped to forward flow and the > negative frequencies mapped to reverse flow. > > If I want to take the envelope of a signal I just mix it to baseband and run > it through a cordic. As I recall the HT filters ended up pretty long to get > good seperation from the pos/neg frequencies. Is there a computation > advantage to HT versus my dumb way?
A complex mix to baseband yields I and Q. An HT provides Q when only baseband I is available. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Anonymous March 30, 20062006-03-30
"Jerry Avins" <jya@ieee.org> wrote in message
news:j4CdnQyWfeXAZ7bZnZ2dnUVZ_tWdnZ2d@rcn.net...
> Anonymous wrote: > > ... > > > The hilbert transform seperates the positive frequencies from the
negative
> > frequencies in a complex signal. I don't see how it would apply to
envelope
> > detection? > > You are misinformed. By generating Q from I, an HT can be part of the > procedure for separating positive from negative frequencies. (The > phasing method of single-sideband suppressed-carrier modulation.) Do you > need references? > > Jerry > -- > Engineering is the art of making what you want from things you can get. > &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
I guess it's been a while. The only time I ever used HT was in a doppler ultrasound where the positve frequencies mapped to forward flow and the negative frequencies mapped to reverse flow. If I want to take the envelope of a signal I just mix it to baseband and run it through a cordic. As I recall the HT filters ended up pretty long to get good seperation from the pos/neg frequencies. Is there a computation advantage to HT versus my dumb way? -Clark
Reply by Stan Pawlukiewicz March 30, 20062006-03-30
Anonymous wrote:
> "HelpmaBoab" <FU2@yahoo.co.zpc> wrote in message > news:KNIWf.9563$JZ1.355822@news.xtra.co.nz... >> I have read that to get the envelope of a signal we can take its Hilbert > TF >> and use this as the imaginary part of a complex array (the real part being >> the original signal). Then the envelope is sqrt(re^2 + im^2). I imagine > this >> is just creating an I and Q. How accurate is this method and can we use an >> FFT (s) to do the Hilbert transform? >> >> >> Tam >> >> > > What do you mean by envelope detection? AM demodulation? > > If you have baseband I,Q data you can just run it through a cordic function > (or do sqrt(I^2+Q^2)). > > The hilbert transform seperates the positive frequencies from the negative > frequencies in a complex signal. I don't see how it would apply to envelope > detection? > > -Clark > >
When you inverse transform the positive frequencies the original real signal s(t), becomes a complex signal. Most books call this the analytic signal. The magnitude of the complex signal is usually taken to be the envelope.
Reply by Jerry Avins March 30, 20062006-03-30
Anonymous wrote:

   ...

> The hilbert transform seperates the positive frequencies from the negative > frequencies in a complex signal. I don't see how it would apply to envelope > detection?
You are misinformed. By generating Q from I, an HT can be part of the procedure for separating positive from negative frequencies. (The phasing method of single-sideband suppressed-carrier modulation.) Do you need references? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Jerry Avins March 30, 20062006-03-30
Al Clark wrote:

   ...

> If I need a Hilbert transform that extends over a very large frequency > range, I use remez exchange to minimize the ripple. The catch is that you > don't get to throw out every other coefficient since in general, all the > coefficients are non zero.
I concluded, from the few simulations I ran, that a filter with alternate zeros, while longer than an optimized filter of the same ripple, has fewer taps that need computing.* It isn't that multiplying by zero is easy; by marching through the data buffer with a stride of two, the zeros might as well not exist. Windows that best remove ripple reduce bandwidth the most, requiring more taps to get it back.
> I think that sometimes people forget that it takes a very long filter to > create a 90 degree phase shift at low frequency. It's easy to visualize > why if you think about how to create a 90 degree phase shift at DC.
I've had a computer tied up since New Years calculating a filter to do that. :-)
> The other thing that I find is that in many cases I actually don't need > the envelope, I just need the mean squared (I^2 + Q^2) vs SQRT(I^2 + Q^ > 2). In a detector, I might just compare the result to some arbitrary > level. This means I can skip the SQRT.
I've seen programs that calculate the square root and then convert to decibels. Jerry ___________________________ * "My mind is made up. Don't confuse me with facts" -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Anonymous March 30, 20062006-03-30
"HelpmaBoab" <FU2@yahoo.co.zpc> wrote in message
news:KNIWf.9563$JZ1.355822@news.xtra.co.nz...
> I have read that to get the envelope of a signal we can take its Hilbert
TF
> and use this as the imaginary part of a complex array (the real part being > the original signal). Then the envelope is sqrt(re^2 + im^2). I imagine
this
> is just creating an I and Q. How accurate is this method and can we use an > FFT (s) to do the Hilbert transform? > > > Tam > >
What do you mean by envelope detection? AM demodulation? If you have baseband I,Q data you can just run it through a cordic function (or do sqrt(I^2+Q^2)). The hilbert transform seperates the positive frequencies from the negative frequencies in a complex signal. I don't see how it would apply to envelope detection? -Clark
Reply by Al Clark March 30, 20062006-03-30
Jerry Avins <jya@ieee.org> wrote in news:grmdncbz78-W6LbZRVn-qQ@rcn.net:

> HelpmaBoab wrote: >> I have read that to get the envelope of a signal we can take its >> Hilbert TF and use this as the imaginary part of a complex array (the >> real part being the original signal). Then the envelope is sqrt(re^2 >> + im^2). I imagine this is just creating an I and Q. How accurate is >> this method > > As accurate as the arithmetic, provided you don't need too much > bandwidth, and what you do need is centered near Fs/4. > >> and can we use an FFT (s) to do the Hilbert transform? > > You use an FIR to do the transform. FIRs can be implemented with FFTs. > > http://www.nauticom.net/www/jdtaft/hilbert.htm is an aplet that will > design FIRs up to 35 taps. You may need more than that. The shortest > HT has coefficients -1/2 0 +1/2. Like all HTs, it has 90-degree phase > at all frequencies and is a decent differentiator up to Fs/10 or so. > > Odd numbers of taps have the advantage that the properly delayed > in-phase signal is available at the middle tap. Such filters make > sense only when N = 4K-1, k integer. the design will usually need to > be windowed. In order not to waste the end coefficients, calculate the > window for 4k+1 if it tapers to zero at the ends. (I like Nuttall for > this.) I design them by designating the center tap a[0], the first tap > a[-(N-1)/2], and the last tap a[(N-1)/2] set the even-numbered taps to > zero and the odd-numbered taps a[n]=1/n including the sign of n. Scale > the filter by dividing each coefficient by this sum: change the sign > of alternate non-zero coefficients and add them. Do the scaling after > windowing to make the gain exactly 0 dB at Fs/4 or before windowing to > make the peak gain near 0 dB. > > Accuracy suffers because there is ripple in the Q data but not I. A > long enough FIR and a good window overcome that.
I take no issue with any of the above comments. I just used this structure in a custom modem. The signals were near fs/4 so the hilbert used only 11 taps and 5 were 0 and therefore safely ignored. I would suggest Rick Lyons book (Understanding Digital Signal processing , 2nd Ed) for a good description of the method above. Another method uses I
> and Q complementary band-pass filter in which the ripples match, > making long convolutions and low-ripple windows less important. >
This method doesn't necessarily work any better in my view since the ripple will still cause I^2 + Q^2 to vary from ideal. In most cases the FIR method outlined first is the easiest to implement. I use Kaiser windows but I think I will look into the Nuttall window that you mention. Other Comments: If I need a Hilbert transform that extends over a very large frequency range, I use remez exchange to minimize the ripple. The catch is that you don't get to throw out every other coefficient since in general, all the coefficients are non zero. I think that sometimes people forget that it takes a very long filter to create a 90 degree phase shift at low frequency. It's easy to visualize why if you think about how to create a 90 degree phase shift at DC. The other thing that I find is that in many cases I actually don't need the envelope, I just need the mean squared (I^2 + Q^2) vs SQRT(I^2 + Q^ 2). In a detector, I might just compare the result to some arbitrary level. This means I can skip the SQRT. -- Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com
Reply by Jerry Avins March 30, 20062006-03-30
HelpmaBoab wrote:
> I have read that to get the envelope of a signal we can take its Hilbert TF > and use this as the imaginary part of a complex array (the real part being > the original signal). Then the envelope is sqrt(re^2 + im^2). I imagine this > is just creating an I and Q. How accurate is this method
As accurate as the arithmetic, provided you don't need too much bandwidth, and what you do need is centered near Fs/4.
> and can we use an FFT (s) to do the Hilbert transform?
You use an FIR to do the transform. FIRs can be implemented with FFTs. http://www.nauticom.net/www/jdtaft/hilbert.htm is an aplet that will design FIRs up to 35 taps. You may need more than that. The shortest HT has coefficients -1/2 0 +1/2. Like all HTs, it has 90-degree phase at all frequencies and is a decent differentiator up to Fs/10 or so. Odd numbers of taps have the advantage that the properly delayed in-phase signal is available at the middle tap. Such filters make sense only when N = 4K-1, k integer. the design will usually need to be windowed. In order not to waste the end coefficients, calculate the window for 4k+1 if it tapers to zero at the ends. (I like Nuttall for this.) I design them by designating the center tap a[0], the first tap a[-(N-1)/2], and the last tap a[(N-1)/2] set the even-numbered taps to zero and the odd-numbered taps a[n]=1/n including the sign of n. Scale the filter by dividing each coefficient by this sum: change the sign of alternate non-zero coefficients and add them. Do the scaling after windowing to make the gain exactly 0 dB at Fs/4 or before windowing to make the peak gain near 0 dB. Accuracy suffers because there is ripple in the Q data but not I. A long enough FIR and a good window overcome that. Another method uses I and Q complementary band-pass filter in which the ripples match, making long convolutions and low-ripple windows less important. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;