discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] gr.firdes_hilbert () usage


From: Dan Gisselquist
Subject: Re: [Discuss-gnuradio] gr.firdes_hilbert () usage
Date: Wed, 24 Nov 2004 15:07:12 -0700

Chuck,

I think you are comparing apples to oranges. Using the block diagram you've presented below, a more appropriate way to get complex sampling would be ...

             LO Cos
               |
           |--(X)---[lowpass fltr]---[* 1]--|
           |                                |
signl in ---|                               (+) --- signal out
           |                                |
           |--(X)---[lowpass fltr]---[* j]--|
               |
             LO Sin

In this case, you don't need the hilbert transform at all. You will get both positive and negative frequencies, and both will be valid.


Where the hilbert transform becomes a player is if you already have real samples out of a downconverter. In that case, your signal flow diagram will look something much more like:


          LO Cos                |--[hilbert 37]---[* j]--|
            |                   |                        |
signal in --(X)--[lowpass fltr]--|                       (+)-- out
                                |                        |
                                |--[delay   18]---[* 1]--|

The output resulting from this operation has the same number of complex samples as the output from the first operation, but only half as much information. Further, your negative frequencies, as a result of the hilbert transform, will all be forced to zero. That's what this operation accomplishes.

Hope this helps,

Dan

On 11/24/2004 01:55:10 PM, cswiger wrote:
On Wed, 24 Nov 2004, Matt Ettus wrote:

>
>
> Feed a real signal to the hilbert filter to form the Q part of a
complex signal.
> Feed a delayed version of the original signal to the I part. The
delay
> should be equal to  .5*(number of taps of the hilbert filter - 1)
>

Thanks Matt - Apologies if this is off topic theory but I do want to
implement a phasing ssb detector in gnuradio. I can see
gr.firdes_hilbert
generated taps for gr.fir_filter_fff does create a 90deg phase shift
for all frequencies. However what I can't see is the theory part about
shifting positive frequencies by +90 and negative frequencies by -90.

Trying this block diagram:

                   LO Cos
                     |
              |-----(X)------[Hilbert 37]---|
              |                             |
signal in ----|                            (+)------ signal out
              |                             |
              |-----(X)------[delay 18]-----|
                     |
                   LO Sin

If my LO is 455Khz and my signal in is 455.5Khz I get a nice 500Hz
output.
However if the signal is 454.5Khz there's also 500Hz out, so I'm
getting
both sidebands. Expecting USB only. Nice clean detection tho!


Anyway I'll study it closer and see what's going on / missing.


def build_graph ():
        local_osc = 455e3
        signal = 454.5e3     # 500hz lower sideband
        sample_rate = 8e6
        fg = gr.flow_graph ()

        src = gr.sig_source_f (sample_rate,gr.GR_SIN_WAVE,signal,1.0,0)

        lo_90 = gr.sig_source_f \
           (sample_rate,gr.GR_COS_WAVE,local_osc,1.0,0)
        lo_0 = gr.sig_source_f \
           (sample_rate,gr.GR_SIN_WAVE,local_osc,1.0,0)

        hilbert_coeffs = \
           gr.firdes_hilbert ( 37, gr.firdes.WIN_HAMMING)
        hilbert = gr.fir_filter_fff (1, hilbert_coeffs)

        del_taps = [0, 0, 0, 0, 0, 0, 0, 0, 0, \
                    0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
        delay = gr.fir_filter_fff (1, del_taps)

        mixq = gr.multiply_ff ()
        mixr = gr.multiply_ff ()
        sum = gr.add_ff ()

        dst = gr.file_sink (gr.sizeof_float, "ssb_out.dat")

        fg.connect (src, (mixr, 0))
        fg.connect (lo_0, (mixr, 1))
        fg.connect (mixr, delay)

        fg.connect (src, (mixq, 0))
        fg.connect (lo_90, (mixq, 1))
        fg.connect (mixq, hilbert)

        fg.connect (hilbert, (sum, 0))
        fg.connect (delay, (sum, 1))

        fg.connect (sum, dst)

        return fg

--Chuck




_______________________________________________
Discuss-gnuradio mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio





reply via email to

[Prev in Thread] Current Thread [Next in Thread]