DSPRelated.com
Forums

FIR Hilbert transformers

Started by w106pjs January 4, 2006
Hi all..

1. Is it possible to design a FIR hilbert transformer for the follwing
specifications.. 
Signal freq = 220khz
Samples freq = 12Mhz
The purpose here is to generate the envelope over the signal freq. of
interest (220khz)
The fear I have, as the signal frequency is close to DC with this unusally
high sample rate, the length of the designed FIR hilbert transformer may be
very high.

2. When exploring the use of MATLAB function firpm, how does one estimate
the no.of taps for hilbert transformer. ? and how does one select the
vector f (normalized frequencies) ? The exmple discussed seems unclear to
me. The example considers vecotr f = [0.1 0.9] .. wht frequencies that
corresponds to in the example. ?
Thank
Paul




w106pjs wrote:
> Hi all.. > > 1. Is it possible to design a FIR hilbert transformer for the follwing > specifications.. > Signal freq = 220khz > Samples freq = 12Mhz > The purpose here is to generate the envelope over the signal freq. of > interest (220khz) > The fear I have, as the signal frequency is close to DC with this unusally > high sample rate, the length of the designed FIR hilbert transformer may be > very high.
The relative frequency is 0.018... I remember Rick Lyons mentioning that somebody had asked him if they could publish a Hilbert transformer for "near DC" signals, in the DSP TRicks colum in IEEE Signal Processing magazine. I don't know if the article ever appeared, though. Apart from that, the term "decimation" springs to mind...
> 2. When exploring the use of MATLAB function firpm, how does one estimate > the no.of taps for hilbert transformer. ? and how does one select the > vector f (normalized frequencies) ? The exmple discussed seems unclear to > me. The example considers vecotr f = [0.1 0.9] .. wht frequencies that > corresponds to in the example. ?
Well, the Matlab documentation is unclear, at best, when it comes to those kinds of questions. Most design methods, as implemented in the matlab DSP toolbox, require the user to specify the filter order, or some other key parameters. One have to dig deep into the literature to find estimators for those kinds of things, but they are there. Try to check out a DSP text and see if you can find an order estimator for the Parks-McClellan design algorithm. I know the book by Proakis and Manolakis contains an estimator, and I think the 1999 book by Oppenheim and Schafer has one, too. I would think these estimators would work for Hilbert transformers as well as more regular filters. Rune
> >w106pjs wrote: >> Hi all.. >> >> 1. Is it possible to design a FIR hilbert transformer for the follwing >> specifications.. >> Signal freq = 220khz >> Samples freq = 12Mhz >> The purpose here is to generate the envelope over the signal freq. of >> interest (220khz) >> The fear I have, as the signal frequency is close to DC with this
unusally
>> high sample rate, the length of the designed FIR hilbert transformer
may be
>> very high. > >The relative frequency is 0.018... I remember Rick Lyons mentioning >that >somebody had asked him if they could publish a Hilbert transformer >for "near DC" signals, in the DSP TRicks colum in IEEE Signal >Processing >magazine. I don't know if the article ever appeared, though. > >Apart from that, the term "decimation" springs to mind... > >> 2. When exploring the use of MATLAB function firpm, how does one
estimate
>> the no.of taps for hilbert transformer. ? and how does one select the >> vector f (normalized frequencies) ? The exmple discussed seems unclear
to
>> me. The example considers vecotr f = [0.1 0.9] .. wht frequencies that >> corresponds to in the example. ? > >Well, the Matlab documentation is unclear, at best, when it comes >to those kinds of questions. Most design methods, as implemented in >the matlab DSP toolbox, require the user to specify the filter order, >or some other key parameters. One have to dig deep into the literature >to find estimators for those kinds of things, but they are there. > >Try to check out a DSP text and see if you can find an order estimator >for the Parks-McClellan design algorithm. I know the book by Proakis >and Manolakis contains an estimator, and I think the 1999 book by >Oppenheim and Schafer has one, too. > >I would think these estimators would work for Hilbert transformers >as well as more regular filters. > >Rune > >
Rune 1. I have read thread posted by Paul (Consultant) disussing the implementation using IIR approach. The concerns that prevents me from Decimation and other time domain approach are: a. Using firpm (Parks-McClellan design algorithm) as the method approximates the desired response, I fear the envelope may not closely follow actual signal of interest. .. which points to the fact that phase shift may not be exact 90 degress as desired. b. Length of the filter being very large .. Am I right on this one ? c. Decimation may not solve the concern mentioned in (a) above.. ? Please correct me if I am wrong.. Paul
w106pjs wrote:
>>w106pjs wrote: >> >>>Hi all.. >>> >>>1. Is it possible to design a FIR hilbert transformer for the follwing >>>specifications.. >>>Signal freq = 220khz >>>Samples freq = 12Mhz >>>The purpose here is to generate the envelope over the signal freq. of >>>interest (220khz) >>>The fear I have, as the signal frequency is close to DC with this > > unusally > >>>high sample rate, the length of the designed FIR hilbert transformer > > may be > >>>very high. >> >>The relative frequency is 0.018... I remember Rick Lyons mentioning >>that >>somebody had asked him if they could publish a Hilbert transformer >>for "near DC" signals, in the DSP TRicks colum in IEEE Signal >>Processing >>magazine. I don't know if the article ever appeared, though. >> >>Apart from that, the term "decimation" springs to mind... >> >> >>>2. When exploring the use of MATLAB function firpm, how does one > > estimate > >>>the no.of taps for hilbert transformer. ? and how does one select the >>>vector f (normalized frequencies) ? The exmple discussed seems unclear > > to > >>>me. The example considers vecotr f = [0.1 0.9] .. wht frequencies that >>>corresponds to in the example. ? >> >>Well, the Matlab documentation is unclear, at best, when it comes >>to those kinds of questions. Most design methods, as implemented in >>the matlab DSP toolbox, require the user to specify the filter order, >>or some other key parameters. One have to dig deep into the literature >>to find estimators for those kinds of things, but they are there. >> >>Try to check out a DSP text and see if you can find an order estimator >>for the Parks-McClellan design algorithm. I know the book by Proakis >>and Manolakis contains an estimator, and I think the 1999 book by >>Oppenheim and Schafer has one, too. >> >>I would think these estimators would work for Hilbert transformers >>as well as more regular filters. >> >>Rune >> >> > > > > Rune > > 1. I have read thread posted by Paul (Consultant) disussing the > implementation using IIR approach. > The concerns that prevents me from Decimation and other time domain > approach are: > a. Using firpm (Parks-McClellan design algorithm) as the method > approximates the desired response, I fear the envelope may not closely > follow actual signal of interest. .. which points to the fact that phase > shift may not be exact 90 degress as desired. > b. Length of the filter being very large .. Am I right on this one ? > c. Decimation may not solve the concern mentioned in (a) above.. ? > > Please correct me if I am wrong..
Stand corrected. Decimation reduces the effective sampling frequency without altering the envelope. Actually, with so high an oversampling rate that your signal represents, one sample in each cycle of your signal will come quite close to the peak, so a peak detector will reproduce the envelope quite well. Have you tried it to see if it's adequate? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
w106pjs wrote:
> > > >w106pjs wrote: > >> Hi all.. > >> > >> 1. Is it possible to design a FIR hilbert transformer for the follwing > >> specifications.. > >> Signal freq = 220khz > >> Samples freq = 12Mhz > >> The purpose here is to generate the envelope over the signal freq. of > >> interest (220khz) > >> The fear I have, as the signal frequency is close to DC with this > unusally > >> high sample rate, the length of the designed FIR hilbert transformer > may be > >> very high. > > > >The relative frequency is 0.018... I remember Rick Lyons mentioning > >that > >somebody had asked him if they could publish a Hilbert transformer > >for "near DC" signals, in the DSP TRicks colum in IEEE Signal > >Processing > >magazine. I don't know if the article ever appeared, though. > > > >Apart from that, the term "decimation" springs to mind... > > > >> 2. When exploring the use of MATLAB function firpm, how does one > estimate > >> the no.of taps for hilbert transformer. ? and how does one select the > >> vector f (normalized frequencies) ? The exmple discussed seems unclear > to > >> me. The example considers vecotr f = [0.1 0.9] .. wht frequencies that > >> corresponds to in the example. ? > > > >Well, the Matlab documentation is unclear, at best, when it comes > >to those kinds of questions. Most design methods, as implemented in > >the matlab DSP toolbox, require the user to specify the filter order, > >or some other key parameters. One have to dig deep into the literature > >to find estimators for those kinds of things, but they are there. > > > >Try to check out a DSP text and see if you can find an order estimator > >for the Parks-McClellan design algorithm. I know the book by Proakis > >and Manolakis contains an estimator, and I think the 1999 book by > >Oppenheim and Schafer has one, too. > > > >I would think these estimators would work for Hilbert transformers > >as well as more regular filters. > > > >Rune > > > > > > > Rune > > 1. I have read thread posted by Paul (Consultant) disussing the > implementation using IIR approach. > The concerns that prevents me from Decimation and other time domain > approach are: > a. Using firpm (Parks-McClellan design algorithm) as the method > approximates the desired response, I fear the envelope may not closely > follow actual signal of interest. .. which points to the fact that phase > shift may not be exact 90 degress as desired.
What is the application? In an off-line application you could try a quick'n dirty trick like (matlab notation) N = length(x); % x contains your data xi = 2*imag(ifft(x(1:floor(N/2)),N)); which I believe ought to be the HT of x... or maybe it isn't? Use at your own risk! In an on-line application you probably have to settle for an approximation.
> b. Length of the filter being very large .. Am I right on this one ?
It depends on the error tolerances. Generally speaking, the filter length increases with stricter demands to the approximation error, and when you push towards DC and the Nyquist frequency.
> c. Decimation may not solve the concern mentioned in (a) above.. ?
Decimation by a factor 20 or so should bring the relative frequency into the [0.1, 0.9] range FIRPM is designed to work for. So it basically comes down to a choise between the design method you have available and the accuracy of the end result. If the requirements to the result are so strict you can't decimate, you will need to find the elaborate implementation, maybe Rick can help with that. If you settle for FIRPM you may have to accept some larger errors in the processed data.
> Please correct me if I am wrong.. > Paul
Rune

