discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] problem with audio extraction in NTSC


From: Chuck Swiger
Subject: Re: [Discuss-gnuradio] problem with audio extraction in NTSC
Date: Tue, 15 Feb 2005 21:37:56 -0500

At 07:59 PM 2/15/2005 -0500, you wrote:
Dear all,

I am working on extracting the audio FM signal from the NTSC
signal, and experimenting with the data file

ntsc-short-complex-baseband-8MS.dat

The idea seems simple: recenter the audio carrier to 0 frequency,
LPF and decimate and then do standard fm demod.
This is done in the attached file.

Unfortunately, although I hear something like

"winter storm will still going to stick around..."

the signal seems highly distorted as if the audio
carrier is very unstable.
I tried to fix this by tracking the video carrier,
but the problem gets worse.

One possible reason for this is that the local oscilator used to generate the IQ signal is not stable, which unfortunately cannot be fixed...

Can someone verify this problem and/or suggest any solution.

Hi Achilleas!  I just tried your script and it works fine here - slightly modified to use real
signal from a local tv station. An mp3 of a short segment is here:

http://webpages.charter.net/cswiger/TV_CH8.mp3

You can ... tell, it's television.  Sounds like you have another winner.

Here's what I used:
---------------------------------------------------------------

#!/bin/env python

from gnuradio import gr
from gnuradio import audio_oss as audio
from gnuradio import usrp
from gnuradio.wxgui import stdgui
from gnuradio.wxgui import fftsink, scopesink
# oldfftsink, oldfftsink_linear
import wx
import math

                                                                               
class test_app_flow_graph (stdgui.gui_flow_graph):
    def __init__(self, frame, panel, vbox, argv):
        stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv)
                                                                               
        # build our flow graph
        adc_rate = 64e6
        decim = 250
        input_rate = adc_rate / decim # 256 Khz

        fm_decim = 1
        fm_rate = input_rate / fm_decim          # 256 kHz
        audio_decimation = 8
        audio_rate = fm_rate / audio_decimation  # 32 kHz

        # filename = "ntsc-short-complex-baseband-8MS.dat"
                                                                               
        #src = "" (gr.sizeof_short, filename,True)
        #conv = gr.interleaved_short_to_complex ()
        src = "" (0, decim)
        src.set_rx_freq(0, 28.75e6) # 28Mhz (36Mhz) + .75 audio carrier
        # tuner is set to 185Mhz --> 36Mhz, local channel 8
        # aural carrier 185.75
        src.set_pga(0,0)

# Pilot extraction:
        #Ap= 100.0
        #p_width = 100e3
        #pilot_coefs = gr.firdes.band_pass (2/Ap, input_rate, 1.75e6-p_width/2, 1.75e6+p_width/2, p_width, gr.firdes.WIN_HAMMING)
        #pilot_filter = gr.fir_filter_ccf(1, pilot_coefs)
        #real = gr.complex_to_real()
        #imag = gr.complex_to_imag()
        #neg = gr.multiply_const_ff(-1.0)
        #conj = gr.float_to_complex()


# FM signal extraction
        #correction = gr.multiply_cc()
        fm_coeffs = gr.firdes.low_pass(1.0,input_rate,100e3,50e3,gr.firdes.WIN_HAMMING)
        fmc = gr.freq_xlating_fir_filter_ccf (fm_decim,fm_coeffs,-2.75e6, input_rate)
        peak_amp = 1.0
        fm_demod_gain = 1.0 / (2 * math.pi * 75e3 / peak_amp / fm_rate)
        volume = 0.4
        fm_demod = gr.quadrature_demod_cf (volume*fm_demod_gain)
# L+R processing: LPF + decimation
# compute FIR filter taps for audio filter
        width = 1e3
        audio_coefs = gr.firdes.low_pass (1.0, fm_rate, 15e3, width, gr.firdes.WIN_HAMMING)
        audio_filter_lpr = gr.fir_filter_fff (audio_decimation, audio_coefs)
        audio_sink = audio.sink (int (audio_rate))


        block1, fft_win1 = fftsink.make_fft_sink_c (self, panel, "Data", 1024, input_rate)
        block2, fft_win2 = fftsink.make_fft_sink_c (self, panel, "Data", 512, fm_rate)
        block3, fft_win3 = fftsink.make_fft_sink_f (self, panel, "Data", 256, audio_rate)
       
        #self.connect (src, conv)
        #self.connect (conv, pilot_filter)
        #self.connect (pilot_filter,real)
        #self.connect (pilot_filter,imag)
        #self.connect (imag,neg)
        #self.connect (real,(conj,0))
        #self.connect (neg,(conj,1))
        #self.connect (conv,(correction,0))
        #self.connect (conj,(correction,1))
        #self.connect (correction, fmc)
        self.connect (src, fmc)
        self.connect (fmc,fm_demod)
        self.connect (fm_demod,audio_filter_lpr)
        self.connect (audio_filter_lpr,audio_sink)

        self.connect (src, block1)
        self.connect (fmc, block2)
        self.connect (audio_filter_lpr, block3)
        vbox.Add (fft_win1, 1, wx.EXPAND)
        vbox.Add (fft_win2, 1, wx.EXPAND)
        vbox.Add (fft_win3, 1, wx.EXPAND)
                                                                               
                                                                               
def main ():
    app = stdgui.stdapp (test_app_flow_graph, "FFT Sink Test App")
    app.MainLoop ()
                                                                               
if __name__ == '__main__':
    main ()




reply via email to

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