Forums

Hilbert Transform code

Started by novatron1_2 July 4, 2008
I'm trying to separate a data signal of ~800Hz from a carrier wave which is
~2000Hz.  As both frequencies vary slightly over time I was hoping to use
envelope detection to strip off the carrier, my sample rate is 22560.

I've read about taking the Hilbert transform of the input signal and then
squaring this and adding it to the square of the input signal, before
finally taking a square root of the result to find the envelope.

i.e  envelope = sqr(( Hilbert_transfrom*
Hilbert_transfrom)+(org_sig*org_sig))

I'm writing the software in Visual Basic 6.0, but I'm really struggling to
convert the Hilbert transform from pure mathematics into code.

I would appreciate it if someone could possible help me in writing the
code.

Stuart



On 4 Jul, 13:30, "novatron1_2" <novatron...@hotmail.com> wrote:
> I'm trying to separate a data signal of ~800Hz from a carrier wave which is > ~2000Hz. &#2013266080;As both frequencies vary slightly over time I was hoping to use > envelope detection to strip off the carrier, my sample rate is 22560.
That's a novel way of doing things? What's wrong with an off-the-shelf lowpass filter? Rune
>On 4 Jul, 13:30, "novatron1_2" <novatron...@hotmail.com> wrote: >> I'm trying to separate a data signal of ~800Hz from a carrier wave
which =
>is >> ~2000Hz. =A0As both frequencies vary slightly over time I was hoping to
u=
>se >> envelope detection to strip off the carrier, my sample rate is 22560. > >That's a novel way of doing things? What's wrong with an >off-the-shelf lowpass filter? > >Rune >
Thanks for the reply, do you just mean use a LP filter with a cut off below the carrier?
>On 4 Jul, 13:30, "novatron1_2" <novatron...@hotmail.com> wrote: >> I'm trying to separate a data signal of ~800Hz from a carrier wave
which =
>is >> ~2000Hz. =A0As both frequencies vary slightly over time I was hoping to
u=
>se >> envelope detection to strip off the carrier, my sample rate is 22560. > >That's a novel way of doing things? What's wrong with an >off-the-shelf lowpass filter? > >Rune >
Thanks for the reply, do you just mean use a LP filter with a cut off below the carrier?
"novatron1_2" <novatron1_2@hotmail.com> writes:

> I'm trying to separate a data signal of ~800Hz from a carrier wave which is > ~2000Hz. As both frequencies vary slightly over time I was hoping to use > envelope detection to strip off the carrier, my sample rate is 22560. > > I've read about taking the Hilbert transform of the input signal and then > squaring this and adding it to the square of the input signal, before > finally taking a square root of the result to find the envelope. > > i.e envelope = sqr(( Hilbert_transfrom* > Hilbert_transfrom)+(org_sig*org_sig)) > > I'm writing the software in Visual Basic 6.0, but I'm really struggling to > convert the Hilbert transform from pure mathematics into code. > > I would appreciate it if someone could possible help me in writing the > code. > > Stuart
Stuart, What type of modulation is being used? -- % Randy Yates % "I met someone who looks alot like you, %% Fuquay-Varina, NC % she does the things you do, %%% 919-577-9882 % but she is an IBM." %%%% <yates@ieee.org> % 'Yours Truly, 2095', *Time*, ELO http://www.digitalsignallabs.com
On 4 Jul, 14:56, "novatron1_2" <novatron...@hotmail.com> wrote:
> >On 4 Jul, 13:30, "novatron1_2" <novatron...@hotmail.com> wrote: > >> I'm trying to separate a data signal of ~800Hz from a carrier wave > which = > >is > >> ~2000Hz. =A0As both frequencies vary slightly over time I was hoping to > u= > >se > >> envelope detection to strip off the carrier, my sample rate is 22560. > > >That's a novel way of doing things? What's wrong with an > >off-the-shelf lowpass filter? > > >Rune > > Thanks for the reply, do you just mean use a LP filter with a cut off > below the carrier?
Yes, but a bit more then that: - Passband corner above the highest fequency of the data signal - Stopband corner below the carrier The assumption is, of course, that the upper end of the data spectrum does not extend as far as the carrier. Rune
Rune Allnor wrote:
> On 4 Jul, 13:30, "novatron1_2" <novatron...@hotmail.com> wrote: >> I'm trying to separate a data signal of ~800Hz from a carrier wave which is >> ~2000Hz. As both frequencies vary slightly over time I was hoping to use >> envelope detection to strip off the carrier, my sample rate is 22560. > > That's a novel way of doing things? What's wrong with an > off-the-shelf lowpass filter?
Maybe he needs to demodulate an AM signal and doesn't appreciate the difference between demodulation and separation. Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
novatron1_2 wrote:
>> On 4 Jul, 13:30, "novatron1_2" <novatron...@hotmail.com> wrote: >>> I'm trying to separate a data signal of ~800Hz from a carrier wave > which = >> is >>> ~2000Hz. =A0As both frequencies vary slightly over time I was hoping to > u= >> se >>> envelope detection to strip off the carrier, my sample rate is 22560. >> That's a novel way of doing things? What's wrong with an >> off-the-shelf lowpass filter? >> >> Rune >> > > Thanks for the reply, do you just mean use a LP filter with a cut off > below the carrier?
If it really is a carrier, then a low-pass won't work. So which is it: a 2MHz carrier with with an 800Hz impressed (how: AM? FM? other?) on it, or separate 2MHz and 800Hz signals that coexist? If you have a modulated carrier, you need to know the type of modulation in order to demodulate it. The method you described works for AM. There is a simpler way -- peak detection -- if the sample rate is high enough. Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
On 4 Jul, 16:03, Jerry Avins <j...@ieee.org> wrote:
> Rune Allnor wrote: > > On 4 Jul, 13:30, "novatron1_2" <novatron...@hotmail.com> wrote: > >> I'm trying to separate a data signal of ~800Hz from a carrier wave which is > >> ~2000Hz. &#2013266080;As both frequencies vary slightly over time I was hoping to use > >> envelope detection to strip off the carrier, my sample rate is 22560. > > > That's a novel way of doing things? What's wrong with an > > off-the-shelf lowpass filter? > > Maybe he needs to demodulate an AM signal and doesn't appreciate the > difference between demodulation and separation.
Well, 'separation' is hardly a well-defined technical term. Maybe the OP meant demodulation; I certainly interpreted this as a filter problem. Rune
Rune Allnor wrote:
> On 4 Jul, 16:03, Jerry Avins <j...@ieee.org> wrote: >> Rune Allnor wrote: >>> On 4 Jul, 13:30, "novatron1_2" <novatron...@hotmail.com> wrote: >>>> I'm trying to separate a data signal of ~800Hz from a carrier wave which is >>>> ~2000Hz. As both frequencies vary slightly over time I was hoping to use >>>> envelope detection to strip off the carrier, my sample rate is 22560. >>> That's a novel way of doing things? What's wrong with an >>> off-the-shelf lowpass filter? >> Maybe he needs to demodulate an AM signal and doesn't appreciate the >> difference between demodulation and separation. > > Well, 'separation' is hardly a well-defined technical term. > Maybe the OP meant demodulation; I certainly interpreted > this as a filter problem.
He made he first part seem like one, but he mentioned "carrier" and "envelope", and described an AM demodulation technique. I at first mistook his carrier frequency to be 8000 KHz. At the actual frequencies and with that sample rate, peak detection won't work for AM, so he does need the quadrature signal. Of course, unless the modulation percentage is very high or the signal is already sampled, a diode and capacitor would do the task. Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;