w106pjs wrote:

> Hi all.. > > 1. Is it possible to design a FIR hilbert transformer for the follwing > specifications.. > Signal freq = 220khz > Samples freq = 12Mhz > The purpose here is to generate the envelope over the signal freq. of > interest (220khz)
What is the bandwidth of the signal? I would decimate it first to a reasonable ratio of the bandwidth to the sample rate.
> The fear I have, as the signal frequency is close to DC with this unusally > high sample rate, the length of the designed FIR hilbert transformer may be > very high.
The straightforward implementation will take about Fsa/(2*Flow) taps. The way to deal with this problem is using the multirate filterbank for doing Hilbert transforms. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
>w106pjs wrote: >>>w106pjs wrote: >>> >>>>Hi all.. >>>> >>>>1. Is it possible to design a FIR hilbert transformer for the
follwing
>>>>specifications.. >>>>Signal freq = 220khz >>>>Samples freq = 12Mhz >>>>The purpose here is to generate the envelope over the signal freq. of >>>>interest (220khz) >>>>The fear I have, as the signal frequency is close to DC with this >> >> unusally >> >>>>high sample rate, the length of the designed FIR hilbert transformer >> >> may be >> >>>>very high. >>> >>>The relative frequency is 0.018... I remember Rick Lyons mentioning >>>that >>>somebody had asked him if they could publish a Hilbert transformer >>>for "near DC" signals, in the DSP TRicks colum in IEEE Signal >>>Processing >>>magazine. I don't know if the article ever appeared, though. >>> >>>Apart from that, the term "decimation" springs to mind... >>> >>> >>>>2. When exploring the use of MATLAB function firpm, how does one >> >> estimate >> >>>>the no.of taps for hilbert transformer. ? and how does one select the >>>>vector f (normalized frequencies) ? The exmple discussed seems
unclear
>> >> to >> >>>>me. The example considers vecotr f = [0.1 0.9] .. wht frequencies
that
>>>>corresponds to in the example. ? >>> >>>Well, the Matlab documentation is unclear, at best, when it comes >>>to those kinds of questions. Most design methods, as implemented in >>>the matlab DSP toolbox, require the user to specify the filter order, >>>or some other key parameters. One have to dig deep into the literature >>>to find estimators for those kinds of things, but they are there. >>> >>>Try to check out a DSP text and see if you can find an order estimator >>>for the Parks-McClellan design algorithm. I know the book by Proakis >>>and Manolakis contains an estimator, and I think the 1999 book by >>>Oppenheim and Schafer has one, too. >>> >>>I would think these estimators would work for Hilbert transformers >>>as well as more regular filters. >>> >>>Rune >>> >>> >> >> >> >> Rune >> >> 1. I have read thread posted by Paul (Consultant) disussing the >> implementation using IIR approach. >> The concerns that prevents me from Decimation and other time domain >> approach are: >> a. Using firpm (Parks-McClellan design algorithm) as the method >> approximates the desired response, I fear the envelope may not closely >> follow actual signal of interest. .. which points to the fact that
phase
>> shift may not be exact 90 degress as desired. >> b. Length of the filter being very large .. Am I right on this one ? >> c. Decimation may not solve the concern mentioned in (a) above.. ? >> >> Please correct me if I am wrong.. > >Stand corrected. Decimation reduces the effective sampling frequency >without altering the envelope. Actually, with so high an oversampling >rate that your signal represents, one sample in each cycle of your >signal will come quite close to the peak, so a peak detector will >reproduce the envelope quite well. Have you tried it to see if it's >adequate? > >Jerry >-- >Engineering is the art of making what you want from things you can get. >����������������������������������������������������������������������� >
Jerry, Rune will certainly stand corrected, your expert opinion would definitely help me gain little confidence in my endeavours. It sounds like your experience is probably half my age...or may be more. Please guide me further.. thanks Paul
Hi!

