discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] working AM radio - critique


From: cswiger
Subject: [Discuss-gnuradio] working AM radio - critique
Date: Sat, 21 Aug 2004 07:50:39 -0400 (EDT)

Hi - With a big thanks to David Carr for the gr.complex_mag ()
module I have an AM radio working. There was one last issue I
had to get around with something probably not optimal - the
audio was offset and very large. The fm demodulator distributed
with gnuradio produces a working signal with amplitude about .2
or so, centered about zero.  I simply put gr.complex_mag()
in place of gr.quadrature_demod_cf() and got audio with
magnitude about 300 centered about 350. My solution was to
simply shift and scale and now get good audio, just like fm.

Q: Is there a better way ?   Is there a signal level standard
we need to comply with?

hack follows:

def build_pipeline (fg, quad_rate, audio_decimation):

    audio_rate = quad_rate / audio_decimation

    # input: complex; output: float
    am_demod = gr.complex_mag ()

    # compute FIR filter taps for audio filter
    width_of_transition_band = audio_rate / 32
    audio_coeffs = \
      gr.firdes.low_pass (
        1.0,            # gain
        quad_rate,      # sampling rate
        audio_rate/2 - width_of_transition_band,
        width_of_transition_band,
        gr.firdes.WIN_HAMMING)

    # input: float; output: float
    audio_filter = \
      gr.fir_filter_fff (audio_decimation,
                         audio_coeffs)

    normal = gr.add_const_ff (-350)
    scale = gr.multiply_const_ff (.003)

    fg.connect (am_demod, audio_filter)
    fg.connect (audio_filter, normal)
    fg.connect (normal, scale)
    return ((am_demod, 0), (scale, 0))



Anyway, that was fun ;) Uses about 18% user and 8% system cpu on
an AMD 1.3Ghz.

--Chuck





reply via email to

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