diff options
author | jcorgan | 2007-09-04 13:21:24 +0000 |
---|---|---|
committer | jcorgan | 2007-09-04 13:21:24 +0000 |
commit | 42c1bfdc72b29f18c5a750a07959d4cc760411b4 (patch) | |
tree | b23f3eda52a9de83ed508b60909fa06d163447fc /gnuradio-examples/python/usrp/wfm_rcv_file.py | |
parent | 60d88c4aef7c5c1851028046eb67fdfe162c82c4 (diff) | |
download | gnuradio-42c1bfdc72b29f18c5a750a07959d4cc760411b4.tar.gz gnuradio-42c1bfdc72b29f18c5a750a07959d4cc760411b4.tar.bz2 gnuradio-42c1bfdc72b29f18c5a750a07959d4cc760411b4.zip |
Cleanup on gnuradio-examples restructuring.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6287 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-examples/python/usrp/wfm_rcv_file.py')
-rwxr-xr-x | gnuradio-examples/python/usrp/wfm_rcv_file.py | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/gnuradio-examples/python/usrp/wfm_rcv_file.py b/gnuradio-examples/python/usrp/wfm_rcv_file.py deleted file mode 100755 index 2c8d4f760..000000000 --- a/gnuradio-examples/python/usrp/wfm_rcv_file.py +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env python - -from gnuradio import gr, eng_notation -from gnuradio import audio -# from gnuradio import usrp -from gnuradio.eng_option import eng_option -from optparse import OptionParser -import sys -import math - - -# -# return a gr.flow_graph -# -def build_graph (input_filename, repeat): - adc_rate = 64e6 # USRP A/D sampling rate - decim = 250 # FPGA decimated by this amount - - quad_rate = adc_rate / decim # 256 kHz (the sample rate of the file) - audio_decimation = 8 - audio_rate = quad_rate / audio_decimation # 32 kHz - - fg = gr.flow_graph () - - # usrp is data source - # src = usrp.source_c (0, decim) - # src.set_rx_freq (0, -IF_freq) - - src = gr.file_source (gr.sizeof_gr_complex, input_filename, repeat) - - (head, tail) = build_pipeline (fg, quad_rate, audio_decimation) - - # sound card as final sink - audio_sink = audio.sink (int (audio_rate)) - - # now wire it all together - fg.connect (src, head) - fg.connect (tail, (audio_sink, 0)) - - return fg - -def build_pipeline (fg, quad_rate, audio_decimation): - '''Given a flow_graph, fg, construct a pipeline - for demodulating a broadcast FM signal. The - input is the downconverteed complex baseband - signal. The output is the demodulated audio. - - build_pipeline returns a two element tuple - containing the input and output endpoints. - ''' - fm_demod_gain = 2200.0/32768.0 - audio_rate = quad_rate / audio_decimation - volume = 1.0 - - # input: complex; output: float - fm_demod = gr.quadrature_demod_cf (volume*fm_demod_gain) - - # 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) - - TAU = 75e-6 # 75us in US, 50us in EUR - fftaps = [ 1 - math.exp(-1/TAU/quad_rate), 0] - fbtaps= [ 0 , math.exp(-1/TAU/quad_rate) ] - deemph = gr.iir_filter_ffd(fftaps,fbtaps) - - # input: float; output: float - audio_filter = gr.fir_filter_fff (audio_decimation, audio_coeffs) - - fg.connect (fm_demod, deemph) - fg.connect (deemph, audio_filter) - return ((fm_demod, 0), (audio_filter, 0)) - - -def main (): - usage = "usage: %prog [options] filename" - parser = OptionParser (option_class=eng_option, usage=usage) - parser.add_option ("-r", "--repeat", action="store_true", default=False) - # parser.add_option (... your stuff here...) - (options, args) = parser.parse_args () - - if len (args) != 1: - parser.print_help () - sys.exit (1) - - fg = build_graph (args[0], options.repeat) - - fg.start () # fork thread(s) and return - raw_input ('Press Enter to quit: ') - fg.stop () - -if __name__ == '__main__': - main () - - |