>> Please correct me if I am wrong.. > > Stand corrected. Decimation reduces the effective sampling frequency > without altering the envelope. Actually, with so high an oversampling rate > that your signal represents, one sample in each cycle of your signal will > come quite close to the peak, so a peak detector will reproduce the > envelope quite well. Have you tried it to see if it's adequate?
I have compared the frequency responses of wideband modulated signal and only noticed difference in the last 75% of the bandwidth using the following two approaches: 1.) abs(fft(abs(x))); 2.) abs(fft(abs(x+hilbert(x)*i)))); This is before the lowpass (and of course before the decimation). I failed to find any reason why one would want to use a Hilbert transformation, because the frequency of modulation is in almost every case lower than 0.25 * Bandwidth. Then somebody brought up the idea, that Hilbert transformation would give an improvement, if the modulated signal would not be wideband, but rather a single dominant tone with maybe two or more sidebands. Hilbert transformation for envelope detection only works perfectly for a perfect single tone signal. But perfect single tone signal is not modulated :) So what is the truth about Hilbert? Thanks! Atmapuri
Atmapuri wrote:
> Hi! > > >>>Please correct me if I am wrong.. >> >>Stand corrected. Decimation reduces the effective sampling frequency >>without altering the envelope. Actually, with so high an oversampling rate >>that your signal represents, one sample in each cycle of your signal will >>come quite close to the peak, so a peak detector will reproduce the >>envelope quite well. Have you tried it to see if it's adequate? > > > I have compared the frequency responses of wideband modulated > signal and only noticed difference in the last 75% of the bandwidth > using the following two approaches: > > 1.) abs(fft(abs(x))); > 2.) abs(fft(abs(x+hilbert(x)*i)))); > > This is before the lowpass (and of course before the decimation). > I failed to find any reason why one would want to use a Hilbert > transformation, because the frequency of modulation is in almost > every case lower than 0.25 * Bandwidth. > > Then somebody brought up the idea, that Hilbert transformation > would give an improvement, if the modulated signal would not be > wideband, but rather a single dominant tone with maybe two or > more sidebands. > > Hilbert transformation for envelope detection only works perfectly > for a perfect single tone signal. But perfect single tone signal is > not modulated :) > > So what is the truth about Hilbert?
One cannot read amplitude from a single sample of A*sin(theta), but simultaneous values of A*sin(theta) and A*cos(theta) allow the computation in any of several ways. The most straightforward way is sqrt{[A*sin(theta)]^2 + [A*cos(theta)]^2}. An envelope is the slowly varying magnitude of the carrier, close enough to a single frequency. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Hi!

> One cannot read amplitude from a single sample of A*sin(theta), but
Of course not, but that is why you apply "abs". It is true that this will give you a series of strange spikes and not a a nice line as it would with analytical signal, but the differences are not in the frequency range which is not used anyway.
> simultaneous values of A*sin(theta) and A*cos(theta) allow the computation > in any of several ways. The most straightforward way is > sqrt{[A*sin(theta)]^2 + [A*cos(theta)]^2}.
This is the abs(complex number). It gives a range of harmonics (distortion) in the resulting time series as it does when applied to real time series also. My point was that looking at frequency response there is no difference between applying absolute value on the real time series or on the analytical signal, if the expected bandwidth of the envelope is less than about 1/4 of the bandwidth of the original signal. Paul probably does not need Hilbert. Only abs and a good lowpass filter (decimation). The funny thing is, that there is a function that maps envelope obtained with applying abs to real signal and applying abs to analytical signal. Its not linear but still a fairly simple power function.
> An envelope is the slowly varying magnitude of the carrier, close enough > to a single frequency.
Humm... In my case the envelope has relatively narrow band in compare to really wide bandwidth of the modulated signal. Thanks! Atmapuri