diff options
345 files changed, 5563 insertions, 12547 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 47afd0511e..7706466c44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,6 +236,7 @@ add_subdirectory(gr-audio) add_subdirectory(gr-comedi) add_subdirectory(gr-analog) add_subdirectory(gr-digital) +add_subdirectory(gr-channels) add_subdirectory(gr-noaa) add_subdirectory(gr-pager) add_subdirectory(gr-qtgui) diff --git a/docs/doxygen/other/main_page.dox b/docs/doxygen/other/main_page.dox index 2826824647..15a56d0dec 100644 --- a/docs/doxygen/other/main_page.dox +++ b/docs/doxygen/other/main_page.dox @@ -62,7 +62,7 @@ done. A single source and sink are used with a FIR filter between them. \code - from gnuradio import gr, filter + from gnuradio import gr, filter, analog class my_topblock(gr.top_block): def __init__(self): @@ -71,7 +71,7 @@ them. amp = 1 taps = filter.firdes.low_pass(1, 1, 0.1, 0.01) - self.src = gr.noise_source_c(gr.GR_GAUSSIAN, amp) + self.src = analog.noise_source_c(gr.GR_GAUSSIAN, amp) self.flt = filter.fir_filter_ccf(1, taps) self.snk = gr.null_sink(gr.sizeof_gr_complex) @@ -203,19 +203,19 @@ running and processing data, performing the reconfiguration, and then restarting the graph by unlocking it. The following example code shows a graph that first adds two -gr_noise_source_c blocks and then replaces the gr_add_cc block with a +analog::noise_source_c blocks and then replaces the gr_add_cc block with a gr_sub_cc block to then subtract the sources. \code -from gnuradio import gr +from gnuradio import gr, analog import time class mytb(gr.top_block): def __init__(self): gr.top_block.__init__(self) - self.src0 = gr.noise_source_c(gr.GR_GAUSSIAN, 1) - self.src1 = gr.noise_source_c(gr.GR_GAUSSIAN, 1) + self.src0 = analog.noise_source_c(gr.GR_GAUSSIAN, 1) + self.src1 = analog.noise_source_c(gr.GR_GAUSSIAN, 1) self.add = gr.add_cc() self.sub = gr.sub_cc() self.head = gr.head(gr.sizeof_gr_complex, 1000000) @@ -262,15 +262,15 @@ The following example expands the previous example but sets and resets the max noutput_items both locally and globally. \code -from gnuradio import gr +from gnuradio import gr, analog import time class mytb(gr.top_block): def __init__(self): gr.top_block.__init__(self) - self.src0 = gr.noise_source_c(gr.GR_GAUSSIAN, 1) - self.src1 = gr.noise_source_c(gr.GR_GAUSSIAN, 1) + self.src0 = analog.noise_source_c(gr.GR_GAUSSIAN, 1) + self.src1 = analog.noise_source_c(gr.GR_GAUSSIAN, 1) self.add = gr.add_cc() self.sub = gr.sub_cc() self.head = gr.head(gr.sizeof_gr_complex, 1000000) diff --git a/docs/doxygen/other/pfb_intro.dox b/docs/doxygen/other/pfb_intro.dox index 429e8fe5b6..504ae87b87 100644 --- a/docs/doxygen/other/pfb_intro.dox +++ b/docs/doxygen/other/pfb_intro.dox @@ -64,9 +64,9 @@ defined to use a sample rate of \p filter_size times the signal's sampling rate. A helpful wrapper for the arbitrary resampler is found in -<b>gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py</b>, -which is exposed in Python as <b>blks2.pfb_arb_resampler_ccf</b> and -<b>blks2.pfb_arb_resampler_fff</b>. This block is set up so that the +<b>gr-filter/python/pfb.py</b>, +which is exposed in Python as <b>filter.pfb.arb_resampler_ccf</b> and +<b>filter.pfb.arb_resampler_fff</b>. This block is set up so that the user only needs to pass it the real number \p rate as the resampling rate. With just this information, this hierarchical block automatically creates a filter that fully passes the signal bandwidth diff --git a/docs/exploring-gnuradio/dial_tone.py b/docs/exploring-gnuradio/dial_tone.py index cabfa0864d..ba43c43bfc 100755 --- a/docs/exploring-gnuradio/dial_tone.py +++ b/docs/exploring-gnuradio/dial_tone.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2007 Free Software Foundation, Inc. +# Copyright 2004,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -22,22 +22,23 @@ from gnuradio import gr from gnuradio import audio +from gnuradio import analog -def build_graph (): +def build_graph(): sampling_freq = 32000 ampl = 0.1 - tb = gr.top_block () - src0 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, 350, ampl) - src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, 440, ampl) - dst = audio.sink (sampling_freq) - tb.connect (src0, (dst, 0)) - tb.connect (src1, (dst, 1)) + tb = gr.top_block() + src0 = analog.sig_source_f(sampling_freq, analog.GR_SIN_WAVE, 350, ampl) + src1 = analog.sig_source_f(sampling_freq, analog.GR_SIN_WAVE, 440, ampl) + dst = audio.sink(sampling_freq) + tb.connect(src0, (dst, 0)) + tb.connect(src1, (dst, 1)) return tb if __name__ == '__main__': - tb = build_graph () - tb.start () - raw_input ('Press Enter to quit: ') - tb.stop () + tb = build_graph() + tb.start() + raw_input('Press Enter to quit: ') + tb.stop() diff --git a/docs/exploring-gnuradio/dial_tone_example.xml b/docs/exploring-gnuradio/dial_tone_example.xml index 14ea68039e..5d193df776 100644 --- a/docs/exploring-gnuradio/dial_tone_example.xml +++ b/docs/exploring-gnuradio/dial_tone_example.xml @@ -5,24 +5,25 @@ from gnuradio import gr from gnuradio import audio +from gnuradio import analog def build_graph (): sampling_freq = 48000 ampl = 0.1 - fg = gr.flow_graph () - src0 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, 350, ampl) - src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, 440, ampl) - dst = audio.sink (sampling_freq) - fg.connect ((src0, 0), (dst, 0)) - fg.connect ((src1, 0), (dst, 1)) + fg = gr.flow_graph() + src0 = analog.sig_source_f(sampling_freq, analog.GR_SIN_WAVE, 350, ampl) + src1 = analog.sig_source_f(sampling_freq, analog.GR_SIN_WAVE, 440, ampl) + dst = audio.sink(sampling_freq) + fg.connect((src0, 0), (dst, 0)) + fg.connect((src1, 0), (dst, 1)) return fg if __name__ == '__main__': - fg = build_graph () - fg.start () - raw_input ('Press Enter to quit: ') - fg.stop () + fg = build_graph() + fg.start() + raw_input('Press Enter to quit: ') + fg.stop() </programlisting> </example> diff --git a/docs/exploring-gnuradio/exploring-gnuradio.xml b/docs/exploring-gnuradio/exploring-gnuradio.xml index 286ca86095..5b70d4d0bf 100644 --- a/docs/exploring-gnuradio/exploring-gnuradio.xml +++ b/docs/exploring-gnuradio/exploring-gnuradio.xml @@ -180,7 +180,7 @@ right.</para> <para>We start by creating a flow graph to hold the blocks and connections between them. The two sine waves are generated by the -gr.sig_source_f calls. The f suffix indicates that the source produces +analog.sig_source_f calls. The f suffix indicates that the source produces floats. One sine wave is at 350 Hz, and the other is at 440 Hz. Together, they sound like the US dial tone.</para> diff --git a/docs/exploring-gnuradio/fm_demod.py b/docs/exploring-gnuradio/fm_demod.py index 0071fd751e..7b19cd826a 100755 --- a/docs/exploring-gnuradio/fm_demod.py +++ b/docs/exploring-gnuradio/fm_demod.py @@ -1,18 +1,19 @@ #!/usr/bin/env python from gnuradio import gr +from gnuradio import analog from gnuradio import audio from gnuradio import mc4020 import sys -def high_speed_adc (fg, input_rate): +def high_speed_adc(fg, input_rate): # return gr.file_source (gr.sizeof_short, "dummy.dat", False) - return mc4020.source (input_rate, mc4020.MCC_CH3_EN | mc4020.MCC_ALL_1V) + return mc4020.source(input_rate, mc4020.MCC_CH3_EN | mc4020.MCC_ALL_1V) # # return a gr.flow_graph # -def build_graph (freq1, freq2): +def build_graph(freq1, freq2): input_rate = 20e6 cfir_decimation = 125 audio_decimation = 5 @@ -20,35 +21,35 @@ def build_graph (freq1, freq2): quad_rate = input_rate / cfir_decimation audio_rate = quad_rate / audio_decimation - fg = gr.flow_graph () + fg = gr.flow_graph() # use high speed ADC as input source - src = high_speed_adc (fg, input_rate) + src = high_speed_adc(fg, input_rate) # compute FIR filter taps for channel selection channel_coeffs = \ - gr.firdes.low_pass (1.0, # gain - input_rate, # sampling rate - 250e3, # low pass cutoff freq - 8*100e3, # width of trans. band - gr.firdes.WIN_HAMMING) + filter.firdes.low_pass(1.0, # gain + input_rate, # sampling rate + 250e3, # low pass cutoff freq + 8*100e3, # width of trans. band + filter.firdes.WIN_HAMMING) # input: short; output: complex chan_filter1 = \ - gr.freq_xlating_fir_filter_scf (cfir_decimation, - channel_coeffs, - freq1, # 1st station freq - input_rate) + filter.freq_xlating_fir_filter_scf(cfir_decimation, + channel_coeffs, + freq1, # 1st station freq + input_rate) - (head1, tail1) = build_pipeline (fg, quad_rate, audio_decimation) + (head1, tail1) = build_pipeline(fg, quad_rate, audio_decimation) # sound card as final sink - audio_sink = audio.sink (int (audio_rate)) + audio_sink = audio.sink(int (audio_rate)) # now wire it all together - fg.connect (src, chan_filter1) - fg.connect (chan_filter1, head1) - fg.connect (tail1, (audio_sink, 0)) + fg.connect(src, chan_filter1) + fg.connect(chan_filter1, head1) + fg.connect(tail1, (audio_sink, 0)) # two stations at once? if freq2: @@ -57,20 +58,20 @@ def build_graph (freq1, freq2): # input: short; output: complex chan_filter2 = \ - gr.freq_xlating_fir_filter_scf (cfir_decimation, - channel_coeffs, - freq2, # 2nd station freq - input_rate) + filter.freq_xlating_fir_filter_scf(cfir_decimation, + channel_coeffs, + freq2, # 2nd station freq + input_rate) - (head2, tail2) = build_pipeline (fg, quad_rate, audio_decimation) + (head2, tail2) = build_pipeline(fg, quad_rate, audio_decimation) - fg.connect (src, chan_filter2) - fg.connect (chan_filter2, head2) - fg.connect (tail2, (audio_sink, 1)) + fg.connect(src, chan_filter2) + fg.connect(chan_filter2, head2) + fg.connect(tail2, (audio_sink, 1)) return fg -def build_pipeline (fg, quad_rate, audio_decimation): +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 @@ -84,67 +85,67 @@ def build_pipeline (fg, quad_rate, audio_decimation): volume = 1.0 # input: complex; output: float - fm_demod = gr.quadrature_demod_cf (volume*fm_demod_gain) + fm_demod = analog.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) + audio_coeffs = filter.firdes.low_pass(1.0, # gain + quad_rate, # sampling rate + audio_rate/2 - width_of_transition_band, + width_of_transition_band, + filter.firdes.WIN_HAMMING) # input: float; output: float - audio_filter = gr.fir_filter_fff (audio_decimation, audio_coeffs) + audio_filter = filter.fir_filter_fff(audio_decimation, audiocoeffs) - fg.connect (fm_demod, audio_filter) + fg.connect(fm_demod, audio_filter) return ((fm_demod, 0), (audio_filter, 0)) -def main (args): - nargs = len (args) +def main(args): + nargs = len(args) if nargs == 1: - freq1 = float (args[0]) * 1e6 + freq1 = float(args[0]) * 1e6 freq2 = None elif nargs == 2: - freq1 = float (args[0]) * 1e6 - freq2 = float (args[1]) * 1e6 + freq1 = float(args[0]) * 1e6 + freq2 = float(args[1]) * 1e6 else: - sys.stderr.write ('usage: fm_demod freq1 [freq2]\n') - sys.exit (1) + sys.stderr.write('usage: fm_demod freq1 [freq2]\n') + sys.exit(1) # connect to RF front end - rf_front_end = gr.microtune_4937_eval_board () - if not rf_front_end.board_present_p (): + rf_front_end = gr.microtune_4937_eval_board() + if not rf_front_end.board_present_p(): raise IOError, 'RF front end not found' # set front end gain - rf_front_end.set_AGC (300) - IF_freq = rf_front_end.get_output_freq () + rf_front_end.set_AGC(300) + IF_freq = rf_front_end.get_output_freq() IF_freq = 5.75e6 if not freq2: # one station - rf_front_end.set_RF_freq (freq1) - fg = build_graph (IF_freq, None) + rf_front_end.set_RF_freq(freq1) + fg = build_graph(IF_freq, None) else: # two stations - if abs (freq1 - freq2) > 5.5e6: + if abs(freq1 - freq2) > 5.5e6: raise IOError, 'freqs too far apart' target_freq = (freq1 + freq2) / 2 - actual_freq = rf_front_end.set_RF_freq (target_freq) + actual_freq = rf_front_end.set_RF_freq(target_freq) #actual_freq = target_freq - fg = build_graph (IF_freq + freq1 - actual_freq, - IF_freq + freq2 - actual_freq) + fg = build_graph(IF_freq + freq1 - actual_freq, + IF_freq + freq2 - actual_freq) - fg.start () # fork thread(s) and return - raw_input ('Press Enter to quit: ') - fg.stop () + fg.start() # fork thread(s) and return + raw_input('Press Enter to quit: ') + fg.stop() if __name__ == '__main__': - main (sys.argv[1:]) + main(sys.argv[1:]) diff --git a/docs/exploring-gnuradio/fm_demod_example.xml b/docs/exploring-gnuradio/fm_demod_example.xml index b417da0a81..05c2ee163b 100644 --- a/docs/exploring-gnuradio/fm_demod_example.xml +++ b/docs/exploring-gnuradio/fm_demod_example.xml @@ -4,6 +4,8 @@ #!/usr/bin/env python from gnuradio import gr +from gnuradio import filter +from gnuradio import analog from gnuradio import audio from gnuradio import mc4020 import sys @@ -30,28 +32,28 @@ def build_graph (freq1, freq2): # compute FIR filter taps for channel selection channel_coeffs = \ - gr.firdes.low_pass (1.0, # gain - input_rate, # sampling rate - 250e3, # low pass cutoff freq - 8*100e3, # width of trans. band - gr.firdes.WIN_HAMMING) + filter.firdes.low_pass(1.0, # gain + input_rate, # sampling rate + 250e3, # low pass cutoff freq + 8*100e3, # width of trans. band + filter.firdes.WIN_HAMMING) # input: short; output: complex chan_filter1 = \ - gr.freq_xlating_fir_filter_scf (cfir_decimation, - channel_coeffs, - freq1, # 1st station freq - input_rate) + filter.freq_xlating_fir_filter_scf(cfir_decimation, + channel_coeffs, + freq1, # 1st station freq + input_rate) - (head1, tail1) = build_pipeline (fg, quad_rate, audio_decimation) + (head1, tail1) = build_pipeline(fg, quad_rate, audio_decimation) # sound card as final sink - audio_sink = audio.sink (int (audio_rate)) + audio_sink = audio.sink(int (audio_rate)) # now wire it all together - fg.connect (src, chan_filter1) - fg.connect (chan_filter1, head1) - fg.connect (tail1, (audio_sink, 0)) + fg.connect(src, chan_filter1) + fg.connect(chan_filter1, head1) + fg.connect(tail1, (audio_sink, 0)) return fg @@ -69,20 +71,20 @@ def build_pipeline (fg, quad_rate, audio_decimation): volume = 1.0 # input: complex; output: float - fm_demod = gr.quadrature_demod_cf (volume*fm_demod_gain) + fm_demod = analog.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) + audio_coeffs = filter.firdes.low_pass(1.0, # gain + quad_rate, # sampling rate + audio_rate/2 - width_of_transition_band, + width_of_transition_band, + filter.firdes.WIN_HAMMING) # input: float; output: float - audio_filter = gr.fir_filter_fff (audio_decimation, audio_coeffs) + audio_filter = filter.fir_filter_fff(audio_decimation, audio_coeffs) - fg.connect (fm_demod, audio_filter) + fg.connect(fm_demod, audio_filter) return ((fm_demod, 0), (audio_filter, 0)) @@ -90,34 +92,34 @@ def main (args): nargs = len (args) if nargs == 1: # get station frequency from command line - freq1 = float (args[0]) * 1e6 + freq1 = float(args[0]) * 1e6 else: - sys.stderr.write ('usage: fm_demod freq\n') - sys.exit (1) + sys.stderr.write('usage: fm_demod freq\n') + sys.exit(1) # connect to RF front end - rf_front_end = gr.microtune_4937_eval_board () - if not rf_front_end.board_present_p (): + rf_front_end = gr.microtune_4937_eval_board() + if not rf_front_end.board_present_p(): raise IOError, 'RF front end not found' # set front end gain - rf_front_end.set_AGC (300) + rf_front_end.set_AGC(300) # determine the front end's "Intermediate Frequency" - IF_freq = rf_front_end.get_output_freq () # 5.75e6 + IF_freq = rf_front_end.get_output_freq() # 5.75e6 # Tell the front end to tune to freq1. # I.e., freq1 is translated down to the IF frequency - rf_front_end.set_RF_freq (freq1) + rf_front_end.set_RF_freq(freq1) # build the flow graph - fg = build_graph (IF_freq, None) + fg = build_graph(IF_freq, None) - fg.start () # fork thread(s) and return - raw_input ('Press Enter to quit: ') - fg.stop () + fg.start() # fork thread(s) and return + raw_input('Press Enter to quit: ') + fg.stop() if __name__ == '__main__': - main (sys.argv[1:]) + main(sys.argv[1:]) </programlisting> </example> diff --git a/docs/sphinx/source/blks2/blks.rst b/docs/sphinx/source/blks2/blks.rst index c28c7af0f8..6510169710 100644 --- a/docs/sphinx/source/blks2/blks.rst +++ b/docs/sphinx/source/blks2/blks.rst @@ -1,31 +1,9 @@ gnuradio.blks2: Signal Processing Blocks ======================================== -.. autopyblock:: gnuradio.blks2.am_demod_cf -.. autopyblock:: gnuradio.blks2.ctcss_gen_f -.. autopyblock:: gnuradio.blks2.demod_10k0a3e_cf -.. autopyblock:: gnuradio.blks2.demod_200kf3e_cf -.. autopyblock:: gnuradio.blks2.demod_20k0f3e_cf -.. autopyblock:: gnuradio.blks2.fm_demod_cf -.. autopyblock:: gnuradio.blks2.logpwrfft_c -.. autopyblock:: gnuradio.blks2.logpwrfft_f -.. autopyblock:: gnuradio.blks2.pfb_arb_resampler_ccf -.. autopyblock:: gnuradio.blks2.pfb_arb_resampler_fff -.. autopyblock:: gnuradio.blks2.pfb_channelizer_ccf -.. autopyblock:: gnuradio.blks2.pfb_decimator_ccf -.. autopyblock:: gnuradio.blks2.pfb_interpolator_ccf .. autopyblock:: gnuradio.blks2.rational_resampler_ccc .. autopyblock:: gnuradio.blks2.rational_resampler_ccf .. autopyblock:: gnuradio.blks2.rational_resampler_fff .. autopyblock:: gnuradio.blks2.analysis_filterbank -.. autopyblock:: gnuradio.blks2.fm_deemph -.. autopyblock:: gnuradio.blks2.fm_preemph -.. autopyblock:: gnuradio.blks2.nbfm_rx -.. autopyblock:: gnuradio.blks2.nbfm_tx .. autopyblock:: gnuradio.blks2.stream_to_vector_decimator -.. autopyblock:: gnuradio.blks2.standard_squelch .. autopyblock:: gnuradio.blks2.synthesis_filterbank -.. autopyblock:: gnuradio.blks2.wfm_rcv -.. autopyblock:: gnuradio.blks2.wfm_rcv_fmdet -.. autopyblock:: gnuradio.blks2.wfm_rcv_pll -.. autopyblock:: gnuradio.blks2.wfm_tx diff --git a/docs/sphinx/source/blks2/index.rst b/docs/sphinx/source/blks2/index.rst index 4df8e5a796..7a911d001b 100644 --- a/docs/sphinx/source/blks2/index.rst +++ b/docs/sphinx/source/blks2/index.rst @@ -8,35 +8,13 @@ Signal Processing Blocks .. autosummary:: :nosignatures: - - gnuradio.blks2.am_demod_cf - gnuradio.blks2.ctcss_gen_f - gnuradio.blks2.demod_10k0a3e_cf - gnuradio.blks2.demod_200kf3e_cf - gnuradio.blks2.demod_20k0f3e_cf - gnuradio.blks2.fm_demod_cf - gnuradio.blks2.logpwrfft_c - gnuradio.blks2.logpwrfft_f - gnuradio.blks2.pfb_arb_resampler_ccf - gnuradio.blks2.pfb_arb_resampler_fff - gnuradio.blks2.pfb_channelizer_ccf - gnuradio.blks2.pfb_decimator_ccf - gnuradio.blks2.pfb_interpolator_ccf + gnuradio.blks2.rational_resampler_ccc gnuradio.blks2.rational_resampler_ccf gnuradio.blks2.rational_resampler_fff gnuradio.blks2.analysis_filterbank - gnuradio.blks2.fm_deemph - gnuradio.blks2.fm_preemph - gnuradio.blks2.nbfm_rx - gnuradio.blks2.nbfm_tx gnuradio.blks2.stream_to_vector_decimator - gnuradio.blks2.standard_squelch gnuradio.blks2.synthesis_filterbank - gnuradio.blks2.wfm_rcv - gnuradio.blks2.wfm_rcv_fmdet - gnuradio.blks2.wfm_rcv_pll - gnuradio.blks2.wfm_tx Utility Functions ----------------- diff --git a/docs/sphinx/source/gr/demodulation_blk.rst b/docs/sphinx/source/gr/demodulation_blk.rst deleted file mode 100644 index 4f800b642b..0000000000 --- a/docs/sphinx/source/gr/demodulation_blk.rst +++ /dev/null @@ -1,4 +0,0 @@ -gnuradio.gr: Demodulation -========================= - -.. autooldblock:: gnuradio.gr.quadrature_demod_cf diff --git a/docs/sphinx/source/gr/index.rst b/docs/sphinx/source/gr/index.rst index 53ceba08e7..ec4671d545 100644 --- a/docs/sphinx/source/gr/index.rst +++ b/docs/sphinx/source/gr/index.rst @@ -23,14 +23,6 @@ Signal Sources gnuradio.gr.lfsr_32k_source_s gnuradio.gr.null_source - gnuradio.gr.noise_source_c - gnuradio.gr.noise_source_f - gnuradio.gr.noise_source_i - gnuradio.gr.noise_source_s - gnuradio.gr.sig_source_c - gnuradio.gr.sig_source_f - gnuradio.gr.sig_source_i - gnuradio.gr.sig_source_s gnuradio.gr.vector_source_b gnuradio.gr.vector_source_c gnuradio.gr.vector_source_f @@ -52,9 +44,6 @@ Signal Sinks gnuradio.gr.check_counting_s gnuradio.gr.check_lfsr_32k_s gnuradio.gr.null_sink - gnuradio.gr.probe_avg_mag_sqrd_c - gnuradio.gr.probe_avg_mag_sqrd_cf - gnuradio.gr.probe_avg_mag_sqrd_f gnuradio.gr.probe_signal_f gnuradio.gr.vector_sink_b gnuradio.gr.vector_sink_c @@ -182,24 +171,6 @@ Mathematics gnuradio.gr.xor_ii gnuradio.gr.xor_ss -Modulation -^^^^^^^^^^ - -.. autosummary:: - :nosignatures: - - gnuradio.gr.cpfsk_bc - gnuradio.gr.frequency_modulator_fc - gnuradio.gr.phase_modulator_fc - -Demodulation -^^^^^^^^^^^^ - -.. autosummary:: - :nosignatures: - - gnuradio.gr.quadrature_demod_cf - Information Coding and Decoding ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -215,9 +186,6 @@ Synchronization .. autosummary:: :nosignatures: - gnuradio.gr.pll_carriertracking_cc - gnuradio.gr.pll_freqdet_cf - gnuradio.gr.pll_refout_cc gnuradio.gr.simple_correlator Type Conversions @@ -255,18 +223,8 @@ Signal Level Control (AGC) .. autosummary:: :nosignatures: - gnuradio.gr.agc2_cc - gnuradio.gr.agc2_ff - gnuradio.gr.agc_cc - gnuradio.gr.agc_ff - gnuradio.gr.ctcss_squelch_ff - gnuradio.gr.dpll_bb - gnuradio.gr.feedforward_agc_cc gnuradio.gr.peak_detector2_fb - gnuradio.gr.pwr_squelch_cc - gnuradio.gr.pwr_squelch_ff gnuradio.gr.regenerate_bb - gnuradio.gr.simple_squelch_cc gnuradio.gr.mute_cc gnuradio.gr.mute_ff gnuradio.gr.mute_ii diff --git a/docs/sphinx/source/gr/level_blk.rst b/docs/sphinx/source/gr/level_blk.rst index d6c565c65d..0eacb67230 100644 --- a/docs/sphinx/source/gr/level_blk.rst +++ b/docs/sphinx/source/gr/level_blk.rst @@ -1,18 +1,9 @@ gnuradio.gr: Signal Level Control (AGC) ======================================= -.. autooldblock:: gnuradio.gr.agc2_cc -.. autooldblock:: gnuradio.gr.agc2_ff -.. autooldblock:: gnuradio.gr.agc_cc -.. autooldblock:: gnuradio.gr.agc_ff -.. autooldblock:: gnuradio.gr.ctcss_squelch_ff .. autooldblock:: gnuradio.gr.dpll_bb -.. autooldblock:: gnuradio.gr.feedforward_agc_cc .. autooldblock:: gnuradio.gr.peak_detector2_fb -.. autooldblock:: gnuradio.gr.pwr_squelch_cc -.. autooldblock:: gnuradio.gr.pwr_squelch_ff .. autooldblock:: gnuradio.gr.regenerate_bb -.. autooldblock:: gnuradio.gr.simple_squelch_cc .. autooldblock:: gnuradio.gr.mute_cc .. autooldblock:: gnuradio.gr.mute_ff .. autooldblock:: gnuradio.gr.mute_ii diff --git a/docs/sphinx/source/gr/modulation_blk.rst b/docs/sphinx/source/gr/modulation_blk.rst deleted file mode 100644 index 1fff4614ca..0000000000 --- a/docs/sphinx/source/gr/modulation_blk.rst +++ /dev/null @@ -1,6 +0,0 @@ -gnuradio.gr: Modulation -======================= - -.. autooldblock:: gnuradio.gr.cpfsk_bc -.. autooldblock:: gnuradio.gr.frequency_modulator_fc -.. autooldblock:: gnuradio.gr.phase_modulator_fc diff --git a/docs/sphinx/source/gr/sink_blk.rst b/docs/sphinx/source/gr/sink_blk.rst index 80b66370c5..5e396d895a 100644 --- a/docs/sphinx/source/gr/sink_blk.rst +++ b/docs/sphinx/source/gr/sink_blk.rst @@ -5,9 +5,6 @@ gnuradio.gr: Signal Sinks .. autooldblock:: gnuradio.gr.check_counting_s .. autooldblock:: gnuradio.gr.check_lfsr_32k_s .. autooldblock:: gnuradio.gr.null_sink -.. autooldblock:: gnuradio.gr.probe_avg_mag_sqrd_c -.. autooldblock:: gnuradio.gr.probe_avg_mag_sqrd_cf -.. autooldblock:: gnuradio.gr.probe_avg_mag_sqrd_f .. autooldblock:: gnuradio.gr.probe_signal_f .. autooldblock:: gnuradio.gr.vector_sink_b .. autooldblock:: gnuradio.gr.vector_sink_c diff --git a/docs/sphinx/source/gr/source_blk.rst b/docs/sphinx/source/gr/source_blk.rst index c3e30c17b7..8e9f67980c 100644 --- a/docs/sphinx/source/gr/source_blk.rst +++ b/docs/sphinx/source/gr/source_blk.rst @@ -3,14 +3,6 @@ gnuradio.gr: Signal Sources .. autooldblock:: gnuradio.gr.lfsr_32k_source_s .. autooldblock:: gnuradio.gr.null_source -.. autooldblock:: gnuradio.gr.noise_source_c -.. autooldblock:: gnuradio.gr.noise_source_f -.. autooldblock:: gnuradio.gr.noise_source_i -.. autooldblock:: gnuradio.gr.noise_source_s -.. autooldblock:: gnuradio.gr.sig_source_c -.. autooldblock:: gnuradio.gr.sig_source_f -.. autooldblock:: gnuradio.gr.sig_source_i -.. autooldblock:: gnuradio.gr.sig_source_s .. autooldblock:: gnuradio.gr.vector_source_b .. autooldblock:: gnuradio.gr.vector_source_c .. autooldblock:: gnuradio.gr.vector_source_f diff --git a/docs/sphinx/source/gr/sync_blk.rst b/docs/sphinx/source/gr/sync_blk.rst index b4875bdbdc..d5e3c3d7c5 100644 --- a/docs/sphinx/source/gr/sync_blk.rst +++ b/docs/sphinx/source/gr/sync_blk.rst @@ -1,7 +1,4 @@ gnuradio.gr: Synchronization ============================ -.. autooldblock:: gnuradio.gr.pll_carriertracking_cc -.. autooldblock:: gnuradio.gr.pll_freqdet_cf -.. autooldblock:: gnuradio.gr.pll_refout_cc .. autooldblock:: gnuradio.gr.simple_correlator diff --git a/gnuradio-core/src/examples/network/dial_tone_source.py b/gnuradio-core/src/examples/network/dial_tone_source.py index 232a06de80..8c826e2ad4 100755 --- a/gnuradio-core/src/examples/network/dial_tone_source.py +++ b/gnuradio-core/src/examples/network/dial_tone_source.py @@ -23,14 +23,20 @@ from gnuradio import gr from gnuradio.eng_option import eng_option from optparse import OptionParser +import sys + +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("This example required gr-analog.\n") class dial_tone_source(gr.top_block): def __init__(self, host, port, pkt_size, sample_rate, eof): gr.top_block.__init__(self, "dial_tone_source") amplitude = 0.3 - src0 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 350, amplitude) - src1 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 440, amplitude) + src0 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 350, amplitude) + src1 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 440, amplitude) add = gr.add_ff() # Throttle needed here to account for the other side's audio card sampling rate diff --git a/gnuradio-core/src/examples/tags/CMakeLists.txt b/gnuradio-core/src/examples/tags/CMakeLists.txt index 2d9dc20832..8975fd03aa 100644 --- a/gnuradio-core/src/examples/tags/CMakeLists.txt +++ b/gnuradio-core/src/examples/tags/CMakeLists.txt @@ -21,7 +21,6 @@ include(GrPython) GR_PYTHON_INSTALL(PROGRAMS test_file_tags.py - uhd_burst_detector.py DESTINATION ${GR_PKG_DATA_DIR}/examples/tags COMPONENT "core_python" ) diff --git a/gr-analog/lib/qa_rotator.cc b/gnuradio-core/src/lib/filter/qa_rotator.cc index b722f32c43..b722f32c43 100644 --- a/gr-analog/lib/qa_rotator.cc +++ b/gnuradio-core/src/lib/filter/qa_rotator.cc diff --git a/gr-analog/lib/qa_rotator.h b/gnuradio-core/src/lib/filter/qa_rotator.h index a22e41ec26..a22e41ec26 100644 --- a/gr-analog/lib/qa_rotator.h +++ b/gnuradio-core/src/lib/filter/qa_rotator.h diff --git a/gnuradio-core/src/lib/general/CMakeLists.txt b/gnuradio-core/src/lib/general/CMakeLists.txt index 7173246ea0..848d860a8f 100644 --- a/gnuradio-core/src/lib/general/CMakeLists.txt +++ b/gnuradio-core/src/lib/general/CMakeLists.txt @@ -97,7 +97,6 @@ list(APPEND gnuradio_core_sources list(APPEND test_gnuradio_core_sources ${CMAKE_CURRENT_SOURCE_DIR}/qa_general.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_gr_circular_file.cc - ${CMAKE_CURRENT_SOURCE_DIR}/qa_gr_cpm.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_gr_firdes.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_gr_fxpt.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_gr_fxpt_nco.cc @@ -127,10 +126,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr_test_types.h ${CMAKE_CURRENT_SOURCE_DIR}/gr_vco.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_add_const_ss.h - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc_cc.h - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc_ff.h - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc2_cc.h - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc2_ff.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_char_to_float.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_control_loop.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_debugger_hook.h @@ -139,7 +134,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gri_float_to_int.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_float_to_short.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_float_to_uchar.h - ${CMAKE_CURRENT_SOURCE_DIR}/gri_lfsr.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_interleaved_short_to_complex.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_lfsr_15_1_0.h ${CMAKE_CURRENT_SOURCE_DIR}/gri_lfsr_32k.h @@ -159,10 +153,6 @@ if(ENABLE_PYTHON) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/general.i ${CMAKE_CURRENT_SOURCE_DIR}/gr_constants.i - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc_cc.i - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc_ff.i - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc2_cc.i - ${CMAKE_CURRENT_SOURCE_DIR}/gri_agc2_ff.i ${CMAKE_CURRENT_SOURCE_DIR}/gri_control_loop.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig COMPONENT "core_swig" @@ -175,10 +165,6 @@ endif(ENABLE_PYTHON) set(gr_core_general_triple_threats complex_vec_test gr_add_ff - gr_agc_cc - gr_agc_ff - gr_agc2_cc - gr_agc2_ff gr_align_on_samplenumbers_ss gr_bin_statistics_f gr_char_to_float @@ -189,17 +175,12 @@ set(gr_core_general_triple_threats gr_complex_to_xxx gr_conjugate_cc gr_copy - gr_cpfsk_bc - gr_cpm - gr_ctcss_squelch_ff gr_decode_ccsds_27_fb - gr_dpll_bb gr_deinterleave gr_delay gr_encode_ccsds_27_bb gr_endian_swap gr_fake_channel_coder_pp - gr_feedforward_agc_cc gr_feval gr_firdes gr_float_to_char @@ -207,8 +188,6 @@ set(gr_core_general_triple_threats gr_float_to_int gr_float_to_short gr_float_to_uchar - gr_fmdet_cf - gr_frequency_modulator_fc gr_head gr_int_to_float gr_interleave @@ -229,18 +208,7 @@ set(gr_core_general_triple_threats gr_null_source gr_pa_2x2_phase_combiner gr_peak_detector2_fb - gr_phase_modulator_fc - gr_pll_carriertracking_cc - gr_pll_freqdet_cf - gr_pll_refout_cc gr_prefs - gr_probe_avg_mag_sqrd_c - gr_probe_avg_mag_sqrd_cf - gr_probe_avg_mag_sqrd_f - gr_pwr_squelch_cc - gr_pwr_squelch_ff - gr_quadrature_demod_cf - gr_rail_ff gr_regenerate_bb gr_remez gr_rms_cf @@ -249,10 +217,7 @@ set(gr_core_general_triple_threats gr_short_to_float gr_short_to_char gr_simple_correlator - gr_simple_squelch_cc gr_skiphead - gr_squelch_base_cc - gr_squelch_base_ff gr_stream_mux gr_stream_to_streams gr_stream_to_vector diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index b8d567b7cf..93c5d5ddb4 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. + * Copyright 2004-2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -28,7 +28,6 @@ #include <gr_null_source.h> #include <gr_head.h> #include <gr_skiphead.h> -#include <gr_quadrature_demod_cf.h> #include <gr_remez.h> #include <gr_float_to_complex.h> #include <gr_check_counting_s.h> @@ -48,8 +47,6 @@ #include <gr_char_to_float.h> #include <gr_char_to_short.h> #include <gr_uchar_to_float.h> -#include <gr_frequency_modulator_fc.h> -#include <gr_phase_modulator_fc.h> #include <gr_simple_correlator.h> #include <gr_align_on_samplenumbers_ss.h> #include <gr_complex_to_xxx.h> @@ -61,11 +58,6 @@ #include <gr_interleave.h> #include <gr_deinterleave.h> #include <gr_delay.h> -#include <gr_simple_squelch_cc.h> -#include <gr_agc_ff.h> -#include <gr_agc_cc.h> -#include <gr_agc2_ff.h> -#include <gr_agc2_cc.h> #include <gr_rms_cf.h> #include <gr_rms_ff.h> #include <gr_nlog10_ff.h> @@ -80,14 +72,6 @@ #include <gr_conjugate_cc.h> #include <gr_vco_f.h> #include <gr_threshold_ff.h> -#include <gr_dpll_bb.h> -#include <gr_fmdet_cf.h> -#include <gr_pll_freqdet_cf.h> -#include <gr_pll_refout_cc.h> -#include <gr_pll_carriertracking_cc.h> -#include <gr_probe_avg_mag_sqrd_c.h> -#include <gr_probe_avg_mag_sqrd_cf.h> -#include <gr_probe_avg_mag_sqrd_f.h> #include <gr_regenerate_bb.h> #include <gr_pa_2x2_phase_combiner.h> #include <gr_kludge_copy.h> @@ -103,17 +87,11 @@ #include <gr_multiply_const_ff.h> #include <gr_multiply_conjugate_cc.h> #include <gr_feval.h> -#include <gr_pwr_squelch_cc.h> -#include <gr_pwr_squelch_ff.h> -#include <gr_ctcss_squelch_ff.h> -#include <gr_feedforward_agc_cc.h> #include <gr_bin_statistics_f.h> #include <gr_peak_detector2_fb.h> #include <gr_repeat.h> -#include <gr_cpfsk_bc.h> #include <gr_encode_ccsds_27_bb.h> #include <gr_decode_ccsds_27_fb.h> -#include <gr_rail_ff.h> #include <gr_stretch_ff.h> #include <gr_copy.h> #include <complex_vec_test.h> @@ -121,7 +99,6 @@ #include <gr_annotator_1to1.h> #include <gr_annotator_raw.h> #include <gr_burst_tagger.h> -#include <gr_cpm.h> #include <gr_vector_map.h> #include <gr_add_ff.h> #include <gr_tag_debug.h> @@ -133,7 +110,6 @@ %include "gr_null_source.i" %include "gr_head.i" %include "gr_skiphead.i" -%include "gr_quadrature_demod_cf.i" %include "gr_remez.i" %include "gr_float_to_complex.i" %include "gr_check_counting_s.i" @@ -153,8 +129,6 @@ %include "gr_char_to_float.i" %include "gr_char_to_short.i" %include "gr_uchar_to_float.i" -%include "gr_frequency_modulator_fc.i" -%include "gr_phase_modulator_fc.i" %include "gr_simple_correlator.i" %include "gr_align_on_samplenumbers_ss.i" %include "gr_complex_to_xxx.i" @@ -166,11 +140,6 @@ %include "gr_interleave.i" %include "gr_deinterleave.i" %include "gr_delay.i" -%include "gr_simple_squelch_cc.i" -%include "gr_agc_ff.i" -%include "gr_agc_cc.i" -%include "gr_agc2_ff.i" -%include "gr_agc2_cc.i" %include "gr_rms_cf.i" %include "gr_rms_ff.i" %include "gr_nlog10_ff.i" @@ -185,14 +154,6 @@ %include "gr_conjugate_cc.i" %include "gr_vco_f.i" %include "gr_threshold_ff.i" -%include "gr_dpll_bb.i" -%include "gr_fmdet_cf.i" -%include "gr_pll_freqdet_cf.i" -%include "gr_pll_refout_cc.i" -%include "gr_pll_carriertracking_cc.i" -%include "gr_probe_avg_mag_sqrd_c.i" -%include "gr_probe_avg_mag_sqrd_cf.i" -%include "gr_probe_avg_mag_sqrd_f.i" %include "gr_regenerate_bb.i" %include "gr_pa_2x2_phase_combiner.i" %include "gr_kludge_copy.i" @@ -208,17 +169,11 @@ %include "gr_multiply_const_ff.i" %include "gr_multiply_conjugate_cc.i" %include "gr_feval.i" -%include "gr_pwr_squelch_cc.i" -%include "gr_pwr_squelch_ff.i" -%include "gr_ctcss_squelch_ff.i" -%include "gr_feedforward_agc_cc.i" %include "gr_bin_statistics_f.i" %include "gr_peak_detector2_fb.i" %include "gr_repeat.i" -%include "gr_cpfsk_bc.i" %include "gr_encode_ccsds_27_bb.i" %include "gr_decode_ccsds_27_fb.i" -%include "gr_rail_ff.i" %include "gr_stretch_ff.i" %include "gr_copy.i" %include "complex_vec_test.i" @@ -226,7 +181,6 @@ %include "gr_annotator_1to1.i" %include "gr_annotator_raw.i" %include "gr_burst_tagger.i" -%include "gr_cpm.i" %include "gr_vector_map.i" %include "gr_add_ff.i" %include "gr_tag_debug.i" diff --git a/gnuradio-core/src/lib/general/general_generated.i b/gnuradio-core/src/lib/general/general_generated.i index 43828e7f71..5671570a6f 100644 --- a/gnuradio-core/src/lib/general/general_generated.i +++ b/gnuradio-core/src/lib/general/general_generated.i @@ -38,10 +38,6 @@ #include <gr_mute_ff.h> #include <gr_mute_ii.h> #include <gr_mute_ss.h> -#include <gr_noise_source_c.h> -#include <gr_noise_source_f.h> -#include <gr_noise_source_i.h> -#include <gr_noise_source_s.h> #include <gr_packed_to_unpacked_bb.h> #include <gr_packed_to_unpacked_ii.h> #include <gr_packed_to_unpacked_ss.h> @@ -55,10 +51,6 @@ #include <gr_probe_signal_vi.h> #include <gr_probe_signal_vf.h> #include <gr_probe_signal_vc.h> -#include <gr_sig_source_c.h> -#include <gr_sig_source_f.h> -#include <gr_sig_source_i.h> -#include <gr_sig_source_s.h> #include <gr_sub_cc.h> #include <gr_sub_ff.h> #include <gr_sub_ii.h> @@ -114,10 +106,6 @@ %include <gr_mute_ff.i> %include <gr_mute_ii.i> %include <gr_mute_ss.i> -%include <gr_noise_source_c.i> -%include <gr_noise_source_f.i> -%include <gr_noise_source_i.i> -%include <gr_noise_source_s.i> %include <gr_packed_to_unpacked_bb.i> %include <gr_packed_to_unpacked_ii.i> %include <gr_packed_to_unpacked_ss.i> @@ -131,10 +119,6 @@ %include <gr_probe_signal_vi.i> %include <gr_probe_signal_vf.i> %include <gr_probe_signal_vc.i> -%include <gr_sig_source_c.i> -%include <gr_sig_source_f.i> -%include <gr_sig_source_i.i> -%include <gr_sig_source_s.i> %include <gr_sub_cc.i> %include <gr_sub_ff.i> %include <gr_sub_ii.i> diff --git a/gnuradio-core/src/lib/general/gr_agc2_cc.cc b/gnuradio-core/src/lib/general/gr_agc2_cc.cc deleted file mode 100644 index 5097babc9b..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc2_cc.cc +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_agc2_cc.h> -#include <gr_io_signature.h> -#include <gri_agc2_cc.h> - -gr_agc2_cc_sptr -gr_make_agc2_cc (float attack_rate, float decay_rate, float reference, - float gain, float max_gain) -{ - return gnuradio::get_initial_sptr(new gr_agc2_cc (attack_rate, decay_rate, reference, gain, max_gain)); -} - -gr_agc2_cc::gr_agc2_cc (float attack_rate, float decay_rate, float reference, - float gain, float max_gain) - : gr_sync_block ("gr_agc2_cc", - gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (gr_complex))), - gri_agc2_cc (attack_rate, decay_rate, reference, gain, max_gain) -{ -} - -int -gr_agc2_cc::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - scaleN (out, in, noutput_items); - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_agc2_cc.h b/gnuradio-core/src/lib/general/gr_agc2_cc.h deleted file mode 100644 index 54bae1aae9..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc2_cc.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_AGC2_CC_H -#define INCLUDED_GR_AGC2_CC_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gri_agc2_cc.h> - -class gr_agc2_cc; -typedef boost::shared_ptr<gr_agc2_cc> gr_agc2_cc_sptr; - -GR_CORE_API gr_agc2_cc_sptr -gr_make_agc2_cc (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); -/*! - * \brief high performance Automatic Gain Control class - * \ingroup level_blk - * - * For Power the absolute value of the complex number is used. - */ - -class GR_CORE_API gr_agc2_cc : public gr_sync_block, public gri_agc2_cc -{ - friend GR_CORE_API gr_agc2_cc_sptr gr_make_agc2_cc (float attack_rate, float decay_rate, float reference, - float gain, float max_gain); - gr_agc2_cc (float attack_rate, float decay_rate, float reference, - float gain, float max_gain); - - public: - virtual int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_AGC2_CC_H */ diff --git a/gnuradio-core/src/lib/general/gr_agc2_cc.i b/gnuradio-core/src/lib/general/gr_agc2_cc.i deleted file mode 100644 index 6d7b221010..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc2_cc.i +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,agc2_cc) - -%include <gri_agc2_cc.i> - -gr_agc2_cc_sptr -gr_make_agc2_cc (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - -class gr_agc2_cc : public gr_sync_block , public gri_agc2_cc -{ - gr_agc2_cc (float attack_rate, float decay_rate, float reference, - float gain, float max_gain); -}; diff --git a/gnuradio-core/src/lib/general/gr_agc2_ff.cc b/gnuradio-core/src/lib/general/gr_agc2_ff.cc deleted file mode 100644 index 792ee1c6be..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc2_ff.cc +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_agc2_ff.h> -#include <gr_io_signature.h> -#include <gri_agc2_ff.h> - -gr_agc2_ff_sptr -gr_make_agc2_ff (float attack_rate, float decay_rate, float reference, - float gain, float max_gain) -{ - return gnuradio::get_initial_sptr(new gr_agc2_ff (attack_rate, decay_rate, reference, - gain, max_gain)); -} - -gr_agc2_ff::gr_agc2_ff (float attack_rate, float decay_rate, float reference, - float gain, float max_gain) - : gr_sync_block ("gr_agc2_ff", - gr_make_io_signature (1, 1, sizeof (float)), - gr_make_io_signature (1, 1, sizeof (float))) - , gri_agc2_ff (attack_rate, decay_rate, reference, gain, max_gain) -{ -} - -int -gr_agc2_ff::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - float *out = (float *) output_items[0]; - scaleN (out, in, noutput_items); - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_agc2_ff.h b/gnuradio-core/src/lib/general/gr_agc2_ff.h deleted file mode 100644 index 48529948c0..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc2_ff.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_AGC2_FF_H -#define INCLUDED_GR_AGC2_FF_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gri_agc2_ff.h> -class gr_agc2_ff; -typedef boost::shared_ptr<gr_agc2_ff> gr_agc2_ff_sptr; - -GR_CORE_API gr_agc2_ff_sptr -gr_make_agc2_ff (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); -/*! - * \brief high performance Automatic Gain Control class - * - * \ingroup level_blk - * Power is approximated by absolute value - */ - -class GR_CORE_API gr_agc2_ff : public gr_sync_block, public gri_agc2_ff -{ - friend GR_CORE_API gr_agc2_ff_sptr gr_make_agc2_ff (float attack_rate, float decay_rate, - float reference, float gain, float max_gain); - gr_agc2_ff (float attack_rate, float decay_rate, float reference, float gain, float max_gain); - - public: - virtual int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_FLOAT_AGC2_FF_H */ diff --git a/gnuradio-core/src/lib/general/gr_agc2_ff.i b/gnuradio-core/src/lib/general/gr_agc2_ff.i deleted file mode 100644 index 646391aa7f..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc2_ff.i +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,agc2_ff) - -%include <gri_agc2_ff.i> - -gr_agc2_ff_sptr -gr_make_agc2_ff (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - -class gr_agc2_ff : public gr_sync_block , public gri_agc2_ff -{ - gr_agc2_ff (float attack_rate, float decay_rate, float reference, - float gain, float max_gain); -}; diff --git a/gnuradio-core/src/lib/general/gr_agc_cc.cc b/gnuradio-core/src/lib/general/gr_agc_cc.cc deleted file mode 100644 index e98f3a303f..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc_cc.cc +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_agc_cc.h> -#include <gr_io_signature.h> -#include <gri_agc_cc.h> - -gr_agc_cc_sptr -gr_make_agc_cc (float rate, float reference, - float gain, float max_gain) -{ - return gnuradio::get_initial_sptr(new gr_agc_cc (rate, reference, gain, max_gain)); -} - -gr_agc_cc::gr_agc_cc (float rate, float reference, - float gain, float max_gain) - : gr_sync_block ("gr_agc_cc", - gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (gr_complex))), - gri_agc_cc (rate, reference, gain, max_gain) -{ -} - -int -gr_agc_cc::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - scaleN (out, in, noutput_items); - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_agc_cc.h b/gnuradio-core/src/lib/general/gr_agc_cc.h deleted file mode 100644 index 9f35350dbd..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc_cc.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_AGC_CC_H -#define INCLUDED_GR_AGC_CC_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gri_agc_cc.h> -class gr_agc_cc; -typedef boost::shared_ptr<gr_agc_cc> gr_agc_cc_sptr; - -GR_CORE_API gr_agc_cc_sptr -gr_make_agc_cc (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); -/*! - * \brief high performance Automatic Gain Control class - * \ingroup level_blk - * - * For Power the absolute value of the complex number is used. - */ - -class GR_CORE_API gr_agc_cc : public gr_sync_block, public gri_agc_cc -{ - friend GR_CORE_API gr_agc_cc_sptr gr_make_agc_cc (float rate, float reference, - float gain, float max_gain); - gr_agc_cc (float rate, float reference, - float gain, float max_gain); - - public: - virtual int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_AGC_CC_H */ diff --git a/gnuradio-core/src/lib/general/gr_agc_cc.i b/gnuradio-core/src/lib/general/gr_agc_cc.i deleted file mode 100644 index f942713b08..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc_cc.i +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,agc_cc) - -%include <gri_agc_cc.i> - -gr_agc_cc_sptr -gr_make_agc_cc (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - -class gr_agc_cc : public gr_sync_block , public gri_agc_cc -{ - gr_agc_cc (float rate, float reference, - float gain, float max_gain); -}; diff --git a/gnuradio-core/src/lib/general/gr_agc_ff.cc b/gnuradio-core/src/lib/general/gr_agc_ff.cc deleted file mode 100644 index 6050dc7f0a..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc_ff.cc +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_agc_ff.h> -#include <gr_io_signature.h> -#include <gri_agc_ff.h> - -gr_agc_ff_sptr -gr_make_agc_ff (float rate, float reference, float gain, float max_gain) -{ - return gnuradio::get_initial_sptr(new gr_agc_ff (rate, reference, gain, max_gain)); -} - -gr_agc_ff::gr_agc_ff (float rate, float reference, float gain, float max_gain) - : gr_sync_block ("gr_agc_ff", - gr_make_io_signature (1, 1, sizeof (float)), - gr_make_io_signature (1, 1, sizeof (float))) - , gri_agc_ff (rate, reference, gain, max_gain) -{ -} - -int -gr_agc_ff::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - float *out = (float *) output_items[0]; - scaleN (out, in, noutput_items); - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_agc_ff.h b/gnuradio-core/src/lib/general/gr_agc_ff.h deleted file mode 100644 index dc618213bb..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc_ff.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_AGC_FF_H -#define INCLUDED_GR_AGC_FF_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gri_agc_ff.h> -class gr_agc_ff; -typedef boost::shared_ptr<gr_agc_ff> gr_agc_ff_sptr; - -GR_CORE_API gr_agc_ff_sptr -gr_make_agc_ff (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - -/*! - * \brief high performance Automatic Gain Control class - * \ingroup level_blk - * - * Power is approximated by absolute value - */ - -class GR_CORE_API gr_agc_ff : public gr_sync_block, public gri_agc_ff -{ - friend GR_CORE_API gr_agc_ff_sptr gr_make_agc_ff (float rate, float reference, - float gain, float max_gain); - gr_agc_ff (float rate, float reference, float gain, float max_gain); - - public: - virtual int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_FLOAT_AGC_FF_H */ diff --git a/gnuradio-core/src/lib/general/gr_agc_ff.i b/gnuradio-core/src/lib/general/gr_agc_ff.i deleted file mode 100644 index 03c571e1a4..0000000000 --- a/gnuradio-core/src/lib/general/gr_agc_ff.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,agc_ff) - -%include <gri_agc_ff.i> - -gr_agc_ff_sptr -gr_make_agc_ff (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - -class gr_agc_ff : public gr_sync_block , public gri_agc_ff -{ - gr_agc_ff (float rate, float reference, float gain, float max_gain); -}; diff --git a/gnuradio-core/src/lib/general/gr_cpfsk_bc.cc b/gnuradio-core/src/lib/general/gr_cpfsk_bc.cc deleted file mode 100644 index 24f0edd5cb..0000000000 --- a/gnuradio-core/src/lib/general/gr_cpfsk_bc.cc +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008,2010 Free Software Foundation, Inc. - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_cpfsk_bc.h> -#include <gr_io_signature.h> -#include <gr_expj.h> - -#define M_TWOPI (2*M_PI) - -gr_cpfsk_bc_sptr -gr_make_cpfsk_bc(float k, float ampl, int samples_per_sym) -{ - return gnuradio::get_initial_sptr(new gr_cpfsk_bc(k, ampl, samples_per_sym)); -} - -gr_cpfsk_bc::gr_cpfsk_bc(float k, float ampl, int samples_per_sym) - : gr_sync_interpolator("cpfsk_bc", - gr_make_io_signature(1, 1, sizeof(char)), - gr_make_io_signature(1, 1, sizeof(gr_complex)), - samples_per_sym) -{ - d_samples_per_sym = samples_per_sym; - d_freq = k*M_PI/samples_per_sym; - d_ampl = ampl; - d_phase = 0.0; -} - -gr_cpfsk_bc::~gr_cpfsk_bc() -{ -} - -int -gr_cpfsk_bc::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const char *in = (const char *)input_items[0]; - gr_complex *out = (gr_complex *)output_items[0]; - - for (int i = 0; i < noutput_items/d_samples_per_sym; i++) { - for (int j = 0; j < d_samples_per_sym; j++) { - if (in[i] == 1) - d_phase += d_freq; - else - d_phase -= d_freq; - - while (d_phase > M_TWOPI) - d_phase -= M_TWOPI; - while (d_phase < -M_TWOPI) - d_phase += M_TWOPI; - - *out++ = gr_expj(d_phase)*d_ampl; - } - } - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_cpfsk_bc.h b/gnuradio-core/src/lib/general/gr_cpfsk_bc.h deleted file mode 100644 index 6ad2774b3a..0000000000 --- a/gnuradio-core/src/lib/general/gr_cpfsk_bc.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008 Free Software Foundation, Inc. - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_GR_CPFSK_BC_H -#define INCLUDED_GR_CPFSK_BC_H - -#include <gr_core_api.h> -#include <gr_sync_interpolator.h> - -class gr_cpfsk_bc; - -typedef boost::shared_ptr<gr_cpfsk_bc> gr_cpfsk_bc_sptr; - -GR_CORE_API gr_cpfsk_bc_sptr gr_make_cpfsk_bc(float k, float ampl, int samples_per_sym); - -/*! - * \brief Perform continuous phase 2-level frequency shift keying modulation - * on an input stream of unpacked bits. - * \ingroup modulation_blk - * - * \param k modulation index - * \param ampl output amplitude - * \param samples_per_sym number of output samples per input bit - */ - -class GR_CORE_API gr_cpfsk_bc : public gr_sync_interpolator -{ -private: - friend GR_CORE_API gr_cpfsk_bc_sptr gr_make_cpfsk_bc(float k, float ampl, int samples_per_sym); - - gr_cpfsk_bc(float k, float ampl, int samples_per_sym); - - int d_samples_per_sym; // Samples per symbol, square pulse - float d_freq; // Modulation index*pi/samples_per_sym - float d_ampl; // Output amplitude - float d_phase; // Current phase - - public: - ~gr_cpfsk_bc(); - - void set_amplitude(float amplitude) { d_ampl = amplitude; } - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_CPFSK_BC_H */ diff --git a/gnuradio-core/src/lib/general/gr_cpfsk_bc.i b/gnuradio-core/src/lib/general/gr_cpfsk_bc.i deleted file mode 100644 index b86dfb81bd..0000000000 --- a/gnuradio-core/src/lib/general/gr_cpfsk_bc.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,cpfsk_bc); - -gr_cpfsk_bc_sptr gr_make_cpfsk_bc(float k, float ampl, int samples_per_sym); - -class gr_cpfsk_bc : public gr_sync_interpolator -{ -private: - gr_cpfsk_bc(float k, float ampl, int samples_per_sym); - -public: - void set_amplitude(float amplitude); -}; diff --git a/gnuradio-core/src/lib/general/gr_cpm.cc b/gnuradio-core/src/lib/general/gr_cpm.cc deleted file mode 100644 index 32ce6502dd..0000000000 --- a/gnuradio-core/src/lib/general/gr_cpm.cc +++ /dev/null @@ -1,218 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2010 Free Software Foundation, Inc. - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// Calculate the taps for the CPM phase responses - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <cmath> -#include <cfloat> -#include <gr_cpm.h> - -//gives us erf on compilers without it -#include <boost/math/special_functions/erf.hpp> -namespace bm = boost::math; - -#ifndef M_TWOPI -# define M_TWOPI (2*M_PI) -#endif - -//! Normalised sinc function, sinc(x)=sin(pi*x)/pi*x -inline double -sinc(double x) -{ - if (x == 0) { - return 1.0; - } - - return sin(M_PI * x) / (M_PI * x); -} - - -//! Taps for L-RC CPM (Raised cosine of length L symbols) -std::vector<float> -generate_cpm_lrc_taps(unsigned samples_per_sym, unsigned L) -{ - std::vector<float> taps(samples_per_sym * L, 1.0/L/samples_per_sym); - for (unsigned i = 0; i < samples_per_sym * L; i++) { - taps[i] *= 1 - cos(M_TWOPI * i / L / samples_per_sym); - } - - return taps; -} - - -/*! Taps for L-SRC CPM (Spectral raised cosine of length L symbols). - * - * L-SRC has a time-continuous phase response function of - * - * g(t) = 1/LT * sinc(2t/LT) * cos(beta * 2pi t / LT) / (1 - (4beta / LT * t)^2) - * - * which is the Fourier transform of a cos-rolloff function with rolloff - * beta, and looks like a sinc-function, multiplied with a rolloff term. - * We return the main lobe of the sinc, i.e., everything between the - * zero crossings. - * The time-discrete IR is thus - * - * g(k) = 1/Ls * sinc(2k/Ls) * cos(beta * pi k / Ls) / (1 - (4beta / Ls * k)^2) - * where k = 0...Ls-1 - * and s = samples per symbol. - */ -std::vector<float> -generate_cpm_lsrc_taps(unsigned samples_per_sym, unsigned L, double beta) -{ - double Ls = (double) L * samples_per_sym; - std::vector<double> taps_d(L * samples_per_sym, 0.0); - std::vector<float> taps(L * samples_per_sym, 0.0); - - double sum = 0; - for (unsigned i = 0; i < samples_per_sym * L; i++) { - double k = i - Ls/2; // Causal to acausal - - taps_d[i] = 1.0 / Ls * sinc(2.0 * k / Ls); - - // For k = +/-Ls/4*beta, the rolloff term's cos-function becomes zero - // and the whole thing converges to PI/4 (to prove this, use de - // l'hopital's rule). - if (fabs(fabs(k) - Ls/4/beta) < 2*DBL_EPSILON) { - taps_d[i] *= M_PI_4; - } else { - double tmp = 4.0 * beta * k / Ls; - taps_d[i] *= cos(beta * M_TWOPI * k / Ls) / (1 - tmp * tmp); - } - sum += taps_d[i]; - } - for (unsigned i = 0; i < samples_per_sym * L; i++) { - taps[i] = (float) taps_d[i] / sum; - } - - return taps; -} - - -//! Taps for L-REC CPM (Rectangular pulse shape of length L symbols) -std::vector<float> -generate_cpm_lrec_taps(unsigned samples_per_sym, unsigned L) -{ - return std::vector<float>(samples_per_sym * L, 1.0/L/samples_per_sym); -} - - -//! Helper function for TFM -double tfm_g0(double k, double sps) -{ - if (fabs(k) < 2 * DBL_EPSILON) { - return 1.145393004159143; // 1 + pi^2/48 / sqrt(2) - } - - const double pi2_24 = 0.411233516712057; // pi^2/24 - double f = M_PI * k / sps; - return sinc(k/sps) - pi2_24 * (2 * sin(f) - 2*f*cos(f) - f*f*sin(f)) / (f*f*f); -} - - -//! Taps for TFM CPM (Tamed frequency modulation) -// -// See [2, Chapter 2.7.2]. -// -// [2]: Anderson, Aulin and Sundberg; Digital Phase Modulation -std::vector<float> -generate_cpm_tfm_taps(unsigned sps, unsigned L) -{ - unsigned causal_shift = sps * L / 2; - std::vector<double> taps_d(sps * L, 0.0); - std::vector<float> taps(sps * L, 0.0); - - double sum = 0; - for (unsigned i = 0; i < sps * L; i++) { - double k = (double)(((int)i) - ((int)causal_shift)); // Causal to acausal - - taps_d[i] = tfm_g0(k - sps, sps) + - 2 * tfm_g0(k, sps) + - tfm_g0(k + sps, sps); - sum += taps_d[i]; - } - for (unsigned i = 0; i < sps * L; i++) { - taps[i] = (float) taps_d[i] / sum; - } - - return taps; -} - - -//! Taps for Gaussian CPM. Phase response is truncated after \p L symbols. -// \p bt sets the 3dB-time-bandwidth product. -// -// Note: for h = 0.5, this is the phase response for GMSK. -// -// This C99-compatible formula for the taps is taken straight -// from [1, Chapter 9.2.3]. -// A version in Q-notation can be found in [2, Chapter 2.7.2]. -// -// [1]: Karl-Dirk Kammeyer; Nachrichtenübertragung, 4th Edition. -// [2]: Anderson, Aulin and Sundberg; Digital Phase Modulation -// -std::vector<float> -generate_cpm_gaussian_taps(unsigned samples_per_sym, unsigned L, double bt) -{ - double Ls = (double) L * samples_per_sym; - std::vector<double> taps_d(L * samples_per_sym, 0.0); - std::vector<float> taps(L * samples_per_sym, 0.0); - - // alpha = sqrt(2/ln(2)) * pi * BT - double alpha = 5.336446256636997 * bt; - for (unsigned i = 0; i < samples_per_sym * L; i++) { - double k = i - Ls/2; // Causal to acausal - taps_d[i] = (bm::erf(alpha * (k / samples_per_sym + 0.5)) - - bm::erf(alpha * (k / samples_per_sym - 0.5))) - * 0.5 / samples_per_sym; - taps[i] = (float) taps_d[i]; - } - - return taps; -} - - -std::vector<float> -gr_cpm::phase_response(cpm_type type, unsigned samples_per_sym, unsigned L, double beta) -{ - switch (type) { - case LRC: - return generate_cpm_lrc_taps(samples_per_sym, L); - - case LSRC: - return generate_cpm_lsrc_taps(samples_per_sym, L, beta); - - case LREC: - return generate_cpm_lrec_taps(samples_per_sym, L); - - case TFM: - return generate_cpm_tfm_taps(samples_per_sym, L); - - case GAUSSIAN: - return generate_cpm_gaussian_taps(samples_per_sym, L, beta); - - default: - return generate_cpm_lrec_taps(samples_per_sym, 1); - } -} - diff --git a/gnuradio-core/src/lib/general/gr_cpm.h b/gnuradio-core/src/lib/general/gr_cpm.h deleted file mode 100644 index ef2ff84142..0000000000 --- a/gnuradio-core/src/lib/general/gr_cpm.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2010 Free Software Foundation, Inc. - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - - -#ifndef INCLUDED_GR_CPM_H -#define INCLUDED_GR_CPM_H - -#include <gr_core_api.h> -#include <vector> - -class GR_CORE_API gr_cpm -{ - public: - enum cpm_type { - LRC, - LSRC, - LREC, - TFM, - GAUSSIAN, - GENERIC = 999 - }; - - /*! \brief Return the taps for an interpolating FIR filter (gr_interp_fir_filter_fff). - * - * These taps represent the phase response \f$g(k)\f$ for use in a CPM modulator, - * see also gr_cpmmod_bc. - * - * \param type The CPM type (Rectangular, Raised Cosine, Spectral Raised Cosine, - * Tamed FM or Gaussian). - * \param samples_per_sym Samples per symbol. - * \param L The length of the phase response in symbols. - * \param beta For Spectral Raised Cosine, this is the rolloff factor. For Gaussian - * phase responses, this the 3dB-time-bandwidth product. For all other - * cases, it is ignored. - * - * Output: returns a vector of length \a K = \p samples_per_sym x \p L. - * This can be used directly in an interpolating FIR filter such as - * gr_interp_fir_filter_fff with interpolation factor \p samples_per_sym. - * - * All phase responses are normalised s.t. \f$ \sum_{k=0}^{K-1} g(k) = 1\f$; this will cause - * a maximum phase change of \f$ h \cdot \pi\f$ between two symbols, where \a h is the - * modulation index. - * - * The following phase responses can be generated: - * - LREC: Rectangular phase response. - * - LRC: Raised cosine phase response, looks like 1 - cos(x). - * - LSRC: Spectral raised cosine. This requires a rolloff factor beta. - * The phase response is the Fourier transform of raised cosine - * function. - * - TFM: Tamed frequency modulation. This scheme minimizes phase change for - * rapidly varying input symbols. - * - GAUSSIAN: A Gaussian phase response. For a modulation index h = 1/2, this - * results in GMSK. - * - * A short description of all these phase responses can be found in [1]. - * - * [1]: Anderson, Aulin and Sundberg; Digital Phase Modulation - */ - static std::vector<float> - phase_response(cpm_type type, unsigned samples_per_sym, unsigned L, double beta=0.3); -}; - -#endif /* INCLUDED_GR_CPM_H */ - diff --git a/gnuradio-core/src/lib/general/gr_cpm.i b/gnuradio-core/src/lib/general/gr_cpm.i deleted file mode 100644 index 6c077687d5..0000000000 --- a/gnuradio-core/src/lib/general/gr_cpm.i +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- C++ -*- */ -/* - * Copyright 2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -%rename(cpm) gr_cpm; - -class gr_cpm -{ - public: - enum cpm_type { - LRC, - LSRC, - LREC, - TFM, - GAUSSIAN, - GENERIC = 999 - }; - - static std::vector<float> - phase_response(cpm_type type, unsigned samples_per_sym, unsigned L, double beta=0.3); -}; - diff --git a/gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.cc b/gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.cc deleted file mode 100644 index d31763a6bf..0000000000 --- a/gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.cc +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_ctcss_squelch_ff.h> - -static float ctcss_tones[] = { - 67.0, 71.9, 74.4, 77.0, 79.7, 82.5, 85.4, 88.5, 91.5, 94.8, - 97.4, 100.0, 103.5, 107.2, 110.9, 114.8, 118.8, 123.0, 127.3, 131.8, - 136.5, 141.3, 146.2, 151.4, 156.7, 162.2, 167.9, 173.8, 179.9, 186.2, - 192.8, 203.5, 210.7, 218.1, 225.7, 233.6, 241.8, 250.3 -}; - -static int max_tone_index = 37; - -gr_ctcss_squelch_ff_sptr -gr_make_ctcss_squelch_ff(int rate, float freq, float level, int len, int ramp, bool gate) -{ - return gnuradio::get_initial_sptr(new gr_ctcss_squelch_ff(rate, freq, level, len, ramp, gate)); -} - -int gr_ctcss_squelch_ff::find_tone(float freq) -{ - for (int i = 0; i <= max_tone_index; i++) - if (ctcss_tones[i] == freq) // FIXME: make almost equal - return i; - - return -1; -} - -gr_ctcss_squelch_ff::gr_ctcss_squelch_ff(int rate, float freq, float level, int len, int ramp, bool gate) : - gr_squelch_base_ff("ctcss_squelch_ff", ramp, gate) -{ - d_freq = freq; - d_level = level; - - // Default is 100 ms detection time - if (len == 0) - d_len = (int)(rate/10.0); - else - d_len = len; - - int i = find_tone(freq); - - // Non-standard tones or edge tones get 2% guard band, otherwise - // guards are set at adjacent ctcss tone frequencies - float f_l, f_r; - if (i == -1 || i == 0) - f_l = freq*0.98; - else - f_l = ctcss_tones[i-1]; - - if (i == -1 || i == max_tone_index) - f_r = freq*1.02; - else - f_r = ctcss_tones[i+1]; - - d_goertzel_l = gri_goertzel(rate, d_len, f_l); - d_goertzel_c = gri_goertzel(rate, d_len, freq); - d_goertzel_r = gri_goertzel(rate, d_len, f_r); - - d_mute = true; -} - -std::vector<float> gr_ctcss_squelch_ff::squelch_range() const -{ - std::vector<float> r(3); - r[0] = 0.0; - r[1] = 1.0; - r[2] = (r[1]-r[0])/100; // step size - - return r; -} - -void gr_ctcss_squelch_ff::update_state(const float &in) -{ - d_goertzel_l.input(in); - d_goertzel_c.input(in); - d_goertzel_r.input(in); - - float d_out_l, d_out_c, d_out_r; - if (d_goertzel_c.ready()) { - d_out_l = abs(d_goertzel_l.output()); - d_out_c = abs(d_goertzel_c.output()); - d_out_r = abs(d_goertzel_r.output()); - - //printf("d_out_l=%f d_out_c=%f d_out_r=%f\n", d_out_l, d_out_c, d_out_r); - d_mute = (d_out_c < d_level || d_out_c < d_out_l || d_out_c < d_out_r); - } -} diff --git a/gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.h b/gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.h deleted file mode 100644 index ef3d13ba7b..0000000000 --- a/gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_CTCSS_SQUELCH_FF_H -#define INCLUDED_GR_CTCSS_SQUELCH_FF_H - -#include <gr_core_api.h> -#include <gr_squelch_base_ff.h> -#include <gri_goertzel.h> - -class gr_ctcss_squelch_ff; -typedef boost::shared_ptr<gr_ctcss_squelch_ff> gr_ctcss_squelch_ff_sptr; - -GR_CORE_API gr_ctcss_squelch_ff_sptr -gr_make_ctcss_squelch_ff(int rate, float freq, float level=0.01, int len=0, int ramp=0, bool gate=false); - -/*! - * \brief gate or zero output if ctcss tone not present - * \ingroup level_blk - */ -class GR_CORE_API gr_ctcss_squelch_ff : public gr_squelch_base_ff -{ -private: - float d_freq; - float d_level; - int d_len; - bool d_mute; - - gri_goertzel d_goertzel_l; - gri_goertzel d_goertzel_c; - gri_goertzel d_goertzel_r; - - friend GR_CORE_API gr_ctcss_squelch_ff_sptr gr_make_ctcss_squelch_ff(int rate, float freq, float level, int len, int ramp, bool gate); - gr_ctcss_squelch_ff(int rate, float freq, float level, int len, int ramp, bool gate); - - int find_tone(float freq); - -protected: - virtual void update_state(const float &in); - virtual bool mute() const { return d_mute; } - -public: - std::vector<float> squelch_range() const; - float level() const { return d_level; } - void set_level(float level) { d_level = level; } - int len() const { return d_len; } -}; - -#endif /* INCLUDED_GR_CTCSS_SQUELCH_FF_H */ diff --git a/gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.i b/gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.i deleted file mode 100644 index b160c5dfd7..0000000000 --- a/gnuradio-core/src/lib/general/gr_ctcss_squelch_ff.i +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,ctcss_squelch_ff); - -%include gr_squelch_base_ff.i - -gr_ctcss_squelch_ff_sptr -gr_make_ctcss_squelch_ff(int rate, float freq, float level=0.01, int len=0, int ramp=0, bool gate=false); - -class gr_ctcss_squelch_ff : public gr_squelch_base_ff -{ - gr_ctcss_squelch_ff(int rate, float freq, float level, int len, int ramp, bool gate); - -public: - std::vector<float> squelch_range() const; - float level() const { return d_level; } - void set_level(float level) { d_level = level; } - int len() const { return d_len; } -}; diff --git a/gnuradio-core/src/lib/general/gr_dpll_bb.cc b/gnuradio-core/src/lib/general/gr_dpll_bb.cc deleted file mode 100644 index 1d5a0d4fda..0000000000 --- a/gnuradio-core/src/lib/general/gr_dpll_bb.cc +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007,2009,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_dpll_bb.h> -#include <gr_io_signature.h> -#include <cstdio> - -gr_dpll_bb_sptr -gr_make_dpll_bb (float period, float gain) -{ - return gnuradio::get_initial_sptr(new gr_dpll_bb (period, gain)); -} - -gr_dpll_bb::gr_dpll_bb (float period, float gain) - : gr_sync_block ("dpll_bb", - gr_make_io_signature (1, 1, sizeof (char)), - gr_make_io_signature (1, 1, sizeof (char))), - d_restart(0),d_pulse_phase(0) -{ - d_pulse_frequency = 1.0/period; - d_gain = gain; - d_decision_threshold = 1.0 - 0.5*d_pulse_frequency; -#if 1 - fprintf(stderr,"frequency = %f period = %f gain = %f threshold = %f\n", - d_pulse_frequency, - period, - d_gain, - d_decision_threshold); -#endif -} - -int -gr_dpll_bb::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const char *iptr = (const char *) input_items[0]; - char *optr = (char *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - optr[i]= 0; - if(iptr[i] == 1) { - if (d_restart == 0) { - d_pulse_phase = 1; - } else { - if (d_pulse_phase > 0.5) d_pulse_phase += d_gain*(1.0-d_pulse_phase); - else d_pulse_phase -= d_gain*d_pulse_phase; - } - d_restart = 3; - } - if (d_pulse_phase > d_decision_threshold) { - d_pulse_phase -= 1.0; - if (d_restart > 0) { - d_restart -= 1; - optr[i] = 1; - } - } - d_pulse_phase += d_pulse_frequency; - } - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_dpll_bb.h b/gnuradio-core/src/lib/general/gr_dpll_bb.h deleted file mode 100644 index a7df974fb4..0000000000 --- a/gnuradio-core/src/lib/general/gr_dpll_bb.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2007 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_DPLL_BB_H -#define INCLUDED_GR_DPLL_BB_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> - -class gr_dpll_bb; -typedef boost::shared_ptr<gr_dpll_bb> gr_dpll_bb_sptr; - -GR_CORE_API gr_dpll_bb_sptr gr_make_dpll_bb (float period, float gain); - -/*! - * \brief Detect the peak of a signal - * \ingroup level_blk - * - * If a peak is detected, this block outputs a 1, - * or it outputs 0's. - */ -class GR_CORE_API gr_dpll_bb : public gr_sync_block -{ - friend GR_CORE_API gr_dpll_bb_sptr gr_make_dpll_bb (float period, float gain); - - gr_dpll_bb (float period, float gain); - - private: - unsigned char d_restart; - float d_pulse_phase, d_pulse_frequency,d_gain,d_decision_threshold; - - public: - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif diff --git a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc b/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc deleted file mode 100644 index 147b64e9bf..0000000000 --- a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.cc +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_feedforward_agc_cc.h> -#include <gr_io_signature.h> -#include <stdexcept> - -gr_feedforward_agc_cc_sptr -gr_make_feedforward_agc_cc(int nsamples, float reference) -{ - return gnuradio::get_initial_sptr(new gr_feedforward_agc_cc (nsamples, reference)); -} - -gr_feedforward_agc_cc::gr_feedforward_agc_cc (int nsamples, float reference) - : gr_sync_block ("gr_feedforward_agc_cc", - gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (gr_complex))), - d_nsamples(nsamples), d_reference(reference) -{ - if (nsamples < 1) - throw std::invalid_argument("gr_feedforward_agc_cc: nsamples must be >= 1"); - - set_history(nsamples); -} - -gr_feedforward_agc_cc::~gr_feedforward_agc_cc() -{ -} - -inline static float -mag_squared(gr_complex x) -{ - return x.real() * x.real() + x.imag() * x.imag(); -} - -// approximate sqrt(x^2 + y^2) -inline static float -envelope(gr_complex x) -{ - float r_abs = std::fabs(x.real()); - float i_abs = std::fabs(x.imag()); - - if (r_abs > i_abs) - return r_abs + 0.4 * i_abs; - else - return i_abs + 0.4 * r_abs; -} - -int -gr_feedforward_agc_cc::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - int nsamples = d_nsamples; - float gain; - - for (int i = 0; i < noutput_items; i++){ - //float max_env = 1e-12; // avoid divide by zero - float max_env = 1e-4; // avoid divide by zero, indirectly set max gain - for (int j = 0; j < nsamples; j++) - max_env = std::max(max_env, envelope(in[i+j])); - gain = d_reference / max_env; - out[i] = gain * in[i]; - } - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.h b/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.h deleted file mode 100644 index 63e5e4c436..0000000000 --- a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_FEEDFORWARD_AGC_CC_H -#define INCLUDED_GR_FEEDFORWARD_AGC_CC_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> - -class gr_feedforward_agc_cc; -typedef boost::shared_ptr<gr_feedforward_agc_cc> gr_feedforward_agc_cc_sptr; - -GR_CORE_API gr_feedforward_agc_cc_sptr -gr_make_feedforward_agc_cc(int nsamples, float reference = 1.0); - -/*! - * \brief Non-causal AGC which computes required gain based on max absolute value over nsamples - * \ingroup level_blk - */ -class GR_CORE_API gr_feedforward_agc_cc : public gr_sync_block -{ - friend GR_CORE_API gr_feedforward_agc_cc_sptr - gr_make_feedforward_agc_cc(int nsamples, float reference); - - int d_nsamples; - float d_reference; - - gr_feedforward_agc_cc(int nsamples, float reference); - - public: - ~gr_feedforward_agc_cc(); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_FEEDFORWARD_AGC_CC_H */ diff --git a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.i b/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.i deleted file mode 100644 index 1fd5a2c26d..0000000000 --- a/gnuradio-core/src/lib/general/gr_feedforward_agc_cc.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,feedforward_agc_cc); - -gr_feedforward_agc_cc_sptr -gr_make_feedforward_agc_cc(int nsamples, float reference = 1.0); - -class gr_feedforward_agc_cc : public gr_sync_block -{ - gr_feedforward_agc_cc(int nsamples, float reference); - - public: - ~gr_feedforward_agc_cc(); -}; diff --git a/gnuradio-core/src/lib/general/gr_fmdet_cf.cc b/gnuradio-core/src/lib/general/gr_fmdet_cf.cc deleted file mode 100644 index f020362920..0000000000 --- a/gnuradio-core/src/lib/general/gr_fmdet_cf.cc +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_fmdet_cf.h> -#include <gr_io_signature.h> -#include <math.h> -#include <gr_math.h> - -#define M_TWOPI (2*M_PI) - -gr_fmdet_cf_sptr -gr_make_fmdet_cf (float samplerate, float freq_low, float freq_high, float scl) -{ - return gnuradio::get_initial_sptr(new gr_fmdet_cf (samplerate, freq_low, freq_high, scl)); -} - -gr_fmdet_cf::gr_fmdet_cf (float samplerate, float freq_low, float freq_high, float scl) - : gr_sync_block ("fmdet_cf", - gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (float))), - d_S1(0.1),d_S2(0.1), - d_S3(0.1),d_S4(0.1) -{ - const float h[]={0.003118678733, -0.012139843428, 0.027270898036, -0.051318579352, - 0.090406910552, -0.162926865366, 0.361885392563, 0.000000000000, - -0.361885392563, 0.162926865366, -0.090406910552, 0.051318579352, - -0.027270898036, 0.012139843428, -0.003118678733}; - - - - - float delta; - std::vector<float> taps(15); - - d_freqhi = freq_high; - d_freqlo = freq_low; - delta = (d_freqhi - d_freqlo); - d_scl = scl; - d_bias = 0.5*scl*(d_freqhi+d_freqlo)/delta; - for (int i=0;i<15;i++) taps[i] = h[i]; - // d_filter = gr_fir_util::create_gr_fir_ccf(taps); - -} - -int -gr_fmdet_cf::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *iptr = (gr_complex *) input_items[0]; - float *optr = (float *) output_items[0]; - // const gr_complex *scaleiptr = (gr_complex *) input_items[0]; - - int size = noutput_items; - - gr_complex Sdot,S0,S1=d_S1,S2=d_S2,S3=d_S3,S4=d_S4; - float d_8 = 8.0; - - while (size-- > 0) { - S0=*iptr++; - - - Sdot = d_scl * (-S0+d_8*S1-d_8*S1+S4); - - d_freq = (S2.real()*Sdot.imag()-S2.imag()*Sdot.real())/ - (S2.real()*S2.real()+S2.imag()*S2.imag()); - - S4=S3; - S3=S2; - S2=S1; - S1=S0; - - - *optr++ = d_freq-d_bias; - } - d_S1=S1; - d_S2=S2; - d_S3=S3; - d_S4=S4; - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_fmdet_cf.h b/gnuradio-core/src/lib/general/gr_fmdet_cf.h deleted file mode 100644 index f85630f2fb..0000000000 --- a/gnuradio-core/src/lib/general/gr_fmdet_cf.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_FMDET_CF_H -#define INCLUDED_GR_FMDET_CF_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> - -class gr_fmdet_cf; -typedef boost::shared_ptr<gr_fmdet_cf> gr_fmdet_cf_sptr; - -GR_CORE_API gr_fmdet_cf_sptr gr_make_fmdet_cf (float samplerate, float freq_low, float freq_high, float scl); - -class gr_fir_ccf; - - -/*! - * \brief Implements an IQ slope detector - * - * - * input: stream of complex; output: stream of floats - * - * This implements a limiting slope detector. The limiter is in the - * normalization by the magnitude of the sample - */ - -class GR_CORE_API gr_fmdet_cf : public gr_sync_block -{ - friend GR_CORE_API gr_fmdet_cf_sptr gr_make_fmdet_cf (float samplerate, float freq_low, - float freq_high, float scl); - - gr_complex d_S1,d_S2,d_S3,d_S4; - float d_freq,d_freqlo,d_freqhi,d_scl,d_bias; - gr_fir_ccf* d_filter; - gr_fmdet_cf (float samplerate, float freq_low, float freq_high, float scl); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - -}; - -#endif diff --git a/gnuradio-core/src/lib/general/gr_fmdet_cf.i b/gnuradio-core/src/lib/general/gr_fmdet_cf.i deleted file mode 100644 index 2db596b7a9..0000000000 --- a/gnuradio-core/src/lib/general/gr_fmdet_cf.i +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,fmdet_cf) - -gr_fmdet_cf_sptr gr_make_fmdet_cf (float samplerate, float freq_low, float freq_high, float scl); - -class gr_fmdet_cf : public gr_sync_block -{ - private: - gr_fmdet_cf (float samplerate, float freq_low, float freq_high, float scl); -}; diff --git a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc deleted file mode 100644 index 5c4daec583..0000000000 --- a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010,2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_frequency_modulator_fc.h> -#include <gr_io_signature.h> -#include <gr_fxpt.h> -#include <math.h> -#include <boost/math/special_functions/trunc.hpp> - - -gr_frequency_modulator_fc_sptr gr_make_frequency_modulator_fc (double sensitivity) -{ - return gnuradio::get_initial_sptr(new gr_frequency_modulator_fc (sensitivity)); -} - -gr_frequency_modulator_fc::gr_frequency_modulator_fc (double sensitivity) - : gr_sync_block ("frequency_modulator_fc", - gr_make_io_signature (1, 1, sizeof (float)), - gr_make_io_signature (1, 1, sizeof (gr_complex))), - d_sensitivity (sensitivity), d_phase (0) -{ -} - -int -gr_frequency_modulator_fc::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - d_phase = d_phase + d_sensitivity * in[i]; - - while (d_phase > (float)(M_PI)) - d_phase -= (float)(2.0 * M_PI); - while (d_phase < (float)(-M_PI)) - d_phase += (float)(2.0 * M_PI); - - float oi, oq; - - gr_int32 angle = gr_fxpt::float_to_fixed (d_phase); - gr_fxpt::sincos (angle, &oq, &oi); - out[i] = gr_complex (oi, oq); - } - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.h b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.h deleted file mode 100644 index c680e96480..0000000000 --- a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_FREQUENCY_MODULATOR_FC_H -#define INCLUDED_GR_FREQUENCY_MODULATOR_FC_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> - -class gr_frequency_modulator_fc; -typedef boost::shared_ptr<gr_frequency_modulator_fc> gr_frequency_modulator_fc_sptr; - -GR_CORE_API gr_frequency_modulator_fc_sptr gr_make_frequency_modulator_fc (double sensitivity); - -/*! - * \brief Frequency modulator block - * \ingroup modulation_blk - * - * float input; complex baseband output - */ -class GR_CORE_API gr_frequency_modulator_fc : public gr_sync_block -{ - float d_sensitivity; - float d_phase; - - friend GR_CORE_API gr_frequency_modulator_fc_sptr - gr_make_frequency_modulator_fc (double sensitivity); - - gr_frequency_modulator_fc (double sensitivity); - - public: - void set_sensitivity(float sens) { d_sensitivity = sens; } - float sensitivity() const { return d_sensitivity; } - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_FREQUENCY_MODULATOR_FC_H */ diff --git a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.i b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.i deleted file mode 100644 index 9a740583b0..0000000000 --- a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,frequency_modulator_fc) - -gr_frequency_modulator_fc_sptr gr_make_frequency_modulator_fc (double sensitivity); - -class gr_frequency_modulator_fc : public gr_sync_block -{ - private: - gr_frequency_modulator_fc (double sensitivity); -public: - void set_sensitivity(float sens) { d_sensitivity = sens; } - float sensitivity() const { return d_sensitivity; } -}; diff --git a/gnuradio-core/src/lib/general/gr_phase_modulator_fc.cc b/gnuradio-core/src/lib/general/gr_phase_modulator_fc.cc deleted file mode 100644 index fb05c85a52..0000000000 --- a/gnuradio-core/src/lib/general/gr_phase_modulator_fc.cc +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_phase_modulator_fc.h> -#include <gr_io_signature.h> -#include <gr_sincos.h> -#include <math.h> - - -gr_phase_modulator_fc_sptr gr_make_phase_modulator_fc (double sensitivity) -{ - return gnuradio::get_initial_sptr(new gr_phase_modulator_fc (sensitivity)); -} - -gr_phase_modulator_fc::gr_phase_modulator_fc (double sensitivity) - : gr_sync_block ("phase_modulator_fc", - gr_make_io_signature (1, 1, sizeof (float)), - gr_make_io_signature (1, 1, sizeof (gr_complex))), - d_sensitivity (sensitivity), d_phase (0) -{ -} - -int -gr_phase_modulator_fc::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - d_phase = d_sensitivity * in[i]; - float oi, oq; - gr_sincosf (d_phase, &oq, &oi); - out[i] = gr_complex (oi, oq); - } - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_phase_modulator_fc.h b/gnuradio-core/src/lib/general/gr_phase_modulator_fc.h deleted file mode 100644 index 07f3b82d4c..0000000000 --- a/gnuradio-core/src/lib/general/gr_phase_modulator_fc.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_PHASE_MODULATOR_FC_H -#define INCLUDED_GR_PHASE_MODULATOR_FC_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> - -class gr_phase_modulator_fc; -typedef boost::shared_ptr<gr_phase_modulator_fc> gr_phase_modulator_fc_sptr; - -GR_CORE_API gr_phase_modulator_fc_sptr gr_make_phase_modulator_fc (double sensitivity); - -/*! - * \brief Phase modulator block - * \ingroup modulation_blk - * output=complex(cos(in*sensitivity),sin(in*sensitivity)) - */ -class GR_CORE_API gr_phase_modulator_fc : public gr_sync_block -{ - double d_sensitivity; - double d_phase; - - friend GR_CORE_API gr_phase_modulator_fc_sptr - gr_make_phase_modulator_fc (double sensitivity); - - gr_phase_modulator_fc (double sensitivity); - - public: - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_PHASE_MODULATOR_FC_H */ diff --git a/gnuradio-core/src/lib/general/gr_phase_modulator_fc.i b/gnuradio-core/src/lib/general/gr_phase_modulator_fc.i deleted file mode 100644 index c1816c647e..0000000000 --- a/gnuradio-core/src/lib/general/gr_phase_modulator_fc.i +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,phase_modulator_fc) - -gr_phase_modulator_fc_sptr gr_make_phase_modulator_fc (double sensitivity); - -class gr_phase_modulator_fc : public gr_sync_block -{ - private: - gr_phase_modulator_fc (double sensitivity); -}; diff --git a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc b/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc deleted file mode 100644 index b7b1291a3d..0000000000 --- a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2010,2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_pll_carriertracking_cc.h> -#include <gr_io_signature.h> -#include <gr_sincos.h> -#include <math.h> -#include <gr_math.h> - -#ifndef M_TWOPI -#define M_TWOPI (2.0f*M_PI) -#endif - -gr_pll_carriertracking_cc_sptr -gr_make_pll_carriertracking_cc (float loop_bw, float max_freq, float min_freq) -{ - return gnuradio::get_initial_sptr(new gr_pll_carriertracking_cc (loop_bw, max_freq, min_freq)); -} - -gr_pll_carriertracking_cc::gr_pll_carriertracking_cc (float loop_bw, - float max_freq, - float min_freq) - : gr_sync_block ("pll_carriertracking_cc", - gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (gr_complex))), - gri_control_loop(loop_bw, max_freq, min_freq), - d_locksig(0), d_lock_threshold(0), d_squelch_enable(false) -{ -} - -float -gr_pll_carriertracking_cc::mod_2pi (float in) -{ - if(in>M_PI) - return in-M_TWOPI; - else if(in<-M_PI) - return in+M_TWOPI; - else - return in; -} - -float -gr_pll_carriertracking_cc::phase_detector(gr_complex sample,float ref_phase) -{ - float sample_phase; - // sample_phase = atan2(sample.imag(),sample.real()); - sample_phase = gr_fast_atan2f(sample.imag(),sample.real()); - return mod_2pi(sample_phase-ref_phase); -} - -bool -gr_pll_carriertracking_cc::lock_detector(void) -{ - return (fabsf(d_locksig) > d_lock_threshold); -} - -bool -gr_pll_carriertracking_cc::squelch_enable(bool set_squelch) -{ - return d_squelch_enable = set_squelch; -} - -float -gr_pll_carriertracking_cc::set_lock_threshold(float threshold) -{ - return d_lock_threshold = threshold; -} - -int -gr_pll_carriertracking_cc::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *iptr = (gr_complex *) input_items[0]; - gr_complex *optr = (gr_complex *) output_items[0]; - - float error; - float t_imag, t_real; - - for (int i = 0; i < noutput_items; i++){ - gr_sincosf(d_phase, &t_imag, &t_real); - optr[i] = iptr[i] * gr_complex(t_real, -t_imag); - - error = phase_detector(iptr[i],d_phase); - - advance_loop(error); - phase_wrap(); - frequency_limit(); - - d_locksig = d_locksig * (1.0 - d_alpha) + \ - d_alpha*(iptr[i].real() * t_real + iptr[i].imag() * t_imag); - - if ((d_squelch_enable) && !lock_detector()) - optr[i] = 0; - } - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.h b/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.h deleted file mode 100644 index b3bc5ddd0c..0000000000 --- a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2006,2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_PLL_CARRIERTRACKING_CC_H -#define INCLUDED_GR_PLL_CARRIERTRACKING_CC_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gri_control_loop.h> - -class gr_pll_carriertracking_cc; -typedef boost::shared_ptr<gr_pll_carriertracking_cc> gr_pll_carriertracking_cc_sptr; - -GR_CORE_API gr_pll_carriertracking_cc_sptr gr_make_pll_carriertracking_cc (float loop_bw, - float max_freq, - float min_freq); -/*! - * \brief Implements a PLL which locks to the input frequency and outputs the - * input signal mixed with that carrier. - * \ingroup sync_blk - * - * input: stream of complex; output: stream of complex - * - * This PLL locks onto a [possibly noisy] reference carrier on - * the input and outputs that signal, downconverted to DC - * - * All settings max_freq and min_freq are in terms of radians per sample, - * NOT HERTZ. The loop bandwidth determins the lock range and should be set - * around pi/200 -- 2pi/100. - * \sa gr_pll_freqdet_cf, gr_pll_carriertracking_cc - */ - -class GR_CORE_API gr_pll_carriertracking_cc : public gr_sync_block, public gri_control_loop -{ - friend GR_CORE_API gr_pll_carriertracking_cc_sptr gr_make_pll_carriertracking_cc (float loop_bw, - float max_freq, - float min_freq); - - float d_locksig,d_lock_threshold; - bool d_squelch_enable; - gr_pll_carriertracking_cc (float loop_bw, float max_freq, float min_freq); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -private: - float mod_2pi (float in); - float phase_detector(gr_complex sample,float ref_phase); -public: - bool lock_detector(void); - bool squelch_enable(bool); - float set_lock_threshold(float); -}; - -#endif diff --git a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.i b/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.i deleted file mode 100644 index a20adf7e20..0000000000 --- a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.i +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,pll_carriertracking_cc); - -gr_pll_carriertracking_cc_sptr -gr_make_pll_carriertracking_cc (float loop_bw, - float max_freq, - float min_freq); - -class gr_pll_carriertracking_cc : public gr_sync_block, public gri_control_loop -{ - private: - gr_pll_carriertracking_cc (float loop_bw, float max_freq, float min_freq); - public: - bool lock_detector(void); - bool squelch_enable(bool); - float set_lock_threshold(float); - -}; diff --git a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc b/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc deleted file mode 100644 index f80f4ed07a..0000000000 --- a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010,2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_pll_freqdet_cf.h> -#include <gr_io_signature.h> -#include <math.h> -#include <gr_math.h> - -#ifndef M_TWOPI -#define M_TWOPI (2.0f*M_PI) -#endif - -gr_pll_freqdet_cf_sptr -gr_make_pll_freqdet_cf (float loop_bw, float max_freq, float min_freq) -{ - return gnuradio::get_initial_sptr(new gr_pll_freqdet_cf (loop_bw, max_freq, min_freq)); -} - -gr_pll_freqdet_cf::gr_pll_freqdet_cf (float loop_bw, float max_freq, float min_freq) - : gr_sync_block ("pll_freqdet_cf", - gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (float))), - gri_control_loop(loop_bw, max_freq, min_freq) -{ -} - -float -gr_pll_freqdet_cf::mod_2pi (float in) -{ - if(in>M_PI) - return in-M_TWOPI; - else if(in<-M_PI) - return in+M_TWOPI; - else - return in; -} - -float -gr_pll_freqdet_cf::phase_detector(gr_complex sample,float ref_phase) -{ - float sample_phase; - sample_phase = gr_fast_atan2f(sample.imag(),sample.real()); - return mod_2pi(sample_phase-ref_phase); -} - -int -gr_pll_freqdet_cf::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *iptr = (gr_complex *) input_items[0]; - float *optr = (float *) output_items[0]; - - float error; - int size = noutput_items; - - while (size-- > 0) { - *optr++ = d_freq; - - error = phase_detector(*iptr++,d_phase); - - advance_loop(error); - phase_wrap(); - frequency_limit(); - } - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.h b/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.h deleted file mode 100644 index 3dfc8d7093..0000000000 --- a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_PLL_FREQDET_CF_H -#define INCLUDED_GR_PLL_FREQDET_CF_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gri_control_loop.h> - -class gr_pll_freqdet_cf; -typedef boost::shared_ptr<gr_pll_freqdet_cf> gr_pll_freqdet_cf_sptr; - -GR_CORE_API gr_pll_freqdet_cf_sptr gr_make_pll_freqdet_cf (float loop_bw, - float max_freq, - float min_freq); -/*! - * \brief Implements a PLL which locks to the input frequency and outputs - * an estimate of that frequency. Useful for FM Demod. - * \ingroup sync_blk - * - * input: stream of complex; output: stream of floats - * - * This PLL locks onto a [possibly noisy] reference carrier on - * the input and outputs an estimate of that frequency in radians per sample. - * All settings max_freq and min_freq are in terms of radians per sample, - * NOT HERTZ. The loop bandwidth determins the lock range and should be set - * around pi/200 -- 2pi/100. - * \sa gr_pll_refout_cc, gr_pll_carriertracking_cc - */ - -class GR_CORE_API gr_pll_freqdet_cf : public gr_sync_block, public gri_control_loop -{ - friend GR_CORE_API gr_pll_freqdet_cf_sptr gr_make_pll_freqdet_cf (float loop_bw, - float max_freq, - float min_freq); - - float mod_2pi (float in); - gr_pll_freqdet_cf (float loop_bw, float max_freq, float min_freq); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -private: - float phase_detector(gr_complex sample,float ref_phase); -}; - -#endif diff --git a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.i b/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.i deleted file mode 100644 index 87e515adb8..0000000000 --- a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.i +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,pll_freqdet_cf) - - gr_pll_freqdet_cf_sptr gr_make_pll_freqdet_cf (float loop_bw, - float max_freq, - float min_freq); - -class gr_pll_freqdet_cf : public gr_sync_block, public gri_control_loop -{ - private: - gr_pll_freqdet_cf (float loop_bw, float max_freq, float min_freq); -}; diff --git a/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc b/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc deleted file mode 100644 index 9f95c3f64e..0000000000 --- a/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010,2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_pll_refout_cc.h> -#include <gr_io_signature.h> -#include <gr_sincos.h> -#include <math.h> -#include <gr_math.h> - -#ifndef M_TWOPI -#define M_TWOPI (2.0f*M_PI) -#endif - -gr_pll_refout_cc_sptr -gr_make_pll_refout_cc (float loop_bw, float max_freq, float min_freq) -{ - return gnuradio::get_initial_sptr(new gr_pll_refout_cc (loop_bw, max_freq, min_freq)); -} - -gr_pll_refout_cc::gr_pll_refout_cc (float loop_bw, float max_freq, float min_freq) - : gr_sync_block ("pll_refout_cc", - gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (gr_complex))), - gri_control_loop(loop_bw, max_freq, min_freq) -{ -} - -float -gr_pll_refout_cc::mod_2pi (float in) -{ - if(in>M_PI) - return in-M_TWOPI; - else if(in<-M_PI) - return in+M_TWOPI; - else - return in; -} - -float -gr_pll_refout_cc::phase_detector(gr_complex sample,float ref_phase) -{ - float sample_phase; - sample_phase = gr_fast_atan2f(sample.imag(),sample.real()); - return mod_2pi(sample_phase-ref_phase); -} - -int -gr_pll_refout_cc::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *iptr = (gr_complex *) input_items[0]; - gr_complex *optr = (gr_complex *) output_items[0]; - - float error; - float t_imag, t_real; - int size = noutput_items; - - while (size-- > 0) { - gr_sincosf(d_phase,&t_imag,&t_real); - *optr++ = gr_complex(t_real,t_imag); - - error = phase_detector(*iptr++,d_phase); - - advance_loop(error); - phase_wrap(); - frequency_limit(); - } - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_pll_refout_cc.h b/gnuradio-core/src/lib/general/gr_pll_refout_cc.h deleted file mode 100644 index ef5cd31e27..0000000000 --- a/gnuradio-core/src/lib/general/gr_pll_refout_cc.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_PLL_REFOUT_CC_H -#define INCLUDED_GR_PLL_REFOUT_CC_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gri_control_loop.h> - -class gr_pll_refout_cc; -typedef boost::shared_ptr<gr_pll_refout_cc> gr_pll_refout_cc_sptr; - -GR_CORE_API gr_pll_refout_cc_sptr gr_make_pll_refout_cc (float loop_bw, - float max_freq, float min_freq); -/*! - * \brief Implements a PLL which locks to the input frequency and outputs a carrier - * \ingroup sync_blk - * - * input: stream of complex; output: stream of complex - * - * This PLL locks onto a [possibly noisy] reference carrier on - * the input and outputs a clean version which is phase and frequency - * aligned to it. - * - * All settings max_freq and min_freq are in terms of radians per sample, - * NOT HERTZ. The loop bandwidth determins the lock range and should be set - * around pi/200 -- 2pi/100. - * \sa gr_pll_freqdet_cf, gr_pll_carriertracking_cc - */ -class GR_CORE_API gr_pll_refout_cc : public gr_sync_block, public gri_control_loop -{ - friend GR_CORE_API gr_pll_refout_cc_sptr gr_make_pll_refout_cc (float loop_bw, - float max_freq, float min_freq); - - gr_pll_refout_cc (float loop_bw, float max_freq, float min_freq); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -private: - float mod_2pi (float in); - float phase_detector(gr_complex sample, float ref_phase); -}; - -#endif diff --git a/gnuradio-core/src/lib/general/gr_pll_refout_cc.i b/gnuradio-core/src/lib/general/gr_pll_refout_cc.i deleted file mode 100644 index 630c0444fa..0000000000 --- a/gnuradio-core/src/lib/general/gr_pll_refout_cc.i +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,pll_refout_cc) - -gr_pll_refout_cc_sptr gr_make_pll_refout_cc (float loop_bw, - float max_freq, float min_freq); - -class gr_pll_refout_cc : public gr_sync_block, public gri_control_loop -{ - private: - gr_pll_refout_cc (float loop_bw, float max_freq, float min_freq); -}; diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.cc b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.cc deleted file mode 100644 index 6430d2753d..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.cc +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include <gr_probe_avg_mag_sqrd_c.h> -#include <gr_io_signature.h> -#include <cmath> - -gr_probe_avg_mag_sqrd_c_sptr -gr_make_probe_avg_mag_sqrd_c(double threshold_db, double alpha) -{ - return gnuradio::get_initial_sptr(new gr_probe_avg_mag_sqrd_c(threshold_db, alpha)); -} - -gr_probe_avg_mag_sqrd_c::gr_probe_avg_mag_sqrd_c (double threshold_db, double alpha) - : gr_sync_block ("probe_avg_mag_sqrd_c", - gr_make_io_signature(1, 1, sizeof(gr_complex)), - gr_make_io_signature(0, 0, 0)), - d_iir(alpha), d_unmuted(false), d_level(0) -{ - set_threshold (threshold_db); -} - -gr_probe_avg_mag_sqrd_c::~gr_probe_avg_mag_sqrd_c() -{ -} - - -int -gr_probe_avg_mag_sqrd_c::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *in = (const gr_complex *) input_items[0]; - - for (int i = 0; i < noutput_items; i++){ - double mag_sqrd = in[i].real()*in[i].real() + in[i].imag()*in[i].imag(); - d_iir.filter(mag_sqrd); // computed for side effect: prev_output() - } - - d_unmuted = d_iir.prev_output() >= d_threshold; - d_level = d_iir.prev_output(); - return noutput_items; -} - -double -gr_probe_avg_mag_sqrd_c::threshold() const -{ - return 10 * std::log10(d_threshold); -} - -void -gr_probe_avg_mag_sqrd_c::set_threshold(double decibels) -{ - // convert to absolute threshold (mag squared) - d_threshold = std::pow(10.0, decibels/10); -} - -void -gr_probe_avg_mag_sqrd_c::set_alpha(double alpha) -{ - d_iir.set_taps(alpha); -} diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.h b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.h deleted file mode 100644 index 2811677cfc..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_GR_PROBE_AVG_MAG_SQRD_C_H -#define INCLUDED_GR_PROBE_AVG_MAG_SQRD_C_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_single_pole_iir.h> - -class gr_probe_avg_mag_sqrd_c; -typedef boost::shared_ptr<gr_probe_avg_mag_sqrd_c> gr_probe_avg_mag_sqrd_c_sptr; - -GR_CORE_API gr_probe_avg_mag_sqrd_c_sptr -gr_make_probe_avg_mag_sqrd_c (double threshold_db, double alpha = 0.0001); - -/*! - * \brief compute avg magnitude squared. - * \ingroup sink_blk - * - * input: gr_complex - * - * Compute a running average of the magnitude squared of the the input. - * The level and indication as to whether the level exceeds threshold - * can be retrieved with the level and unmuted accessors. - */ -class GR_CORE_API gr_probe_avg_mag_sqrd_c : public gr_sync_block -{ - double d_threshold; - gr_single_pole_iir<double,double,double> d_iir; - bool d_unmuted; - double d_level; - - friend GR_CORE_API gr_probe_avg_mag_sqrd_c_sptr - gr_make_probe_avg_mag_sqrd_c (double threshold_db, double alpha); - - gr_probe_avg_mag_sqrd_c (double threshold_db, double alpha); - -public: - ~gr_probe_avg_mag_sqrd_c (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - // ACCESSORS - bool unmuted () const { return d_unmuted; } - double level () const { return d_level; } - - double threshold() const; - - // SETTERS - void set_alpha (double alpha); - void set_threshold (double decibels); -}; - -#endif /* INCLUDED_GR_PROBE_AVG_MAG_SQRD_C_H */ diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.i b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.i deleted file mode 100644 index bce244c127..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_c.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,probe_avg_mag_sqrd_c); - -gr_probe_avg_mag_sqrd_c_sptr -gr_make_probe_avg_mag_sqrd_c (double threshold_db, double alpha = 0.0001); - -class gr_probe_avg_mag_sqrd_c : public gr_sync_block -{ -public: - bool unmuted () const { return d_unmuted; } - double level () const { return d_level; } - void set_alpha (double alpha); - void set_threshold (double decibels); - double threshold(); -}; diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.cc b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.cc deleted file mode 100644 index b5946283b8..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.cc +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2007,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include <gr_probe_avg_mag_sqrd_cf.h> -#include <gr_io_signature.h> -#include <cmath> - -gr_probe_avg_mag_sqrd_cf_sptr -gr_make_probe_avg_mag_sqrd_cf(double threshold_db, double alpha) -{ - return gnuradio::get_initial_sptr(new gr_probe_avg_mag_sqrd_cf(threshold_db, alpha)); -} - -gr_probe_avg_mag_sqrd_cf::gr_probe_avg_mag_sqrd_cf (double threshold_db, double alpha) - : gr_sync_block ("probe_avg_mag_sqrd_cf", - gr_make_io_signature(1, 1, sizeof(gr_complex)), - gr_make_io_signature(1, 1, sizeof(float))), - d_iir(alpha), d_unmuted(false), d_level(0) -{ - set_threshold (threshold_db); -} - -gr_probe_avg_mag_sqrd_cf::~gr_probe_avg_mag_sqrd_cf() -{ -} - - -int -gr_probe_avg_mag_sqrd_cf::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *in = (const gr_complex *) input_items[0]; - float *out = (float *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - out[i] = d_iir.prev_output(); - double mag_sqrd = in[i].real()*in[i].real() + in[i].imag()*in[i].imag(); - d_iir.filter(mag_sqrd); // computed for side effect: prev_output() - } - - d_unmuted = d_iir.prev_output() >= d_threshold; - d_level = d_iir.prev_output(); - return noutput_items; -} - -double -gr_probe_avg_mag_sqrd_cf::threshold() const -{ - return 10 * std::log10(d_threshold); -} - -void -gr_probe_avg_mag_sqrd_cf::set_threshold(double decibels) -{ - // convert to absolute threshold (mag squared) - d_threshold = std::pow(10.0, decibels/10); -} - -void -gr_probe_avg_mag_sqrd_cf::set_alpha(double alpha) -{ - d_iir.set_taps(alpha); -} diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.h b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.h deleted file mode 100644 index bb5d1ebf91..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_GR_PROBE_AVG_MAG_SQRD_CF_H -#define INCLUDED_GR_PROBE_AVG_MAG_SQRD_CF_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_single_pole_iir.h> - -class gr_probe_avg_mag_sqrd_cf; -typedef boost::shared_ptr<gr_probe_avg_mag_sqrd_cf> gr_probe_avg_mag_sqrd_cf_sptr; - -GR_CORE_API gr_probe_avg_mag_sqrd_cf_sptr -gr_make_probe_avg_mag_sqrd_cf (double threshold_db, double alpha = 0.0001); - -/*! - * \brief compute avg magnitude squared. - * \ingroup sink_blk - * - * input: gr_complex - * output: gr_float - * - * Compute a running average of the magnitude squared of the the input. - * The level and indication as to whether the level exceeds threshold - * can be retrieved with the level and unmuted accessors. - * - */ -class GR_CORE_API gr_probe_avg_mag_sqrd_cf : public gr_sync_block -{ - double d_threshold; - gr_single_pole_iir<double,double,double> d_iir; - bool d_unmuted; - double d_level; - - friend GR_CORE_API gr_probe_avg_mag_sqrd_cf_sptr - gr_make_probe_avg_mag_sqrd_cf (double threshold_db, double alpha); - - gr_probe_avg_mag_sqrd_cf (double threshold_db, double alpha); - -public: - ~gr_probe_avg_mag_sqrd_cf (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - // ACCESSORS - bool unmuted () const { return d_unmuted; } - double level () const { return d_level; } - - double threshold() const; - - // SETTERS - void set_alpha (double alpha); - void set_threshold (double decibels); -}; - -#endif /* INCLUDED_GR_PROBE_AVG_MAG_SQRD_CF_H */ diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.i b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.i deleted file mode 100644 index bf76d973b7..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_cf.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,probe_avg_mag_sqrd_cf); - -gr_probe_avg_mag_sqrd_cf_sptr -gr_make_probe_avg_mag_sqrd_cf (double threshold_db, double alpha = 0.0001); - -class gr_probe_avg_mag_sqrd_cf : public gr_sync_block -{ -public: - bool unmuted () const { return d_unmuted; } - double level () const { return d_level; } - void set_alpha (double alpha); - void set_threshold (double decibels); - double threshold(); -}; diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.cc b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.cc deleted file mode 100644 index 4ed40743fc..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.cc +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include <gr_probe_avg_mag_sqrd_f.h> -#include <gr_io_signature.h> -#include <cmath> - -gr_probe_avg_mag_sqrd_f_sptr -gr_make_probe_avg_mag_sqrd_f(double threshold_db, double alpha) -{ - return gnuradio::get_initial_sptr(new gr_probe_avg_mag_sqrd_f(threshold_db, alpha)); -} - -gr_probe_avg_mag_sqrd_f::gr_probe_avg_mag_sqrd_f (double threshold_db, double alpha) - : gr_sync_block ("probe_avg_mag_sqrd_f", - gr_make_io_signature(1, 1, sizeof(float)), - gr_make_io_signature(0, 0, 0)), - d_iir(alpha), d_unmuted(false), d_level(0) -{ - set_threshold (threshold_db); -} - -gr_probe_avg_mag_sqrd_f::~gr_probe_avg_mag_sqrd_f() -{ -} - - -int -gr_probe_avg_mag_sqrd_f::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - - for (int i = 0; i < noutput_items; i++){ - double mag_sqrd = in[i]*in[i]; - d_iir.filter(mag_sqrd); // computed for side effect: prev_output() - } - - d_unmuted = d_iir.prev_output() >= d_threshold; - d_level = d_iir.prev_output(); - return noutput_items; -} - -double -gr_probe_avg_mag_sqrd_f::threshold() const -{ - return 10 * std::log10(d_threshold); -} - -void -gr_probe_avg_mag_sqrd_f::set_threshold(double decibels) -{ - // convert to absolute threshold (mag sqrd) - d_threshold = std::pow(10.0, decibels/10); -} - -void -gr_probe_avg_mag_sqrd_f::set_alpha(double alpha) -{ - d_iir.set_taps(alpha); -} diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.h b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.h deleted file mode 100644 index b2efcc64eb..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_GR_PROBE_AVG_MAG_SQRD_F_H -#define INCLUDED_GR_PROBE_AVG_MAG_SQRD_F_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_single_pole_iir.h> - -class gr_probe_avg_mag_sqrd_f; -typedef boost::shared_ptr<gr_probe_avg_mag_sqrd_f> gr_probe_avg_mag_sqrd_f_sptr; - -GR_CORE_API gr_probe_avg_mag_sqrd_f_sptr -gr_make_probe_avg_mag_sqrd_f (double threshold_db, double alpha = 0.0001); - -/*! - * \brief compute avg magnitude squared. - * \ingroup sink_blk - * - * input: float - * - * Compute a running average of the magnitude squared of the the input. - * The level and indication as to whether the level exceeds threshold - * can be retrieved with the level and unmuted accessors. - */ -class GR_CORE_API gr_probe_avg_mag_sqrd_f : public gr_sync_block -{ - double d_threshold; - gr_single_pole_iir<double,double,double> d_iir; - bool d_unmuted; - double d_level; - - friend GR_CORE_API gr_probe_avg_mag_sqrd_f_sptr - gr_make_probe_avg_mag_sqrd_f (double threshold_db, double alpha); - - gr_probe_avg_mag_sqrd_f (double threshold_db, double alpha); - -public: - ~gr_probe_avg_mag_sqrd_f (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - // ACCESSORS - bool unmuted () const { return d_unmuted; } - double level () const { return d_level; } - - double threshold() const; - - // SETTERS - void set_alpha (double alpha); - void set_threshold (double decibels); -}; - -#endif /* INCLUDED_GR_PROBE_AVG_MAG_SQRD_F_H */ diff --git a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.i b/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.i deleted file mode 100644 index 1c63ae8e9d..0000000000 --- a/gnuradio-core/src/lib/general/gr_probe_avg_mag_sqrd_f.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,probe_avg_mag_sqrd_f); - -gr_probe_avg_mag_sqrd_f_sptr -gr_make_probe_avg_mag_sqrd_f (double threshold_db, double alpha = 0.0001); - -class gr_probe_avg_mag_sqrd_f : public gr_sync_block -{ -public: - bool unmuted () const { return d_unmuted; } - double level () const { return d_level; } - double threshold() const; - void set_alpha (double alpha); - void set_threshold (double decibels); -}; diff --git a/gnuradio-core/src/lib/general/gr_pwr_squelch_cc.cc b/gnuradio-core/src/lib/general/gr_pwr_squelch_cc.cc deleted file mode 100644 index 90eab13eba..0000000000 --- a/gnuradio-core/src/lib/general/gr_pwr_squelch_cc.cc +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_pwr_squelch_cc.h> - -gr_pwr_squelch_cc_sptr -gr_make_pwr_squelch_cc(double threshold, double alpha, int ramp, bool gate) -{ - return gnuradio::get_initial_sptr(new gr_pwr_squelch_cc(threshold, alpha, ramp, gate)); -} - -gr_pwr_squelch_cc::gr_pwr_squelch_cc(double threshold, double alpha, int ramp, bool gate) : - gr_squelch_base_cc("pwr_squelch_cc", ramp, gate), - d_iir(alpha) -{ - set_threshold(threshold); -} - -std::vector<float> gr_pwr_squelch_cc::squelch_range() const -{ - std::vector<float> r(3); - r[0] = -50.0; // min FIXME - r[1] = +50.0; // max FIXME - r[2] = (r[1] - r[0]) / 100; // step size - - return r; -} - -void gr_pwr_squelch_cc::update_state(const gr_complex &in) -{ - d_pwr = d_iir.filter(in.real()*in.real()+in.imag()*in.imag()); -} diff --git a/gnuradio-core/src/lib/general/gr_pwr_squelch_cc.h b/gnuradio-core/src/lib/general/gr_pwr_squelch_cc.h deleted file mode 100644 index b2b4624f58..0000000000 --- a/gnuradio-core/src/lib/general/gr_pwr_squelch_cc.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_PWR_SQUELCH_CC_H -#define INCLUDED_GR_PWR_SQUELCH_CC_H - -#include <gr_core_api.h> -#include <cmath> -#include <gr_squelch_base_cc.h> -#include <gr_single_pole_iir.h> - -class gr_pwr_squelch_cc; -typedef boost::shared_ptr<gr_pwr_squelch_cc> gr_pwr_squelch_cc_sptr; - -GR_CORE_API gr_pwr_squelch_cc_sptr -gr_make_pwr_squelch_cc(double db, double alpha = 0.0001, int ramp=0, bool gate=false); - -/*! - * \brief gate or zero output when input power below threshold - * \ingroup level_blk - */ -class GR_CORE_API gr_pwr_squelch_cc : public gr_squelch_base_cc -{ -private: - double d_threshold; - double d_pwr; - gr_single_pole_iir<double,double,double> d_iir; - - friend GR_CORE_API gr_pwr_squelch_cc_sptr gr_make_pwr_squelch_cc(double db, double alpha, int ramp, bool gate); - gr_pwr_squelch_cc(double db, double alpha, int ramp, bool gate); - -protected: - virtual void update_state(const gr_complex &in); - virtual bool mute() const { return d_pwr < d_threshold; } - -public: - std::vector<float> squelch_range() const; - - double threshold() const { return 10*log10(d_threshold); } - void set_threshold(double db) { d_threshold = std::pow(10.0, db/10); } - void set_alpha(double alpha) { d_iir.set_taps(alpha); } -}; - -#endif /* INCLUDED_GR_PWR_SQUELCH_CC_H */ diff --git a/gnuradio-core/src/lib/general/gr_pwr_squelch_cc.i b/gnuradio-core/src/lib/general/gr_pwr_squelch_cc.i deleted file mode 100644 index c8cafd7aac..0000000000 --- a/gnuradio-core/src/lib/general/gr_pwr_squelch_cc.i +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,pwr_squelch_cc); - -// retrieve info on the base class, without generating wrappers since -// the base class has a pure virual method. -%import "gr_squelch_base_cc.i" - -gr_pwr_squelch_cc_sptr -gr_make_pwr_squelch_cc(double db, double alpha=0.0001, int ramp=0, bool gate=false); - -class gr_pwr_squelch_cc : public gr_squelch_base_cc -{ -private: - gr_pwr_squelch_cc(double db, double alpha, int ramp, bool gate); - -public: - double threshold() const { return 10*log10(d_threshold); } - void set_threshold(double db) { d_threshold = std::pow(10.0, db/10); } - void set_alpha(double alpha) { d_iir.set_taps(alpha); } - std::vector<float> squelch_range() const; -}; diff --git a/gnuradio-core/src/lib/general/gr_pwr_squelch_ff.cc b/gnuradio-core/src/lib/general/gr_pwr_squelch_ff.cc deleted file mode 100644 index cfa867243d..0000000000 --- a/gnuradio-core/src/lib/general/gr_pwr_squelch_ff.cc +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2006,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_pwr_squelch_ff.h> - -gr_pwr_squelch_ff_sptr -gr_make_pwr_squelch_ff(double threshold, double alpha, int ramp, bool gate) -{ - return gnuradio::get_initial_sptr(new gr_pwr_squelch_ff(threshold, alpha, ramp, gate)); -} - -gr_pwr_squelch_ff::gr_pwr_squelch_ff(double threshold, double alpha, int ramp, bool gate) : - gr_squelch_base_ff("pwr_squelch_ff", ramp, gate), - d_iir(alpha) -{ - set_threshold(threshold); -} - -std::vector<float> gr_pwr_squelch_ff::squelch_range() const -{ - std::vector<float> r(3); - r[0] = -50.0; // min FIXME - r[1] = +50.0; // max FIXME - r[2] = (r[1] - r[0]) / 100; // step size - - return r; -} - -void gr_pwr_squelch_ff::update_state(const float &in) -{ - d_pwr = d_iir.filter(in*in); -} diff --git a/gnuradio-core/src/lib/general/gr_pwr_squelch_ff.h b/gnuradio-core/src/lib/general/gr_pwr_squelch_ff.h deleted file mode 100644 index d5148c4096..0000000000 --- a/gnuradio-core/src/lib/general/gr_pwr_squelch_ff.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_PWR_SQUELCH_FF_H -#define INCLUDED_GR_PWR_SQUELCH_FF_H - -#include <gr_core_api.h> -#include <cmath> -#include <gr_squelch_base_ff.h> -#include <gr_single_pole_iir.h> - -class gr_pwr_squelch_ff; -typedef boost::shared_ptr<gr_pwr_squelch_ff> gr_pwr_squelch_ff_sptr; - -GR_CORE_API gr_pwr_squelch_ff_sptr -gr_make_pwr_squelch_ff(double db, double alpha = 0.0001, int ramp=0, bool gate=false); - -/*! - * \brief gate or zero output when input power below threshold - * \ingroup level_blk - */ -class GR_CORE_API gr_pwr_squelch_ff : public gr_squelch_base_ff -{ -private: - double d_threshold; - double d_pwr; - gr_single_pole_iir<double,double,double> d_iir; - - friend GR_CORE_API gr_pwr_squelch_ff_sptr gr_make_pwr_squelch_ff(double db, double alpha, int ramp, bool gate); - gr_pwr_squelch_ff(double db, double alpha, int ramp, bool gate); - -protected: - virtual void update_state(const float &in); - virtual bool mute() const { return d_pwr < d_threshold; } - -public: - std::vector<float> squelch_range() const; - - double threshold() const { return 10*log10(d_threshold); } - void set_threshold(double db) { d_threshold = std::pow(10.0, db/10); } - void set_alpha(double alpha) { d_iir.set_taps(alpha); } -}; - -#endif /* INCLUDED_GR_PWR_SQUELCH_FF_H */ diff --git a/gnuradio-core/src/lib/general/gr_pwr_squelch_ff.i b/gnuradio-core/src/lib/general/gr_pwr_squelch_ff.i deleted file mode 100644 index 2682f27586..0000000000 --- a/gnuradio-core/src/lib/general/gr_pwr_squelch_ff.i +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,pwr_squelch_ff); - -// retrieve info on the base class, without generating wrappers since -// the base class has a pure virual method. -%import "gr_squelch_base_ff.i" - -gr_pwr_squelch_ff_sptr -gr_make_pwr_squelch_ff(double db, double alpha=0.0001, int ramp=0, bool gate=false); - -class gr_pwr_squelch_ff : public gr_squelch_base_ff -{ -private: - gr_pwr_squelch_ff(double db, double alpha, int ramp, bool gate); - -public: - double threshold() const { return 10*log10(d_threshold); } - void set_threshold(double db) { d_threshold = std::pow(10.0, db/10); } - void set_alpha(double alpha) { d_iir.set_taps(alpha); } - std::vector<float> squelch_range() const; -}; diff --git a/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.cc b/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.cc deleted file mode 100644 index fa09582762..0000000000 --- a/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.cc +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2005,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_quadrature_demod_cf.h> -#include <gr_io_signature.h> -#include <gr_math.h> - -gr_quadrature_demod_cf::gr_quadrature_demod_cf (float gain) - : gr_sync_block ("quadrature_demod_cf", - gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (1, 1, sizeof (float))), - d_gain (gain) -{ - set_history (2); // we need to look at the previous value -} - -gr_quadrature_demod_cf_sptr -gr_make_quadrature_demod_cf (float gain) -{ - return gnuradio::get_initial_sptr(new gr_quadrature_demod_cf (gain)); -} - -int -gr_quadrature_demod_cf::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - gr_complex *in = (gr_complex *) input_items[0]; - float *out = (float *) output_items[0]; - in++; // ensure that in[-1] is valid - - for (int i = 0; i < noutput_items; i++){ - gr_complex product = in[i] * conj (in[i-1]); - // out[i] = d_gain * arg (product); - out[i] = d_gain * gr_fast_atan2f(imag(product), real(product)); - } - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.h b/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.h deleted file mode 100644 index 9f5976c971..0000000000 --- a/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_QUADRATURE_DEMOD_CF_H -#define INCLUDED_GR_QUADRATURE_DEMOD_CF_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> - -class gr_quadrature_demod_cf; -typedef boost::shared_ptr<gr_quadrature_demod_cf> gr_quadrature_demod_cf_sptr; -GR_CORE_API gr_quadrature_demod_cf_sptr gr_make_quadrature_demod_cf (float gain); - -/*! - * \brief quadrature demodulator: complex in, float out - * \ingroup demodulation_blk - * - * This can be used to demod FM, FSK, GMSK, etc. - * The input is complex baseband. - */ -class GR_CORE_API gr_quadrature_demod_cf : public gr_sync_block -{ - friend GR_CORE_API gr_quadrature_demod_cf_sptr gr_make_quadrature_demod_cf (float gain); - gr_quadrature_demod_cf (float gain); - - float d_gain; - - public: - void set_gain(float gain) { d_gain = gain; } - float gain() const { return d_gain; } - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_QUADRATURE_DEMOD_CF_H */ diff --git a/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.i b/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.i deleted file mode 100644 index 4c9168e647..0000000000 --- a/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.i +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC (gr, quadrature_demod_cf) - -gr_quadrature_demod_cf_sptr gr_make_quadrature_demod_cf (float gain); - -class gr_quadrature_demod_cf : public gr_sync_block -{ - gr_quadrature_demod_cf (float gain); - -public: - void set_gain(float gain) { d_gain = gain; } - float gain() const { return d_gain; } -}; diff --git a/gnuradio-core/src/lib/general/gr_rail_ff.cc b/gnuradio-core/src/lib/general/gr_rail_ff.cc deleted file mode 100644 index cd33c10d39..0000000000 --- a/gnuradio-core/src/lib/general/gr_rail_ff.cc +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_rail_ff.h> -#include <gr_io_signature.h> - -gr_rail_ff_sptr -gr_make_rail_ff(float lo, float hi) -{ - return gnuradio::get_initial_sptr(new gr_rail_ff(lo, hi)); -} - -gr_rail_ff::gr_rail_ff(float lo, float hi) - : gr_sync_block("rail_ff", - gr_make_io_signature(1, 1, sizeof(float)), - gr_make_io_signature(1, 1, sizeof(float))), - d_lo(lo), d_hi(hi) -{ -} - -int -gr_rail_ff::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - float *out = (float *) output_items[0]; - - for (int i = 0; i < noutput_items; i++) { - if (in[i] < d_lo) - out[i] = d_lo; - else if (in[i] > d_hi) - out[i] = d_hi; - else - out[i] = in[i]; - } - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/general/gr_rail_ff.h b/gnuradio-core/src/lib/general/gr_rail_ff.h deleted file mode 100644 index 29db5b1fa1..0000000000 --- a/gnuradio-core/src/lib/general/gr_rail_ff.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_RAIL_FF_H_ -# define INCLUDED_GR_RAIL_FF_H_ - -#include <gr_core_api.h> -#include <gr_sync_block.h> - -/*! - * \brief clips input values to min, max - * \ingroup misc - */ - -class gr_rail_ff; -typedef boost::shared_ptr<gr_rail_ff> gr_rail_ff_sptr; - -GR_CORE_API gr_rail_ff_sptr gr_make_rail_ff(float lo, float hi); - -class GR_CORE_API gr_rail_ff : public gr_sync_block -{ - friend GR_CORE_API gr_rail_ff_sptr gr_make_rail_ff (float lo, float hi); - - float d_lo, d_hi; // the constant - gr_rail_ff(float lo, float hi); - - public: - float lo() const { return d_lo; } - void set_lo(float lo) { d_lo = lo; } - float hi() const { return d_hi; } - void set_hi(float hi) { d_hi = hi; } - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif diff --git a/gnuradio-core/src/lib/general/gr_rail_ff.i b/gnuradio-core/src/lib/general/gr_rail_ff.i deleted file mode 100644 index bdc453516e..0000000000 --- a/gnuradio-core/src/lib/general/gr_rail_ff.i +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,rail_ff); - -gr_rail_ff_sptr gr_make_rail_ff(float lo, float hi); - -class gr_rail_ff : public gr_sync_block -{ -private: - gr_rail_ff(float lo, float hi); -}; diff --git a/gnuradio-core/src/lib/general/gr_simple_squelch_cc.cc b/gnuradio-core/src/lib/general/gr_simple_squelch_cc.cc deleted file mode 100644 index 5d90a3da48..0000000000 --- a/gnuradio-core/src/lib/general/gr_simple_squelch_cc.cc +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include <gr_simple_squelch_cc.h> -#include <gr_io_signature.h> -#include <cmath> - -gr_simple_squelch_cc_sptr -gr_make_simple_squelch_cc(double threshold_db, double alpha) -{ - return gnuradio::get_initial_sptr(new gr_simple_squelch_cc(threshold_db, alpha)); -} - -gr_simple_squelch_cc::gr_simple_squelch_cc (double threshold_db, double alpha) - : gr_sync_block ("simple_squelch_cc", - gr_make_io_signature(1, 1, sizeof(gr_complex)), - gr_make_io_signature(1, 1, sizeof(gr_complex))), - d_iir(alpha), d_unmuted(false) -{ - set_threshold (threshold_db); -} - -gr_simple_squelch_cc::~gr_simple_squelch_cc() -{ -} - - -int -gr_simple_squelch_cc::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - - for (int i = 0; i < noutput_items; i++){ - double mag_sqrd = in[i].real()*in[i].real() + in[i].imag()*in[i].imag(); - double f = d_iir.filter(mag_sqrd); - if (f >= d_threshold) - out[i] = in[i]; - else - out[i] = 0; - } - - d_unmuted = d_iir.prev_output() >= d_threshold; - return noutput_items; -} - -void -gr_simple_squelch_cc::set_threshold(double decibels) -{ - // convert to absolute threshold (mag squared) - d_threshold = std::pow(10.0, decibels/10); -} - -double -gr_simple_squelch_cc::threshold() const -{ - return 10 * log10(d_threshold); -} - -void -gr_simple_squelch_cc::set_alpha(double alpha) -{ - d_iir.set_taps(alpha); -} - -std::vector<float> -gr_simple_squelch_cc::squelch_range() const -{ - std::vector<float> r(3); - r[0] = -50.0; // min FIXME - r[1] = +50.0; // max FIXME - r[2] = (r[1] - r[0]) / 100; // step size - - return r; -} diff --git a/gnuradio-core/src/lib/general/gr_simple_squelch_cc.h b/gnuradio-core/src/lib/general/gr_simple_squelch_cc.h deleted file mode 100644 index 4bf62c7ec6..0000000000 --- a/gnuradio-core/src/lib/general/gr_simple_squelch_cc.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_GR_SIMPLE_SQUELCH_CC_H -#define INCLUDED_GR_SIMPLE_SQUELCH_CC_H - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_single_pole_iir.h> - -class gr_simple_squelch_cc; -typedef boost::shared_ptr<gr_simple_squelch_cc> gr_simple_squelch_cc_sptr; - -GR_CORE_API gr_simple_squelch_cc_sptr -gr_make_simple_squelch_cc (double threshold_db, double alpha = 0.0001); - -/*! - * \brief simple squelch block based on average signal power and threshold in dB. - * \ingroup level_blk - */ -class GR_CORE_API gr_simple_squelch_cc : public gr_sync_block -{ - double d_threshold; - gr_single_pole_iir<double,double,double> d_iir; - bool d_unmuted; - - friend GR_CORE_API gr_simple_squelch_cc_sptr - gr_make_simple_squelch_cc (double threshold_db, double alpha); - - gr_simple_squelch_cc (double threshold_db, double alpha); - -public: - ~gr_simple_squelch_cc (); - - int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - bool unmuted () const { return d_unmuted; } - - void set_alpha (double alpha); - void set_threshold (double decibels); - - double threshold() const; - std::vector<float> squelch_range() const; - -}; - -#endif /* INCLUDED_GR_SIMPLE_SQUELCH_CC_H */ diff --git a/gnuradio-core/src/lib/general/gr_simple_squelch_cc.i b/gnuradio-core/src/lib/general/gr_simple_squelch_cc.i deleted file mode 100644 index 17b469e156..0000000000 --- a/gnuradio-core/src/lib/general/gr_simple_squelch_cc.i +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -GR_SWIG_BLOCK_MAGIC(gr,simple_squelch_cc); - -gr_simple_squelch_cc_sptr -gr_make_simple_squelch_cc (double threshold_db, double alpha = 0.0001); - -class gr_simple_squelch_cc : public gr_sync_block -{ -public: - bool unmuted () const { return d_unmuted; } - void set_alpha (double alpha); - void set_threshold (double decibels); - - double threshold() const; - std::vector<float> squelch_range() const; -}; diff --git a/gnuradio-core/src/lib/general/gr_squelch_base_cc.cc b/gnuradio-core/src/lib/general/gr_squelch_base_cc.cc deleted file mode 100644 index b32a0a6954..0000000000 --- a/gnuradio-core/src/lib/general/gr_squelch_base_cc.cc +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_squelch_base_cc.h> -#include <gr_io_signature.h> - -gr_squelch_base_cc::gr_squelch_base_cc(const char *name, int ramp, bool gate) : - gr_block(name, - gr_make_io_signature(1, 1, sizeof(gr_complex)), - gr_make_io_signature(1, 1, sizeof(gr_complex))) -{ - set_ramp(ramp); - set_gate(gate); - d_state = ST_MUTED; - d_envelope = d_ramp ? 0.0 : 1.0; - d_ramped = 0; -} - -int gr_squelch_base_cc::general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const gr_complex *in = (const gr_complex *) input_items[0]; - gr_complex *out = (gr_complex *) output_items[0]; - - int j = 0; - - for (int i = 0; i < noutput_items; i++) { - update_state(in[i]); - - // Adjust envelope based on current state - switch(d_state) { - case ST_MUTED: - if (!mute()) - d_state = d_ramp ? ST_ATTACK : ST_UNMUTED; // If not ramping, go straight to unmuted - break; - - case ST_UNMUTED: - if (mute()) - d_state = d_ramp ? ST_DECAY : ST_MUTED; // If not ramping, go straight to muted - break; - - case ST_ATTACK: - d_envelope = 0.5-std::cos(M_PI*(++d_ramped)/d_ramp)/2.0; // FIXME: precalculate window for speed - if (d_ramped >= d_ramp) { // use >= in case d_ramp is set to lower value elsewhere - d_state = ST_UNMUTED; - d_envelope = 1.0; - } - break; - - case ST_DECAY: - d_envelope = 0.5-std::cos(M_PI*(--d_ramped)/d_ramp)/2.0; // FIXME: precalculate window for speed - if (d_ramped == 0.0) - d_state = ST_MUTED; - break; - }; - - // If unmuted, copy input times envelope to output - // Otherwise, if not gating, copy zero to output - if (d_state != ST_MUTED) - out[j++] = in[i]*gr_complex(d_envelope, 0.0); - else - if (!d_gate) - out[j++] = 0.0; - } - - consume_each(noutput_items); // Use all the inputs - return j; // But only report outputs copied -} diff --git a/gnuradio-core/src/lib/general/gr_squelch_base_cc.h b/gnuradio-core/src/lib/general/gr_squelch_base_cc.h deleted file mode 100644 index f1814473fb..0000000000 --- a/gnuradio-core/src/lib/general/gr_squelch_base_cc.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_SQUELCH_BASE_CC_H -#define INCLUDED_GR_SQUELCH_BASE_CC_H - -#include <gr_core_api.h> -#include <gr_block.h> - -class GR_CORE_API gr_squelch_base_cc : public gr_block -{ -private: - int d_ramp; - int d_ramped; - bool d_gate; - double d_envelope; - enum { ST_MUTED, ST_ATTACK, ST_UNMUTED, ST_DECAY } d_state; - -protected: - virtual void update_state(const gr_complex &sample) {}; - virtual bool mute() const { return false; }; - -public: - gr_squelch_base_cc(const char *name, int ramp, bool gate); - - int ramp() const { return d_ramp; } - void set_ramp(int ramp) { d_ramp = ramp; } - bool gate() const { return d_gate; } - void set_gate(bool gate) { d_gate = gate; } - bool unmuted() const { return (d_state == ST_UNMUTED || d_state == ST_ATTACK); } - - virtual std::vector<float> squelch_range() const = 0; - - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_SQUELCH_BASE_CC_H */ diff --git a/gnuradio-core/src/lib/general/gr_squelch_base_cc.i b/gnuradio-core/src/lib/general/gr_squelch_base_cc.i deleted file mode 100644 index 6501b7d2bf..0000000000 --- a/gnuradio-core/src/lib/general/gr_squelch_base_cc.i +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gr_block.h> - -class gr_squelch_base_cc : public gr_block -{ -private: - enum { ST_MUTED, ST_ATTACK, ST_UNMUTED, ST_DECAY } d_state; - -public: - gr_squelch_base_cc(const char *name, int ramp, bool gate); - - int ramp() const { return d_ramp; } - void set_ramp(int ramp) { d_ramp = ramp; } - bool gate() const { return d_gate; } - void set_gate(bool gate) { d_gate = gate; } - bool unmuted() const { return (d_state == ST_UNMUTED || d_state == ST_ATTACK); } - - virtual std::vector<float> squelch_range() const = 0; -}; diff --git a/gnuradio-core/src/lib/general/gr_squelch_base_ff.cc b/gnuradio-core/src/lib/general/gr_squelch_base_ff.cc deleted file mode 100644 index 4bf8cff971..0000000000 --- a/gnuradio-core/src/lib/general/gr_squelch_base_ff.cc +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <gr_squelch_base_ff.h> -#include <gr_io_signature.h> - -gr_squelch_base_ff::gr_squelch_base_ff(const char *name, int ramp, bool gate) : - gr_block(name, - gr_make_io_signature(1, 1, sizeof(float)), - gr_make_io_signature(1, 1, sizeof(float))) -{ - set_ramp(ramp); - set_gate(gate); - d_state = ST_MUTED; - d_envelope = d_ramp ? 0.0 : 1.0; - d_ramped = 0; -} - -int gr_squelch_base_ff::general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - const float *in = (const float *) input_items[0]; - float *out = (float *) output_items[0]; - - int j = 0; - - for (int i = 0; i < noutput_items; i++) { - update_state(in[i]); - - // Adjust envelope based on current state - switch(d_state) { - case ST_MUTED: - if (!mute()) - d_state = d_ramp ? ST_ATTACK : ST_UNMUTED; // If not ramping, go straight to unmuted - break; - - case ST_UNMUTED: - if (mute()) - d_state = d_ramp ? ST_DECAY : ST_MUTED; // If not ramping, go straight to muted - break; - - case ST_ATTACK: - d_envelope = 0.5-std::cos(M_PI*(++d_ramped)/d_ramp)/2.0; // FIXME: precalculate window for speed - if (d_ramped >= d_ramp) { // use >= in case d_ramp is set to lower value elsewhere - d_state = ST_UNMUTED; - d_envelope = 1.0; - } - break; - - case ST_DECAY: - d_envelope = 0.5-std::cos(M_PI*(--d_ramped)/d_ramp)/2.0; // FIXME: precalculate window for speed - if (d_ramped == 0.0) - d_state = ST_MUTED; - break; - }; - - // If unmuted, copy input times envelope to output - // Otherwise, if not gating, copy zero to output - if (d_state != ST_MUTED) - out[j++] = in[i]*d_envelope; - else - if (!d_gate) - out[j++] = 0.0; - } - - consume_each(noutput_items); // Use all the inputs - return j; // But only report outputs copied -} diff --git a/gnuradio-core/src/lib/general/gr_squelch_base_ff.h b/gnuradio-core/src/lib/general/gr_squelch_base_ff.h deleted file mode 100644 index eb52635b45..0000000000 --- a/gnuradio-core/src/lib/general/gr_squelch_base_ff.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GR_SQUELCH_BASE_FF_H -#define INCLUDED_GR_SQUELCH_BASE_FF_H - -#include <gr_core_api.h> -#include <gr_block.h> - -class GR_CORE_API gr_squelch_base_ff : public gr_block -{ -private: - int d_ramp; - int d_ramped; - bool d_gate; - double d_envelope; - enum { ST_MUTED, ST_ATTACK, ST_UNMUTED, ST_DECAY } d_state; - -protected: - virtual void update_state(const float &sample) {}; - virtual bool mute() const { return false; }; - -public: - gr_squelch_base_ff(const char *name, int ramp, bool gate); - - int ramp() const { return d_ramp; } - void set_ramp(int ramp) { d_ramp = ramp; } - bool gate() const { return d_gate; } - void set_gate(bool gate) { d_gate = gate; } - bool unmuted() const { return (d_state == ST_UNMUTED || d_state == ST_ATTACK); } - - virtual std::vector<float> squelch_range() const = 0; - - int general_work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_GR_SQUELCH_BASE_FF_H */ diff --git a/gnuradio-core/src/lib/general/gr_squelch_base_ff.i b/gnuradio-core/src/lib/general/gr_squelch_base_ff.i deleted file mode 100644 index a4e5c7115c..0000000000 --- a/gnuradio-core/src/lib/general/gr_squelch_base_ff.i +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <gr_block.h> - -class gr_squelch_base_ff : public gr_block -{ -private: - enum { ST_MUTED, ST_ATTACK, ST_UNMUTED, ST_DECAY } d_state; - -public: - gr_squelch_base_ff(const char *name, int ramp, bool gate); - - int ramp() const { return d_ramp; } - void set_ramp(int ramp) { d_ramp = ramp; } - bool gate() const { return d_gate; } - void set_gate(bool gate) { d_gate = gate; } - bool unmuted() const { return (d_state == ST_UNMUTED || d_state == ST_ATTACK); } - - virtual std::vector<float> squelch_range() const = 0; -}; diff --git a/gnuradio-core/src/lib/general/gri_agc2_cc.h b/gnuradio-core/src/lib/general/gri_agc2_cc.h deleted file mode 100644 index 55aa19b9ae..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc2_cc.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRI_AGC2_CC_H_ -#define _GRI_AGC2_CC_H_ - -#include <gr_core_api.h> -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class - * - * For Power the absolute value of the complex number is used. - */ -class GR_CORE_API gri_agc2_cc { - - public: - gri_agc2_cc (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0) - : _attack_rate(attack_rate), _decay_rate(decay_rate), _reference(reference), - _gain(gain), _max_gain(max_gain) {}; - - float decay_rate () const { return _decay_rate; } - float attack_rate () const { return _attack_rate; } - float reference () const { return _reference; } - float gain () const { return _gain; } - float max_gain() const { return _max_gain; } - - void set_decay_rate (float rate) { _decay_rate = rate; } - void set_attack_rate (float rate) { _attack_rate = rate; } - void set_reference (float reference) { _reference = reference; } - void set_gain (float gain) { _gain = gain; } - void set_max_gain(float max_gain) { _max_gain = max_gain; } - - gr_complex scale (gr_complex input){ - gr_complex output = input * _gain; - - float tmp = -_reference + sqrt(output.real()*output.real() + - output.imag()*output.imag()); - float rate = _decay_rate; - if((tmp) > _gain) - rate = _attack_rate; - _gain -= tmp*rate; - -#if 0 - fprintf(stdout, "rate = %f\ttmp = %f\t gain = %f\n", rate, tmp, _gain); -#endif - - // Not sure about this; will blow up if _gain < 0 (happens when rates are too high), - // but is this the solution? - if (_gain < 0.0) - _gain = 10e-5; - - if (_max_gain > 0.0 && _gain > _max_gain) - _gain = _max_gain; - return output; - } - - void scaleN (gr_complex output[], const gr_complex input[], unsigned n){ - for (unsigned i = 0; i < n; i++) - output[i] = scale (input[i]); - } - - protected: - float _attack_rate; // attack rate for fast changing signals - float _decay_rate; // decay rate for slow changing signals - float _reference; // reference value - float _gain; // current gain - float _max_gain; // max allowable gain -}; - -#endif /* _GRI_AGC2_CC_H_ */ diff --git a/gnuradio-core/src/lib/general/gri_agc2_cc.i b/gnuradio-core/src/lib/general/gri_agc2_cc.i deleted file mode 100644 index 08716c6edc..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc2_cc.i +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class with attack and decay rates - * - * For Power the absolute value of the complex number is used. - */ - - -class gri_agc2_cc { - - public: - gri_agc2_cc (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - float decay_rate (); - float attack_rate (); - float reference (); - float gain (); - float max_gain (); - void set_decay_rate (float rate); - void set_attack_rate (float rate); - void set_reference (float reference); - void set_gain (float gain); - void set_max_gain(float max_gain); - }; diff --git a/gnuradio-core/src/lib/general/gri_agc2_ff.h b/gnuradio-core/src/lib/general/gri_agc2_ff.h deleted file mode 100644 index a8b46bec5c..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc2_ff.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _GRI_AGC2_FF_H_ -#define _GRI_AGC2_FF_H_ - -#include <gr_core_api.h> -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class with attack and decay rate - * - * Power is approximated by absolute value - */ - -class GR_CORE_API gri_agc2_ff { - - public: - gri_agc2_ff (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0) - : _attack_rate(attack_rate), _decay_rate(decay_rate), _reference(reference), - _gain(gain), _max_gain(max_gain) {}; - - float attack_rate () const { return _attack_rate; } - float decay_rate () const { return _decay_rate; } - float reference () const { return _reference; } - float gain () const { return _gain; } - float max_gain () const { return _max_gain; } - - void set_attack_rate (float rate) { _attack_rate = rate; } - void set_decay_rate (float rate) { _decay_rate = rate; } - void set_reference (float reference) { _reference = reference; } - void set_gain (float gain) { _gain = gain; } - void set_max_gain (float max_gain) { _max_gain = max_gain; } - - float scale (float input){ - float output = input * _gain; - - float tmp = (fabsf(output)) - _reference; - float rate = _decay_rate; - if(fabsf(tmp) > _gain) - rate = _attack_rate; - _gain -= tmp*rate; - -#if 0 - fprintf(stdout, "rate = %f\ttmp = %f\t gain = %f\n", rate, tmp, _gain); -#endif - - // Not sure about this - if (_gain < 0.0) - _gain = 10e-5; - - if (_max_gain > 0.0 && _gain > _max_gain) - _gain = _max_gain; - return output; - } - - void scaleN (float output[], const float input[], unsigned n){ - for (unsigned i = 0; i < n; i++) - output[i] = scale (input[i]); - } - - protected: - float _attack_rate; // attack_rate for fast changing signals - float _decay_rate; // decay rate for slow changing signals - float _reference; // reference value - float _gain; // current gain - float _max_gain; // maximum gain -}; - -#endif /* _GRI_AGC2_FF_H_ */ diff --git a/gnuradio-core/src/lib/general/gri_agc2_ff.i b/gnuradio-core/src/lib/general/gri_agc2_ff.i deleted file mode 100644 index 9f97d8f0dd..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc2_ff.i +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class - * - * Power is approximated by absolute value - */ - - -class gri_agc2_ff { - - public: - gri_agc2_ff (float attack_rate = 1e-1, float decay_rate = 1e-2, - float reference = 1.0, float gain = 1.0, float max_gain = 0.0); - float attack_rate (); - float decay_rate (); - float reference (); - float gain (); - float max_gain (); - void set_attack_rate (float rate); - void set_decay_rate (float rate); - void set_reference (float reference); - void set_gain (float gain); - void set_max_gain (float max_gain); - }; diff --git a/gnuradio-core/src/lib/general/gri_agc_cc.h b/gnuradio-core/src/lib/general/gri_agc_cc.h deleted file mode 100644 index 90edc5dcd2..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc_cc.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GRI_AGC_CC_H -#define INCLUDED_GRI_AGC_CC_H - -#include <gr_core_api.h> -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class - * - * For Power the absolute value of the complex number is used. - */ - -class GR_CORE_API gri_agc_cc { - - public: - gri_agc_cc (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0) - : _rate(rate), _reference(reference), - _gain(gain), _max_gain(max_gain) {}; - - float rate () const { return _rate; } - float reference () const { return _reference; } - float gain () const { return _gain; } - float max_gain() const { return _max_gain; } - - void set_rate (float rate) { _rate = rate; } - void set_reference (float reference) { _reference = reference; } - void set_gain (float gain) { _gain = gain; } - void set_max_gain(float max_gain) { _max_gain = max_gain; } - - gr_complex scale (gr_complex input){ - gr_complex output = input * _gain; - - _gain += _rate * (_reference - sqrt(output.real()*output.real() + - output.imag()*output.imag())); - if (_max_gain > 0.0 && _gain > _max_gain) - _gain = _max_gain; - return output; - } - - void scaleN (gr_complex output[], const gr_complex input[], unsigned n){ - for (unsigned i = 0; i < n; i++) - output[i] = scale (input[i]); - } - - protected: - float _rate; // adjustment rate - float _reference; // reference value - float _gain; // current gain - float _max_gain; // max allowable gain -}; - -#endif /* INCLUDED_GRI_AGC_CC_H */ diff --git a/gnuradio-core/src/lib/general/gri_agc_cc.i b/gnuradio-core/src/lib/general/gri_agc_cc.i deleted file mode 100644 index d3dd9b61bc..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc_cc.i +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class - * - * For Power the absolute value of the complex number is used. - */ - - -class gri_agc_cc { - - public: - gri_agc_cc (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); - float rate (); - float reference (); - float gain (); - float max_gain (); - }; diff --git a/gnuradio-core/src/lib/general/gri_agc_ff.h b/gnuradio-core/src/lib/general/gri_agc_ff.h deleted file mode 100644 index 1c233c7461..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc_ff.h +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2002,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GRI_AGC_FF_H -#define INCLUDED_GRI_AGC_FF_H - -#include <gr_core_api.h> -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class - * - * Power is approximated by absolute value - */ -class GR_CORE_API gri_agc_ff { - - public: - gri_agc_ff (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0) - : _rate(rate), _reference(reference), _gain(gain), _max_gain(max_gain) {}; - - float rate () const { return _rate; } - float reference () const { return _reference; } - float gain () const { return _gain; } - float max_gain () const { return _max_gain; } - - void set_rate (float rate) { _rate = rate; } - void set_reference (float reference) { _reference = reference; } - void set_gain (float gain) { _gain = gain; } - void set_max_gain (float max_gain) { _max_gain = max_gain; } - - float scale (float input){ - float output = input * _gain; - _gain += (_reference - fabsf (output)) * _rate; - if (_max_gain > 0.0 && _gain > _max_gain) - _gain = _max_gain; - return output; - } - - void scaleN (float output[], const float input[], unsigned n){ - for (unsigned i = 0; i < n; i++) - output[i] = scale (input[i]); - } - - protected: - float _rate; // adjustment rate - float _reference; // reference value - float _gain; // current gain - float _max_gain; // maximum gain -}; - -#endif /* INCLUDED_GRI_AGC_FF_H */ - diff --git a/gnuradio-core/src/lib/general/gri_agc_ff.i b/gnuradio-core/src/lib/general/gri_agc_ff.i deleted file mode 100644 index df4acf7af8..0000000000 --- a/gnuradio-core/src/lib/general/gri_agc_ff.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2005,2006 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <math.h> - -/*! - * \brief high performance Automatic Gain Control class - * - * Power is approximated by absolute value - */ - -class gri_agc_ff { - - public: - gri_agc_ff (float rate = 1e-4, float reference = 1.0, - float gain = 1.0, float max_gain = 0.0); -}; diff --git a/gnuradio-core/src/lib/general/gri_lfsr.h b/gnuradio-core/src/lib/general/gri_lfsr.h deleted file mode 100644 index d0ce3d850a..0000000000 --- a/gnuradio-core/src/lib/general/gri_lfsr.h +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_GRI_LFSR_H -#define INCLUDED_GRI_LFSR_H - -#include <gr_core_api.h> -#include <stdexcept> -#include <stdint.h> - -/*! - * \brief Fibonacci Linear Feedback Shift Register using specified polynomial mask - * \ingroup misc - * - * Generates a maximal length pseudo-random sequence of length 2^degree-1 - * - * Constructor: gri_lfsr(int mask, int seed, int reg_len); - * - * mask - polynomial coefficients representing the locations - * of feedback taps from a shift register which are xor'ed - * together to form the new high order bit. - * - * Some common masks might be: - * x^4 + x^3 + x^0 = 0x19 - * x^5 + x^3 + x^0 = 0x29 - * x^6 + x^5 + x^0 = 0x61 - * - * seed - the initialization vector placed into the register - * durring initialization. Low order bit corresponds - * to x^0 coefficient -- the first to be shifted as output. - * - * reg_len - specifies the length of the feedback shift register - * to be used. Durring each iteration, the register - * is rightshifted one and the new bit is placed in bit reg_len. - * reg_len should generally be at least order(mask) + 1 - * - * - * see http://en.wikipedia.org/wiki/Linear_feedback_shift_register - * for more explanation. - * - * - * - * next_bit() - Standard LFSR operation - * - * Perform one cycle of the LFSR. The output bit is taken from - * the shift register LSB. The shift register MSB is assigned from - * the modulo 2 sum of the masked shift register. - * - * next_bit_scramble(unsigned char input) - Scramble an input stream - * - * Perform one cycle of the LFSR. The output bit is taken from - * the shift register LSB. The shift register MSB is assigned from - * the modulo 2 sum of the masked shift register and the input LSB. - * - * next_bit_descramble(unsigned char input) - Descramble an input stream - * - * Perform one cycle of the LFSR. The output bit is taken from - * the modulo 2 sum of the masked shift register and the input LSB. - * The shift register MSB is assigned from the LSB of the input. - * - * See http://en.wikipedia.org/wiki/Scrambler for operation of these - * last two functions (see multiplicative scrambler.) - * - */ - -class /*GR_CORE_API*/ gri_lfsr -{ - private: - uint32_t d_shift_register; - uint32_t d_mask; - uint32_t d_seed; - uint32_t d_shift_register_length; // less than 32 - - static uint32_t - popCount(uint32_t x) - { - uint32_t r = x - ((x >> 1) & 033333333333) - - ((x >> 2) & 011111111111); - return ((r + (r >> 3)) & 030707070707) % 63; - } - - public: - - gri_lfsr(uint32_t mask, uint32_t seed, uint32_t reg_len) - : d_shift_register(seed), - d_mask(mask), - d_seed(seed), - d_shift_register_length(reg_len) - { - if (reg_len > 31) - throw std::invalid_argument("reg_len must be <= 31"); - } - - unsigned char next_bit() { - unsigned char output = d_shift_register & 1; - unsigned char newbit = popCount( d_shift_register & d_mask )%2; - d_shift_register = ((d_shift_register>>1) | (newbit<<d_shift_register_length)); - return output; - } - - unsigned char next_bit_scramble(unsigned char input) { - unsigned char output = d_shift_register & 1; - unsigned char newbit = (popCount( d_shift_register & d_mask )%2)^(input & 1); - d_shift_register = ((d_shift_register>>1) | (newbit<<d_shift_register_length)); - return output; - } - - unsigned char next_bit_descramble(unsigned char input) { - unsigned char output = (popCount( d_shift_register & d_mask )%2)^(input & 1); - unsigned char newbit = input & 1; - d_shift_register = ((d_shift_register>>1) | (newbit<<d_shift_register_length)); - return output; - } - - /*! - * Reset shift register to initial seed value - */ - void reset() { d_shift_register = d_seed; } - - /*! - * Rotate the register through x number of bits - * where we are just throwing away the results to get queued up correctly - */ - void pre_shift(int num){ - for(int i=0; i<num; i++){ - next_bit(); - } - } - - int mask() const { return d_mask; } -}; - -#endif /* INCLUDED_GRI_LFSR_H */ diff --git a/gnuradio-core/src/lib/general/qa_general.cc b/gnuradio-core/src/lib/general/qa_general.cc index 61e5c159bd..75d59434d4 100644 --- a/gnuradio-core/src/lib/general/qa_general.cc +++ b/gnuradio-core/src/lib/general/qa_general.cc @@ -28,7 +28,6 @@ #include <qa_general.h> #include <qa_gr_firdes.h> #include <qa_gr_circular_file.h> -#include <qa_gr_cpm.h> #include <qa_gr_fxpt.h> #include <qa_gr_fxpt_nco.h> #include <qa_gr_fxpt_vco.h> @@ -41,7 +40,6 @@ qa_general::suite () s->addTest (qa_gr_firdes::suite ()); s->addTest (qa_gr_circular_file::suite ()); - s->addTest (qa_gr_cpm::suite ()); s->addTest (qa_gr_fxpt::suite ()); s->addTest (qa_gr_fxpt_nco::suite ()); s->addTest (qa_gr_fxpt_vco::suite ()); diff --git a/gnuradio-core/src/lib/general/qa_gr_cpm.cc b/gnuradio-core/src/lib/general/qa_gr_cpm.cc deleted file mode 100644 index ee3e2bdea0..0000000000 --- a/gnuradio-core/src/lib/general/qa_gr_cpm.cc +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include <qa_gr_cpm.h> -#include <gr_cpm.h> -#include <cppunit/TestAssert.h> - -const double DELTA = 1e-5; -const int L = 5; -const int samples_per_sym = 4; -const float taps_lrc[20] = { - 0, 0.002447174185242, 0.009549150281253, 0.020610737385376, - 0.034549150281253, 0.050000000000000, 0.065450849718747, 0.079389262614624, - 0.090450849718747, 0.097552825814758, 0.100000000000000, 0.097552825814758, - 0.090450849718747, 0.079389262614624, 0.065450849718747, 0.050000000000000, - 0.034549150281253, 0.020610737385376, 0.009549150281253, 0.002447174185242 -}; - - -const float taps_lsrc[20] = { // beta = 0.2 - 0.000000000000000, 0.009062686687436, 0.019517618142920, 0.030875041875917, - 0.042552315421249, 0.053912556756416, 0.064308860403517, 0.073130584159352, - 0.079847961304114, 0.084051371489937, 0.085482007518284, 0.084051371489937, - 0.079847961304114, 0.073130584159352, 0.064308860403517, 0.053912556756416, - 0.042552315421249, 0.030875041875917, 0.019517618142920, 0.009062686687436 -}; - - -const float taps_tfm[20] = { - -0.003946522220317, -0.005147757690530, -0.003171631690177, 0.003959659609805, - 0.017498721302356, 0.037346982678383, 0.062251889790391, 0.087364237065604, - 0.110049050955117, 0.125677762224511, 0.132288693729399, 0.125677762224511, - 0.110049050955117, 0.087364237065604, 0.062251889790391, 0.037346982678383, - 0.017498721302356, 0.003959659609805, -0.003171631690177, -0.005147757690530 -}; - - -const float taps_gaussian[20] = { // BT = 0.3 - 0.000000743866524, 0.000009286258371, 0.000085441834550, 0.000581664421923, - 0.002945540765422, 0.011178079812344, 0.032117220937421, 0.070841188736816, - 0.122053715366673, 0.167389736919915, 0.185594670675172, 0.167389736919915, - 0.122053715366673, 0.070841188736816, 0.032117220937421, 0.011178079812344, - 0.002945540765422, 0.000581664421923, 0.000085441834550, 0.000009286258371 -}; - - -// Check LREC phase response -void -qa_gr_cpm::t1 () -{ - std::vector<float> taps(gr_cpm::phase_response(gr_cpm::LREC, samples_per_sym, L)); - - for (int i = 0; i < L * samples_per_sym; i++) { - CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], 0.05, DELTA); - } -} - - -// Check LRC phase response -void -qa_gr_cpm::t2 () -{ - std::vector<float> taps(gr_cpm::phase_response(gr_cpm::LRC, samples_per_sym, L)); - float sum = 0; - - for (int i = 0; i < L * samples_per_sym; i++) { - CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], taps_lrc[i], DELTA); - sum += taps[i]; - } - - CPPUNIT_ASSERT_DOUBLES_EQUAL(sum, 1.0, DELTA); -} - - -// Check LSRC phase response -void -qa_gr_cpm::t3 () -{ - std::vector<float> taps(gr_cpm::phase_response(gr_cpm::LSRC, samples_per_sym, L, 0.2)); - float sum = 0; - - for (int i = 0; i < L * samples_per_sym; i++) { - CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], taps_lsrc[i], DELTA); - sum += taps[i]; - } - - CPPUNIT_ASSERT_DOUBLES_EQUAL(sum, 1.0, DELTA); -} - - -// Check the TFM phase response -void -qa_gr_cpm::t4 () -{ - std::vector<float> taps(gr_cpm::phase_response(gr_cpm::TFM, samples_per_sym, L)); - float sum = 0; - - for (int i = 0; i < L * samples_per_sym; i++) { - CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], taps_tfm[i], DELTA); - sum += taps[i]; - } - - CPPUNIT_ASSERT_DOUBLES_EQUAL(sum, 1.0, DELTA); -} - - -// Check the Gaussian phase response -void -qa_gr_cpm::t5 () -{ - std::vector<float> taps(gr_cpm::phase_response(gr_cpm::GAUSSIAN, samples_per_sym, L, 0.3)); - float sum = 0; - - for (int i = 0; i < L * samples_per_sym; i++) { - CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], taps_gaussian[i], DELTA); - sum += taps[i]; - } - - CPPUNIT_ASSERT_DOUBLES_EQUAL(sum, 1.0, DELTA); -} - diff --git a/gnuradio-core/src/lib/general/qa_gr_cpm.h b/gnuradio-core/src/lib/general/qa_gr_cpm.h deleted file mode 100644 index 2f46b42a78..0000000000 --- a/gnuradio-core/src/lib/general/qa_gr_cpm.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef _QA_GR_CPM_H -#define _QA_GR_CPM_H - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -class qa_gr_cpm : public CppUnit::TestCase { - - CPPUNIT_TEST_SUITE (qa_gr_cpm); - CPPUNIT_TEST (t1); - CPPUNIT_TEST (t2); - CPPUNIT_TEST (t3); - CPPUNIT_TEST (t4); - CPPUNIT_TEST (t5); - CPPUNIT_TEST_SUITE_END (); - - private: - void t1 (); - void t2 (); - void t3 (); - void t4 (); - void t5 (); - -}; - - -#endif /* _QA_GR_CPM_H */ - diff --git a/gnuradio-core/src/lib/gengen/CMakeLists.txt b/gnuradio-core/src/lib/gengen/CMakeLists.txt index ed49cf07e5..03f39d358d 100644 --- a/gnuradio-core/src/lib/gengen/CMakeLists.txt +++ b/gnuradio-core/src/lib/gengen/CMakeLists.txt @@ -84,8 +84,6 @@ endmacro(expand_h_cc_i) expand_h_cc_i(gr_vector_source_X b s i f c) expand_h_cc_i(gr_vector_insert_X b) expand_h_cc_i(gr_vector_sink_X b s i f c) -expand_h_cc_i(gr_noise_source_X s i f c) -expand_h_cc_i(gr_sig_source_X s i f c) expand_h_cc_i(gr_probe_signal_X b s i f c) expand_h_cc_i(gr_probe_signal_vX b s i f c) @@ -155,8 +153,6 @@ list(APPEND gnuradio_core_sources install(FILES ${generated_gengen_includes} ${CMAKE_CURRENT_SOURCE_DIR}/gr_endianness.h - ${CMAKE_CURRENT_SOURCE_DIR}/gr_noise_type.h - ${CMAKE_CURRENT_SOURCE_DIR}/gr_sig_source_waveform.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "core_devel" ) diff --git a/gnuradio-core/src/lib/gengen/generate_common.py b/gnuradio-core/src/lib/gengen/generate_common.py index 37d8944f5b..d04df6bda5 100755 --- a/gnuradio-core/src/lib/gengen/generate_common.py +++ b/gnuradio-core/src/lib/gengen/generate_common.py @@ -32,8 +32,6 @@ ss_signatures = ['s', 'i', 'f', 'c'] ss_roots = [ 'gr_vector_source_X', 'gr_vector_sink_X', - 'gr_noise_source_X', - 'gr_sig_source_X', 'gr_probe_signal_X', 'gr_probe_signal_vX' ] diff --git a/gnuradio-core/src/lib/gengen/gengen.i b/gnuradio-core/src/lib/gengen/gengen.i index d1895bfa83..7d8c27fe68 100644 --- a/gnuradio-core/src/lib/gengen/gengen.i +++ b/gnuradio-core/src/lib/gengen/gengen.i @@ -22,12 +22,8 @@ %{ #include "gr_endianness.h" -#include "gr_sig_source_waveform.h" -#include "gr_noise_type.h" %} %include "gr_endianness.i" -%include "gr_sig_source_waveform.h" -%include "gr_noise_type.h" %include "gengen_generated.i" diff --git a/gnuradio-core/src/lib/gengen/gr_noise_source_X.cc.t b/gnuradio-core/src/lib/gengen/gr_noise_source_X.cc.t deleted file mode 100644 index 3078f6366e..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_noise_source_X.cc.t +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <@NAME@.h> -#include <gr_io_signature.h> -#include <stdexcept> - - -@NAME@_sptr -gr_make_@BASE_NAME@ (gr_noise_type_t type, float ampl, long seed) -{ - return gnuradio::get_initial_sptr(new @NAME@ (type, ampl, seed)); -} - - -@NAME@::@NAME@ (gr_noise_type_t type, float ampl, long seed) - : gr_sync_block ("@BASE_NAME@", - gr_make_io_signature (0, 0, 0), - gr_make_io_signature (1, 1, sizeof (@TYPE@))), - d_type (type), - d_ampl (ampl), - d_rng (seed) -{ -} - -int -@NAME@::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - @TYPE@ *out = (@TYPE@ *) output_items[0]; - - switch (d_type){ -#if @IS_COMPLEX@ // complex? - - case GR_UNIFORM: - for (int i = 0; i < noutput_items; i++) - out[i] = gr_complex (d_ampl * ((d_rng.ran1 () * 2.0) - 1.0), - d_ampl * ((d_rng.ran1 () * 2.0) - 1.0)); - break; - - case GR_GAUSSIAN: - for (int i = 0; i < noutput_items; i++) - out[i] = d_ampl * d_rng.rayleigh_complex (); - break; - -#else // nope... - - case GR_UNIFORM: - for (int i = 0; i < noutput_items; i++) - out[i] = (@TYPE@)(d_ampl * ((d_rng.ran1 () * 2.0) - 1.0)); - break; - - case GR_GAUSSIAN: - for (int i = 0; i < noutput_items; i++) - out[i] = (@TYPE@)(d_ampl * d_rng.gasdev ()); - break; - - case GR_LAPLACIAN: - for (int i = 0; i < noutput_items; i++) - out[i] = (@TYPE@)(d_ampl * d_rng.laplacian ()); - break; - - case GR_IMPULSE: // FIXME changeable impulse settings - for (int i = 0; i < noutput_items; i++) - out[i] = (@TYPE@)(d_ampl * d_rng.impulse (9)); - break; -#endif - - default: - throw std::runtime_error ("invalid type"); - } - - return noutput_items; -} diff --git a/gnuradio-core/src/lib/gengen/gr_noise_source_X.h.t b/gnuradio-core/src/lib/gengen/gr_noise_source_X.h.t deleted file mode 100644 index 31ffb2b169..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_noise_source_X.h.t +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -#ifndef @GUARD_NAME@ -#define @GUARD_NAME@ - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_noise_type.h> -#include <gr_random.h> - - -class @NAME@; -typedef boost::shared_ptr<@NAME@> @NAME@_sptr; - -/*! \brief Make a noise source - * \param type the random distribution to use (see gr_noise_type.h) - * \param ampl a scaling factor for the output - * \param seed seed for random generators. Note that for uniform and - * Gaussian distributions, this should be a negative number. - */ -GR_CORE_API @NAME@_sptr -gr_make_@BASE_NAME@ (gr_noise_type_t type, float ampl, long seed = 0); - -/*! - * \brief Random number source - * \ingroup source_blk - * - * \details - * Generate random values from different distributions. - * Currently, only Gaussian and uniform are enabled. - * - * \param type the random distribution to use (see gr_noise_type.h) - * \param ampl a scaling factor for the output - * \param seed seed for random generators. Note that for uniform and - * Gaussian distributions, this should be a negative number. - */ -class GR_CORE_API @NAME@ : public gr_sync_block { - friend GR_CORE_API @NAME@_sptr - - gr_make_@BASE_NAME@ (gr_noise_type_t type, float ampl, long seed); - - gr_noise_type_t d_type; - float d_ampl; - gr_random d_rng; - - @NAME@ (gr_noise_type_t type, float ampl, long seed = 0); - - public: - void set_type (gr_noise_type_t type) { d_type = type; } - void set_amplitude (float ampl) { d_ampl = ampl; } - - gr_noise_type_t type () const { return d_type; } - float amplitude () const { return d_ampl; } - - virtual int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - - -#endif diff --git a/gnuradio-core/src/lib/gengen/gr_noise_source_X.i.t b/gnuradio-core/src/lib/gengen/gr_noise_source_X.i.t deleted file mode 100644 index df27ab79b6..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_noise_source_X.i.t +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@); - -@NAME@_sptr -gr_make_@BASE_NAME@ (gr_noise_type_t type, float ampl, long seed = 0); - -class @NAME@ : public gr_block { - private: - @NAME@ (gr_noise_type_t type, float ampl, long seed = 0); - - public: - void set_type (gr_noise_type_t type) { d_type = type; } - void set_amplitude (float ampl) { d_ampl = ampl; } - - gr_noise_type_t type () const { return d_type; } - float amplitude () const { return d_ampl; } -}; diff --git a/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t b/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t deleted file mode 100644 index 6959eac824..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t +++ /dev/null @@ -1,241 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif -#include <@NAME@.h> -#include <algorithm> -#include <gr_io_signature.h> -#include <stdexcept> -#include <algorithm> -#include <gr_complex.h> - - -@NAME@::@NAME@ (double sampling_freq, gr_waveform_t waveform, - double frequency, double ampl, @TYPE@ offset) - : gr_sync_block ("@BASE_NAME@", - gr_make_io_signature (0, 0, 0), - gr_make_io_signature (1, 1, sizeof (@TYPE@))), - d_sampling_freq (sampling_freq), d_waveform (waveform), d_frequency (frequency), - d_ampl (ampl), d_offset (offset) -{ - d_nco.set_freq (2 * M_PI * d_frequency / d_sampling_freq); -} - -@NAME@_sptr -gr_make_@BASE_NAME@ (double sampling_freq, gr_waveform_t waveform, - double frequency, double ampl, @TYPE@ offset) -{ - return gnuradio::get_initial_sptr(new @NAME@ (sampling_freq, waveform, frequency, ampl, offset)); -} - -int -@NAME@::work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) -{ - @TYPE@ *optr = (@TYPE@ *) output_items[0]; - @TYPE@ t; - - switch (d_waveform){ - -#if @IS_COMPLEX@ // complex? - - case GR_CONST_WAVE: - t = (gr_complex) d_ampl + d_offset; - std::fill_n(optr, noutput_items, t); - break; - - case GR_SIN_WAVE: - case GR_COS_WAVE: - d_nco.sincos (optr, noutput_items, d_ampl); - if (d_offset == gr_complex(0,0)) - break; - - for (int i = 0; i < noutput_items; i++){ - optr[i] += d_offset; - } - break; - - /* Implements a real square wave high from -PI to 0. - * The imaginary square wave leads by 90 deg. - */ - case GR_SQR_WAVE: - for (int i = 0; i < noutput_items; i++){ - if (d_nco.get_phase() < -1*M_PI/2) - optr[i] = gr_complex(d_ampl, 0)+d_offset; - else if (d_nco.get_phase() < 0) - optr[i] = gr_complex(d_ampl, d_ampl)+d_offset; - else if (d_nco.get_phase() < M_PI/2) - optr[i] = gr_complex(0, d_ampl)+d_offset; - else - optr[i] = d_offset; - d_nco.step(); - } - break; - - /* Implements a real triangle wave rising from -PI to 0 and - * falling from 0 to PI. The imaginary triangle wave leads by 90 deg. - */ - case GR_TRI_WAVE: - for (int i = 0; i < noutput_items; i++){ - if (d_nco.get_phase() < -1*M_PI/2){ - optr[i] = gr_complex(d_ampl*d_nco.get_phase()/M_PI + d_ampl, - -1*d_ampl*d_nco.get_phase()/M_PI - d_ampl/2)+d_offset; - } - else if (d_nco.get_phase() < 0){ - optr[i] = gr_complex(d_ampl*d_nco.get_phase()/M_PI + d_ampl, - d_ampl*d_nco.get_phase()/M_PI + d_ampl/2)+d_offset; - } - else if (d_nco.get_phase() < M_PI/2){ - optr[i] = gr_complex(-1*d_ampl*d_nco.get_phase()/M_PI + d_ampl, - d_ampl*d_nco.get_phase()/M_PI + d_ampl/2)+d_offset; - } - else{ - optr[i] = gr_complex(-1*d_ampl*d_nco.get_phase()/M_PI + d_ampl, - -1*d_ampl*d_nco.get_phase()/M_PI + 3*d_ampl/2)+d_offset; - } - d_nco.step(); - } - break; - - /* Implements a real saw tooth wave rising from -PI to PI. - * The imaginary saw tooth wave leads by 90 deg. - */ - case GR_SAW_WAVE: - for (int i = 0; i < noutput_items; i++){ - if (d_nco.get_phase() < -1*M_PI/2){ - optr[i] = gr_complex(d_ampl*d_nco.get_phase()/(2*M_PI) + d_ampl/2, - d_ampl*d_nco.get_phase()/(2*M_PI) + 5*d_ampl/4)+d_offset; - } - else{ - optr[i] = gr_complex(d_ampl*d_nco.get_phase()/(2*M_PI) + d_ampl/2, - d_ampl*d_nco.get_phase()/(2*M_PI) + d_ampl/4)+d_offset; - } - d_nco.step(); - } - break; - -#else // nope... - - case GR_CONST_WAVE: - t = (@TYPE@) d_ampl + d_offset; - std::fill_n(optr, noutput_items, t); - break; - - case GR_SIN_WAVE: - d_nco.sin (optr, noutput_items, d_ampl); - if (d_offset == 0) - break; - - for (int i = 0; i < noutput_items; i++){ - optr[i] += d_offset; - } - break; - - case GR_COS_WAVE: - d_nco.cos (optr, noutput_items, d_ampl); - if (d_offset == 0) - break; - - for (int i = 0; i < noutput_items; i++){ - optr[i] += d_offset; - } - break; - - /* The square wave is high from -PI to 0. */ - case GR_SQR_WAVE: - t = (@TYPE@) d_ampl + d_offset; - for (int i = 0; i < noutput_items; i++){ - if (d_nco.get_phase() < 0) - optr[i] = t; - else - optr[i] = d_offset; - d_nco.step(); - } - break; - - /* The triangle wave rises from -PI to 0 and falls from 0 to PI. */ - case GR_TRI_WAVE: - for (int i = 0; i < noutput_items; i++){ - double t = d_ampl*d_nco.get_phase()/M_PI; - if (d_nco.get_phase() < 0) - optr[i] = static_cast<@TYPE@>(t + d_ampl + d_offset); - else - optr[i] = static_cast<@TYPE@>(-1*t + d_ampl + d_offset); - d_nco.step(); - } - break; - - /* The saw tooth wave rises from -PI to PI. */ - case GR_SAW_WAVE: - for (int i = 0; i < noutput_items; i++){ - t = static_cast<@TYPE@>(d_ampl*d_nco.get_phase()/(2*M_PI) + d_ampl/2 + d_offset); - optr[i] = t; - d_nco.step(); - } - break; - -#endif - - default: - throw std::runtime_error ("gr_sig_source: invalid waveform"); - } - - return noutput_items; -} - -void -@NAME@::set_sampling_freq (double sampling_freq) -{ - d_sampling_freq = sampling_freq; - d_nco.set_freq (2 * M_PI * d_frequency / d_sampling_freq); -} - -void -@NAME@::set_waveform (gr_waveform_t waveform) -{ - d_waveform = waveform; -} - -void -@NAME@::set_frequency (double frequency) -{ - d_frequency = frequency; - d_nco.set_freq (2 * M_PI * d_frequency / d_sampling_freq); -} - -void -@NAME@::set_amplitude (double ampl) -{ - d_ampl = ampl; -} - -void -@NAME@::set_offset (@TYPE@ offset) -{ - d_offset = offset; -} - diff --git a/gnuradio-core/src/lib/gengen/gr_sig_source_X.h.t b/gnuradio-core/src/lib/gengen/gr_sig_source_X.h.t deleted file mode 100644 index baa82dbe20..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_sig_source_X.h.t +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -#ifndef @GUARD_NAME@ -#define @GUARD_NAME@ - -#include <gr_core_api.h> -#include <gr_sync_block.h> -#include <gr_sig_source_waveform.h> -#include <gr_fxpt_nco.h> - -class @NAME@; -typedef boost::shared_ptr<@NAME@> @NAME@_sptr; - -/*! - * \brief signal generator with @TYPE@ output. - * \ingroup source_blk - */ - -class GR_CORE_API @NAME@ : public gr_sync_block { - friend GR_CORE_API @NAME@_sptr - gr_make_@BASE_NAME@ (double sampling_freq, gr_waveform_t waveform, - double frequency, double ampl, @TYPE@ offset); - - double d_sampling_freq; - gr_waveform_t d_waveform; - double d_frequency; - double d_ampl; - @TYPE@ d_offset; - gr_fxpt_nco d_nco; - - - @NAME@ (double sampling_freq, gr_waveform_t waveform, - double wave_freq, double ampl, @TYPE@ offset); - - public: - virtual int work (int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - // ACCESSORS - double sampling_freq () const { return d_sampling_freq; } - gr_waveform_t waveform () const { return d_waveform; } - double frequency () const { return d_frequency; } - double amplitude () const { return d_ampl; } - @TYPE@ offset () const { return d_offset; } - - // MANIPULATORS - void set_sampling_freq (double sampling_freq); - void set_waveform (gr_waveform_t waveform); - void set_frequency (double frequency); - void set_amplitude (double ampl); - void set_offset (@TYPE@ offset); -}; - -GR_CORE_API @NAME@_sptr -gr_make_@BASE_NAME@ (double sampling_freq, gr_waveform_t waveform, - double wave_freq, double ampl, @TYPE@ offset = 0); - - -#endif diff --git a/gnuradio-core/src/lib/gengen/gr_sig_source_X.i.t b/gnuradio-core/src/lib/gengen/gr_sig_source_X.i.t deleted file mode 100644 index 7bd85fcb81..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_sig_source_X.i.t +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -// @WARNING@ - -GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@); - -@NAME@_sptr -gr_make_@BASE_NAME@ (double sampling_freq, gr_waveform_t waveform, - double wave_freq, double ampl, @TYPE@ offset = 0); - - -class @NAME@ : public gr_sync_block { - private: - @NAME@ (double sampling_freq, gr_waveform_t waveform, - double wave_freq, double ampl, @TYPE@ offset); - - public: - - // ACCESSORS - double sampling_freq () const { return d_sampling_freq; } - gr_waveform_t waveform () const { return d_waveform; } - double frequency () const { return d_frequency; } - double amplitude () const { return d_ampl; } - @TYPE@ offset () const { return d_offset; } - - // MANIPULATORS - void set_sampling_freq (double sampling_freq); - void set_waveform (gr_waveform_t waveform); - void set_frequency (double frequency); - void set_amplitude (double ampl); - void set_offset (@TYPE@ offset); -}; diff --git a/gnuradio-core/src/lib/gengen/gr_sig_source_waveform.h b/gnuradio-core/src/lib/gengen/gr_sig_source_waveform.h deleted file mode 100644 index 9fe233ba4a..0000000000 --- a/gnuradio-core/src/lib/gengen/gr_sig_source_waveform.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ -#ifndef INCLUDED_GR_SIG_SOURCE_WAVEFORM_H -#define INCLUDED_GR_SIG_SOURCE_WAVEFORM_H - -typedef enum { - GR_CONST_WAVE = 100, GR_SIN_WAVE, GR_COS_WAVE, GR_SQR_WAVE, GR_TRI_WAVE, GR_SAW_WAVE -} gr_waveform_t; - -#endif /* INCLUDED_GR_SIG_SOURCE_WAVEFORM_H */ diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/CMakeLists.txt b/gnuradio-core/src/python/gnuradio/blks2impl/CMakeLists.txt index b8ec6c88c4..dae287ca3a 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/CMakeLists.txt +++ b/gnuradio-core/src/python/gnuradio/blks2impl/CMakeLists.txt @@ -21,19 +21,9 @@ include(GrPython) GR_PYTHON_INSTALL(FILES __init__.py - am_demod.py filterbank.py - fm_demod.py - fm_emph.py - nbfm_rx.py - nbfm_tx.py rational_resampler.py - standard_squelch.py stream_to_vector_decimator.py - wfm_rcv.py - wfm_rcv_fmdet.py - wfm_rcv_pll.py - wfm_tx.py DESTINATION ${GR_PYTHON_DIR}/gnuradio/blks2impl COMPONENT "core_python" ) diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_agc.py b/gnuradio-core/src/python/gnuradio/gr/qa_agc.py deleted file mode 100755 index 9fd633576e..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_agc.py +++ /dev/null @@ -1,433 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2007,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest -import math - -test_output = False - -class test_agc (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - - def test_001(self): - ''' Test the complex AGC loop (single rate input) ''' - tb = self.tb - - expected_result = ( - (100.000244140625+7.2191943445432116e-07j), - (72.892257690429688+52.959323883056641j), - (25.089065551757812+77.216217041015625j), - (-22.611061096191406+69.589706420898438j), - (-53.357715606689453+38.766635894775391j), - (-59.458671569824219+3.4792964243024471e-07j), - (-43.373462677001953-31.512666702270508j), - (-14.94139289855957-45.984889984130859j), - (13.478158950805664-41.48150634765625j), - (31.838506698608398-23.132022857666016j), - (35.519271850585938-3.1176801940091536e-07j), - (25.942903518676758+18.848621368408203j), - (8.9492912292480469+27.5430908203125j), - (-8.0852642059326172+24.883890151977539j), - (-19.131628036499023+13.899936676025391j), - (-21.383295059204102+3.1281737733479531e-07j), - (-15.650330543518066-11.370632171630859j), - (-5.4110145568847656-16.65339469909668j), - (4.9008159637451172-15.083160400390625j), - (11.628337860107422-8.4484796524047852j), - (13.036135673522949-2.288476110834381e-07j), - (9.5726661682128906+6.954948902130127j), - (3.3216962814331055+10.223132133483887j), - (-3.0204284191131592+9.2959251403808594j), - (-7.1977195739746094+5.2294478416442871j), - (-8.1072216033935547+1.8976157889483147e-07j), - (-5.9838657379150391-4.3475332260131836j), - (-2.0879747867584229-6.4261269569396973j), - (1.9100792407989502-5.8786196708679199j), - (4.5814824104309082-3.3286411762237549j), - (5.1967458724975586-1.3684227440080576e-07j), - (3.8647139072418213+2.8078789710998535j), - (1.3594740629196167+4.1840314865112305j), - (-1.2544282674789429+3.8607344627380371j), - (-3.0366206169128418+2.2062335014343262j), - (-3.4781389236450195+1.1194014604143376e-07j), - (-2.6133756637573242-1.8987287282943726j), - (-0.9293016791343689-2.8600969314575195j), - (0.86727333068847656-2.6691930294036865j), - (2.1243946552276611-1.5434627532958984j), - (2.4633183479309082-8.6486437567145913e-08j), - (1.8744727373123169+1.3618841171264648j), - (0.67528903484344482+2.0783262252807617j), - (-0.63866174221038818+1.965599536895752j), - (-1.5857341289520264+1.152103066444397j), - (-1.8640764951705933+7.6355092915036948e-08j), - (-1.4381576776504517-1.0448826551437378j), - (-0.52529704570770264-1.6166983842849731j), - (0.50366902351379395-1.5501341819763184j), - (1.26766037940979-0.92100900411605835j)) - - sampling_freq = 100 - src1 = gr.sig_source_c (sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100.0) - dst1 = gr.vector_sink_c () - head = gr.head (gr.sizeof_gr_complex, int (5*sampling_freq * 0.10)) - - agc = gr.agc_cc(1e-3, 1, 1, 1000) - - tb.connect (src1, head) - tb.connect (head, agc) - tb.connect (agc, dst1) - - if test_output == True: - tb.connect (agc, gr.file_sink(gr.sizeof_gr_complex, "test_agc_cc.dat")) - - tb.run () - dst_data = dst1.data () - self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 4) - - def test_002(self): - ''' Test the floating point AGC loop (single rate input) ''' - tb = self.tb - - expected_result = ( - 7.2191943445432116e-07, - 58.837181091308594, - 89.700050354003906, - 81.264183044433594, - 45.506141662597656, - 4.269894304798072e-07, - -42.948936462402344, - -65.50335693359375, - -59.368724822998047, - -33.261005401611328, - -4.683740257860336e-07, - 31.423542022705078, - 47.950984954833984, - 43.485683441162109, - 24.378345489501953, - 5.7254135299444897e-07, - -23.062990188598633, - -35.218441009521484, - -31.964075088500977, - -17.934831619262695, - -5.0591745548445033e-07, - 16.998210906982422, - 25.982204437255859, - 23.606258392333984, - 13.260685920715332, - 4.9936483037527069e-07, - -12.59880542755127, - -19.28221321105957, - -17.54347038269043, - -9.8700437545776367, - -4.188150626305287e-07, - 9.4074573516845703, - 14.422011375427246, - 13.145503044128418, - 7.41046142578125, - 3.8512698097292741e-07, - -7.0924453735351562, - -10.896408081054688, - -9.9552040100097656, - -5.6262712478637695, - -3.1982864356905338e-07, - 5.4131259918212891, - 8.3389215469360352, - 7.6409502029418945, - 4.3320145606994629, - 2.882407841298118e-07, - -4.194943904876709, - -6.4837145805358887, - -5.9621825218200684, - -3.3931560516357422) - - sampling_freq = 100 - src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100.0) - dst1 = gr.vector_sink_f () - head = gr.head (gr.sizeof_float, int (5*sampling_freq * 0.10)) - - agc = gr.agc_ff(1e-3, 1, 1, 1000) - - tb.connect (src1, head) - tb.connect (head, agc) - tb.connect (agc, dst1) - - if test_output == True: - tb.connect (agc, gr.file_sink(gr.sizeof_float, "test_agc_ff.dat")) - - tb.run () - dst_data = dst1.data () - self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 4) - - def test_003(self): - ''' Test the complex AGC loop (attack and decay rate inputs) ''' - tb = self.tb - - expected_result = \ - ((100.000244140625+7.2191943445432116e-07j), - (0.80881959199905396+0.58764183521270752j), - (0.30894950032234192+0.95084899663925171j), - (-0.30895623564720154+0.95086973905563354j), - (-0.80887287855148315+0.58768033981323242j), - (-0.99984413385391235+5.850709250410091e-09j), - (-0.80889981985092163-0.58770018815994263j), - (-0.30897706747055054-0.95093393325805664j), - (0.30898112058639526-0.95094609260559082j), - (0.80893135070800781-0.58772283792495728j), - (0.99990922212600708-8.7766354184282136e-09j), - (0.80894720554351807+0.58773452043533325j), - (0.30899339914321899+0.95098406076431274j), - (-0.30899572372436523+0.95099133253097534j), - (-0.80896598100662231+0.58774799108505249j), - (-0.99994778633117676+1.4628290578855285e-08j), - (-0.80897533893585205-0.58775502443313599j), - (-0.30900305509567261-0.95101380348205566j), - (0.30900448560714722-0.95101797580718994j), - (0.80898630619049072-0.58776277303695679j), - (0.99997037649154663-1.7554345532744264e-08j), - (0.80899184942245483+0.58776694536209106j), - (0.30900871753692627+0.95103120803833008j), - (-0.30900952219963074+0.95103377103805542j), - (-0.8089984655380249+0.58777159452438354j), - (-0.99998390674591064+2.3406109050938539e-08j), - (-0.809001624584198-0.58777409791946411j), - (-0.30901208519935608-0.95104163885116577j), - (0.30901262164115906-0.95104306936264038j), - (0.80900543928146362-0.587776780128479j), - (0.99999171495437622-2.6332081404234486e-08j), - (0.80900734663009644+0.58777821063995361j), - (0.30901408195495605+0.95104765892028809j), - (-0.30901429057121277+0.95104855298995972j), - (-0.80900967121124268+0.58777981996536255j), - (-0.99999648332595825+3.2183805842578295e-08j), - (-0.80901080369949341-0.58778077363967896j), - (-0.30901527404785156-0.95105135440826416j), - (0.30901545286178589-0.95105189085006714j), - (0.80901217460632324-0.58778166770935059j), - (0.99999916553497314-3.5109700036173308e-08j), - (0.809012770652771+0.58778214454650879j), - (0.30901595950126648+0.9510534405708313j), - (-0.30901598930358887+0.95105385780334473j), - (-0.80901366472244263+0.58778274059295654j), - (-1.0000008344650269+4.0961388947380328e-08j), - (-0.8090139627456665-0.58778303861618042j), - (-0.30901634693145752-0.95105475187301636j), - (0.30901640653610229-0.95105493068695068j), - (0.80901449918746948-0.5877833366394043j)) - - sampling_freq = 100 - src1 = gr.sig_source_c (sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100) - dst1 = gr.vector_sink_c () - head = gr.head (gr.sizeof_gr_complex, int (5*sampling_freq * 0.10)) - - agc = gr.agc2_cc(1e-2, 1e-3, 1, 1, 1000) - - tb.connect (src1, head) - tb.connect (head, agc) - tb.connect (agc, dst1) - - if test_output == True: - tb.connect (agc, gr.file_sink(gr.sizeof_gr_complex, "test_agc2_cc.dat")) - - tb.run () - dst_data = dst1.data () - self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 4) - - def test_004(self): - ''' Test the floating point AGC loop (attack and decay rate inputs) ''' - tb = self.tb - - expected_result = \ - (7.2191943445432116e-07, - 58.837181091308594, - 40.194305419921875, - 2.9183335304260254, - 0.67606079578399658, - 8.6260438791896377e-09, - -1.4542514085769653, - -1.9210131168365479, - -1.0450780391693115, - -0.61939650774002075, - -1.2590258613442984e-08, - 1.4308931827545166, - 1.9054338932037354, - 1.0443156957626343, - 0.61937344074249268, - 2.0983527804219193e-08, - -1.4308838844299316, - -1.9054274559020996, - -1.0443152189254761, - -0.61937344074249268, - -2.5180233009791664e-08, - 1.4308837652206421, - 1.9054274559020996, - 1.0443154573440552, - 0.61937344074249268, - 3.3573645197293445e-08, - -1.4308838844299316, - -1.9054274559020996, - -1.0443152189254761, - -0.61937350034713745, - -3.7770352179222755e-08, - 1.4308837652206421, - 1.9054274559020996, - 1.0443154573440552, - 0.61937350034713745, - 4.6163762590367696e-08, - -1.4308838844299316, - -1.9054274559020996, - -1.0443153381347656, - -0.61937344074249268, - -5.0360466019583328e-08, - 1.4308837652206421, - 1.9054274559020996, - 1.0443155765533447, - 0.61937344074249268, - 5.8753879983441948e-08, - -1.4308837652206421, - -1.9054274559020996, - -1.0443153381347656, - -0.61937344074249268) - - sampling_freq = 100 - src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100) - dst1 = gr.vector_sink_f () - head = gr.head (gr.sizeof_float, int (5*sampling_freq * 0.10)) - - agc = gr.agc2_ff(1e-2, 1e-3, 1, 1, 1000) - - tb.connect (src1, head) - tb.connect (head, agc) - tb.connect (agc, dst1) - - if test_output == True: - tb.connect (agc, gr.file_sink(gr.sizeof_float, "test_agc2_ff.dat")) - - tb.run () - dst_data = dst1.data () - self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 4) - - - def test_005(self): - ''' Test the complex AGC loop (attack and decay rate inputs) ''' - tb = self.tb - - expected_result = \ - ((100.000244140625+7.2191943445432116e-07j), - (0.80881959199905396+0.58764183521270752j), - (0.30894950032234192+0.95084899663925171j), - (-0.30895623564720154+0.95086973905563354j), - (-0.80887287855148315+0.58768033981323242j), - (-0.99984413385391235+5.850709250410091e-09j), - (-0.80889981985092163-0.58770018815994263j), - (-0.30897706747055054-0.95093393325805664j), - (0.30898112058639526-0.95094609260559082j), - (0.80893135070800781-0.58772283792495728j), - (0.99990922212600708-8.7766354184282136e-09j), - (0.80894720554351807+0.58773452043533325j), - (0.30899339914321899+0.95098406076431274j), - (-0.30899572372436523+0.95099133253097534j), - (-0.80896598100662231+0.58774799108505249j), - (-0.99994778633117676+1.4628290578855285e-08j), - (-0.80897533893585205-0.58775502443313599j), - (-0.30900305509567261-0.95101380348205566j), - (0.30900448560714722-0.95101797580718994j), - (0.80898630619049072-0.58776277303695679j), - (0.99997037649154663-1.7554345532744264e-08j), - (0.80899184942245483+0.58776694536209106j), - (0.30900871753692627+0.95103120803833008j), - (-0.30900952219963074+0.95103377103805542j), - (-0.8089984655380249+0.58777159452438354j), - (-0.99998390674591064+2.3406109050938539e-08j), - (-0.809001624584198-0.58777409791946411j), - (-0.30901208519935608-0.95104163885116577j), - (0.30901262164115906-0.95104306936264038j), - (0.80900543928146362-0.587776780128479j), - (0.99999171495437622-2.6332081404234486e-08j), - (0.80900734663009644+0.58777821063995361j), - (0.30901408195495605+0.95104765892028809j), - (-0.30901429057121277+0.95104855298995972j), - (-0.80900967121124268+0.58777981996536255j), - (-0.99999648332595825+3.2183805842578295e-08j), - (-0.80901080369949341-0.58778077363967896j), - (-0.30901527404785156-0.95105135440826416j), - (0.30901545286178589-0.95105189085006714j), - (0.80901217460632324-0.58778166770935059j), - (0.99999916553497314-3.5109700036173308e-08j), - (0.809012770652771+0.58778214454650879j), - (0.30901595950126648+0.9510534405708313j), - (-0.30901598930358887+0.95105385780334473j), - (-0.80901366472244263+0.58778274059295654j), - (-1.0000008344650269+4.0961388947380328e-08j), - (-0.8090139627456665-0.58778303861618042j), - (-0.30901634693145752-0.95105475187301636j), - (0.30901640653610229-0.95105493068695068j), - (0.80901449918746948-0.5877833366394043j)) - - sampling_freq = 100 - src1 = gr.sig_source_c (sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100) - dst1 = gr.vector_sink_c () - head = gr.head (gr.sizeof_gr_complex, int (5*sampling_freq * 0.10)) - - agc = gr.agc2_cc(1e-2, 1e-3, 1, 1, 1000) - - tb.connect (src1, head) - tb.connect (head, agc) - tb.connect (agc, dst1) - - if test_output == True: - tb.connect (agc, gr.file_sink(gr.sizeof_gr_complex, "test_agc2_cc.dat")) - - tb.run () - dst_data = dst1.data () - self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 4) - - - def test_100(self): # FIXME needs work - ''' Test complex feedforward agc with constant input ''' - input_data = 16*(0.0,) + 64*(1.0,) + 64*(0.0,) - expected_result = () - - src = gr.vector_source_c(input_data) - agc = gr.feedforward_agc_cc(16, 2.0) - dst = gr.vector_sink_c () - self.tb.connect (src, agc, dst) - - if test_output == True: - self.tb.connect (agc, gr.file_sink(gr.sizeof_gr_complex, "test_feedforward_cc.dat")) - - self.tb.run () - dst_data = dst.data () - #self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 4) - - -if __name__ == '__main__': - gr_unittest.run(test_agc, "test_agc.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_frequency_modulator.py b/gnuradio-core/src/python/gnuradio/gr/qa_frequency_modulator.py deleted file mode 100755 index 23459fff3f..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_frequency_modulator.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2007,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest -import math - -def sincos(x): - return math.cos(x) + math.sin(x) * 1j - - -class test_frequency_modulator (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_fm_001 (self): - pi = math.pi - sensitivity = pi/4 - src_data = (1.0/4, 1.0/2, 1.0/4, -1.0/4, -1.0/2, -1/4.0) - running_sum = (pi/16, 3*pi/16, pi/4, 3*pi/16, pi/16, 0) - expected_result = tuple ([sincos (x) for x in running_sum]) - src = gr.vector_source_f (src_data) - op = gr.frequency_modulator_fc (sensitivity) - dst = gr.vector_sink_c () - self.tb.connect (src, op) - self.tb.connect (op, dst) - self.tb.run () - result_data = dst.data () - self.assertComplexTuplesAlmostEqual (expected_result, result_data, 5) - - -if __name__ == '__main__': - gr_unittest.run(test_frequency_modulator, "test_frequency_modulator.xml") - diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_noise.py b/gnuradio-core/src/python/gnuradio/gr/qa_noise.py deleted file mode 100755 index e875191507..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_noise.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2007,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest - -class test_noise_source(gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_001(self): - # Just confirm that we can instantiate a noise source - op = gr.noise_source_f(gr.GR_GAUSSIAN, 10, 10) - - def test_002(self): - # Test get methods - set_type = gr.GR_GAUSSIAN - set_ampl = 10 - op = gr.noise_source_f(set_type, set_ampl, 10) - get_type = op.type() - get_ampl = op.amplitude() - - self.assertEqual(get_type, set_type) - self.assertEqual(get_ampl, set_ampl) - - -if __name__ == '__main__': - gr_unittest.run(test_noise_source, "test_noise_source.xml") - diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pll_carriertracking.py b/gnuradio-core/src/python/gnuradio/gr/qa_pll_carriertracking.py deleted file mode 100755 index 8964db53db..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_pll_carriertracking.py +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2007,2010,2011 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest -import math - -class test_pll_carriertracking (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block() - - def tearDown (self): - self.tb = None - - def test_pll_carriertracking (self): - expected_result = ((1.00000238419+7.21919457547e-09j), - (0.998025715351+0.062790453434j), - (0.992777824402+0.119947694242j), - (0.985192835331+0.171441286802j), - (0.976061582565+0.217501848936j), - (0.966034710407+0.258409559727j), - (0.95565611124+0.294477283955j), - (0.945357382298+0.326030552387j), - (0.935475051403+0.353395611048j), - (0.926258146763+0.376889169216j), - (0.917895197868+0.39681750536j), - (0.910515546799+0.413470208645j), - (0.904196679592+0.427117019892j), - (0.898972511292+0.438006043434j), - (0.894769787788+0.446523308754j), - (0.891652584076+0.452715367079j), - (0.8895829916+0.456773489714j), - (0.888502895832+0.458873122931j), - (0.888343691826+0.459175437689j), - (0.889035582542+0.457833081484j), - (0.890497922897+0.454985737801j), - (0.892645597458+0.450762689114j), - (0.895388305187+0.445282936096j), - (0.898648142815+0.438664674759j), - (0.902342617512+0.431016951799j), - (0.906392872334+0.422441422939j), - (0.910642921925+0.413191765547j), - (0.915039420128+0.403358519077j), - (0.919594764709+0.392864197493j), - (0.92425006628+0.381792247295j), - (0.928944349289+0.370217680931j), - (0.933634519577+0.358220815659j), - (0.938279032707+0.345874190331j), - (0.942840516567+0.333247303963j), - (0.947280526161+0.32040438056j), - (0.951574921608+0.307409763336j), - (0.955703914165+0.294323593378j), - (0.959648966789+0.281201630831j), - (0.963392794132+0.268095195293j), - (0.966880619526+0.255221515894j), - (0.970162451267+0.242447137833j), - (0.973235487938+0.229809194803j), - (0.97609680891+0.217341512442j), - (0.978744983673+0.20507311821j), - (0.981189727783+0.193033605814j), - (0.983436584473+0.181248426437j), - (0.985490739346+0.169738590717j), - (0.987353682518+0.158523857594j), - (0.989041447639+0.147622272372j), - (0.990563035011+0.137049794197j), - (0.991928339005+0.126818582416j), - (0.993117690086+0.117111675441j), - (0.994156062603+0.107930034399j), - (0.995076179504+0.0990980416536j), - (0.995887458324+0.0906178802252j), - (0.996591091156+0.0824909061193j), - (0.997202515602+0.0747182965279j), - (0.997730851173+0.0672992765903j), - (0.998185396194+0.0602316558361j), - (0.99856698513+0.0535135567188j), - (0.998885989189+0.0471420884132j), - (0.99915266037+0.0411129891872j), - (0.999372899532+0.0354214012623j), - (0.999548316002+0.0300626158714j), - (0.999680638313+0.0252036750317j), - (0.999784469604+0.020652115345j), - (0.999865531921+0.0163950324059j), - (0.999923825264+0.0124222636223j), - (0.999960243702+0.00872156023979j), - (0.999983668327+0.00528120994568j), - (0.999997138977+0.00209015607834j), - (1.00000119209-0.00086285173893j), - (0.999992132187-0.00358882546425j), - (0.999979138374-0.00609711557627j), - (0.999963641167-0.00839691981673j), - (0.999947249889-0.0104993218556j), - (0.999924004078-0.0122378543019j), - (0.999904811382-0.0136305987835j), - (0.999888062477-0.0148707330227j), - (0.9998742342-0.0159679055214j), - (0.999856114388-0.0169314742088j), - (0.999839782715-0.0177700817585j), - (0.999826967716-0.0184917747974j), - (0.999818325043-0.0191045701504j), - (0.999807476997-0.0196143388748j), - (0.999797284603-0.0200265944004j), - (0.999791204929-0.0203481912613j), - (0.99978852272-0.0205836892128j), - (0.99978530407-0.0207380950451j), - (0.999785065651-0.0206423997879j), - (0.999787807465-0.0204866230488j), - (0.999794304371-0.0202808082104j), - (0.999800384045-0.0200312435627j), - (0.999803245068-0.0197458267212j), - (0.9998087883-0.0194311738014j), - (0.999816894531-0.0190933048725j), - (0.999825954437-0.0187371373177j), - (0.999829888344-0.0183679759502j), - (0.999835848808-0.017987690866j), - (0.999844014645-0.0176006518304j)) - - sampling_freq = 10e3 - freq = sampling_freq / 100 - - loop_bw = math.pi/100.0 - maxf = 1 - minf = -1 - - src = gr.sig_source_c (sampling_freq, gr.GR_COS_WAVE, freq, 1.0) - pll = gr.pll_carriertracking_cc(loop_bw, maxf, minf) - head = gr.head (gr.sizeof_gr_complex, int (freq)) - dst = gr.vector_sink_c () - - self.tb.connect (src, pll, head) - self.tb.connect (head, dst) - - self.tb.run () - dst_data = dst.data () - self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5) - -if __name__ == '__main__': - gr_unittest.run(test_pll_carriertracking, "test_pll_carriertracking.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pll_freqdet.py b/gnuradio-core/src/python/gnuradio/gr/qa_pll_freqdet.py deleted file mode 100755 index 219e9b84b6..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_pll_freqdet.py +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2007,2010,2011 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest -import math - -class test_pll_freqdet (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block() - - def tearDown (self): - self.tb = None - - def test_pll_freqdet (self): - expected_result = (0.0, - 4.33888922882e-08, - 0.367369994515, - 1.08135249597, - 2.10983253908, - 3.42221529438, - 4.98940390402, - 6.78379190842, - 8.77923286024, - 10.9510106794, - 13.2758363182, - 15.7317829127, - 18.2982902299, - 20.9561068599, - 23.6755271122, - 26.452952094, - 29.2731265301, - 32.1219053479, - 34.9862418188, - 37.8540971414, - 40.7144315483, - 43.5571390869, - 46.3730179743, - 49.1537231663, - 51.8917218889, - 54.58026103, - 57.2015358514, - 59.7513664199, - 62.2380533124, - 64.657612252, - 67.006640002, - 69.2822432184, - 71.4820384499, - 73.6041047056, - 75.6469478817, - 77.6094829742, - 79.4909866472, - 81.2911031615, - 83.0097850853, - 84.6355598352, - 86.1820937186, - 87.6504420946, - 89.0418441206, - 90.3577286819, - 91.5996432431, - 92.7692775646, - 93.8684162704, - 94.8989269904, - 95.8627662892, - 96.7619381633, - 97.598505899, - 98.362769679, - 99.0579904444, - 99.6992633875, - 100.288805948, - 100.828805921, - 101.321421457, - 101.76878699, - 102.17300138, - 102.536116055, - 102.860158727, - 103.147085962, - 103.398830608, - 103.617254366, - 103.792467691, - 103.939387906, - 104.060030865, - 104.15631756, - 104.230085975, - 104.283067372, - 104.316933727, - 104.333238432, - 104.333440018, - 104.318914008, - 104.290941063, - 104.250742554, - 104.187634452, - 104.103822339, - 104.013227468, - 103.916810336, - 103.815448432, - 103.709936239, - 103.600997093, - 103.489283183, - 103.375351833, - 103.259712936, - 103.142828952, - 103.025091195, - 102.90686726, - 102.776726069, - 102.648078982, - 102.521459607, - 102.397294831, - 102.275999684, - 102.157882471, - 102.043215927, - 101.93218978, - 101.824958181, - 101.72159228, - 101.622151366) - - sampling_freq = 10e3 - freq = sampling_freq / 100 - - loop_bw = math.pi/100.0 - maxf = 1 - minf = -1 - - src = gr.sig_source_c (sampling_freq, gr.GR_COS_WAVE, freq, 1.0) - pll = gr.pll_freqdet_cf(loop_bw, maxf, minf) - head = gr.head (gr.sizeof_float, int (freq)) - dst = gr.vector_sink_f () - - self.tb.connect (src, pll, head) - self.tb.connect (head, dst) - - self.tb.run () - dst_data = dst.data () - - # convert it from normalized frequency to absolute frequency (Hz) - dst_data = [i*(sampling_freq/(2*math.pi)) for i in dst_data] - - self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 3) - -if __name__ == '__main__': - gr_unittest.run(test_pll_freqdet, "test_pll_freqdet.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pll_refout.py b/gnuradio-core/src/python/gnuradio/gr/qa_pll_refout.py deleted file mode 100755 index f319f63814..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_pll_refout.py +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest -import math - -class test_pll_refout (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block() - - def tearDown (self): - self.tb = None - - def test_pll_refout (self): - expected_result = ((1+0j), - (1+6.4087357643e-10j), - (0.999985277653+0.00542619498447j), - (0.999868750572+0.0162021834403j), - (0.99948567152+0.0320679470897j), - (0.99860727787+0.0527590736747j), - (0.996953129768+0.0780025869608j), - (0.994203746319+0.107512556016j), - (0.990011692047+0.140985429287j), - (0.984013140202+0.178095817566j), - (0.975838363171+0.218493551016j), - (0.965121984482+0.261800557375j), - (0.95151245594+0.307610183954j), - (0.934681296349+0.355486690998j), - (0.914401650429+0.404808044434j), - (0.890356600285+0.455263823271j), - (0.862329125404+0.506348133087j), - (0.830152392387+0.557536482811j), - (0.793714106083+0.608290970325j), - (0.752960026264+0.658066213131j), - (0.707896590233+0.706316053867j), - (0.658591926098+0.752500295639j), - (0.605175673962+0.796091973782j), - (0.547837555408+0.836584687233j), - (0.48682525754+0.873499393463j), - (0.42244040966+0.906390726566j), - (0.355197101831+0.934791445732j), - (0.285494059324+0.958380460739j), - (0.213591173291+0.976923108101j), - (0.139945343137+0.990159213543j), - (0.065038472414+0.997882783413j), - (-0.0106285437942+0.999943494797j), - (-0.0865436866879+0.996248066425j), - (-0.162189796567+0.986759603024j), - (-0.23705175519+0.971496999264j), - (-0.310622543097+0.950533330441j), - (-0.38240903616+0.923993110657j), - (-0.451937526464+0.89204955101j), - (-0.518758952618+0.854920566082j), - (-0.582311093807+0.812966048717j), - (-0.642372369766+0.76639264822j), - (-0.698591887951+0.715520322323j), - (-0.750654160976+0.660695314407j), - (-0.798280358315+0.602286040783j), - (-0.841228663921+0.540679454803j), - (-0.87929558754+0.476276367903j), - (-0.912315964699+0.409486919641j), - (-0.940161883831+0.340728074312j), - (-0.962742805481+0.270418733358j), - (-0.980004072189+0.198977485299j), - (-0.991925954819+0.126818284392j), - (-0.99851256609+0.0545223206282j), - (-0.999846458435-0.0175215266645j), - (-0.996021270752-0.0891158208251j), - (-0.987133920193-0.159895718098j), - (-0.973306238651-0.2295101583j), - (-0.954683184624-0.297624111176j), - (-0.931430280209-0.363919824362j), - (-0.903732538223-0.428097635508j), - (-0.871792256832-0.489875763655j), - (-0.835827112198-0.548992812634j), - (-0.796068251133-0.605206847191j), - (-0.752758979797-0.658296227455j), - (-0.706152498722-0.70805978775j), - (-0.656641483307-0.754202902317j), - (-0.604367733002-0.79670548439j), - (-0.549597978592-0.835429251194j), - (-0.492602348328-0.870254516602j), - (-0.433654457331-0.901079237461j), - (-0.373029649258-0.927819430828j), - (-0.31100410223-0.950408577919j), - (-0.247853919864-0.968797445297j), - (-0.183855071664-0.982953369617j), - (-0.119282215834-0.992860376835j), - (-0.0544078871608-0.998518764973j), - (0.0104992967099-0.999944865704j), - (0.0749994292855-0.997183561325j), - (0.138844624162-0.990314185619j), - (0.201967850327-0.979392170906j), - (0.264124274254-0.964488625526j), - (0.325075358152-0.945688128471j), - (0.3845885396-0.92308807373j), - (0.442438393831-0.89679890871j), - (0.498407125473-0.866943061352j), - (0.552284479141-0.833655714989j), - (0.603869199753-0.797083437443j), - (0.652970373631-0.757383465767j), - (0.69940674305-0.714723825455j), - (0.743007957935-0.66928255558j), - (0.78350687027-0.62138313055j), - (0.820889055729-0.571087777615j), - (0.855021059513-0.51859331131j), - (0.885780930519-0.46410369873j), - (0.913058102131-0.407829582691j), - (0.936754107475-0.349988251925j), - (0.956783294678-0.290801793337j), - (0.973072886467-0.230497643352j), - (0.985563337803-0.169307261705j), - (0.9942086339-0.1074674353j), - (0.9989772439-0.0452152714133j)) - - sampling_freq = 10e3 - freq = sampling_freq / 100 - - loop_bw = math.pi/100.0 - maxf = 1 - minf = -1 - - src = gr.sig_source_c (sampling_freq, gr.GR_COS_WAVE, freq, 1.0) - pll = gr.pll_refout_cc(loop_bw, maxf, minf) - head = gr.head (gr.sizeof_gr_complex, int (freq)) - dst = gr.vector_sink_c () - - self.tb.connect (src, pll, head) - self.tb.connect (head, dst) - - self.tb.run () - dst_data = dst.data () - self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 4) - -if __name__ == '__main__': - gr_unittest.run(test_pll_refout, "test_pll_refout.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_sig_source.py b/gnuradio-core/src/python/gnuradio/gr/qa_sig_source.py deleted file mode 100755 index 122b169b7e..0000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_sig_source.py +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2007,2010 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio import gr, gr_unittest -import math - -class test_sig_source (gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - - def test_const_f (self): - tb = self.tb - expected_result = (1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5) - src1 = gr.sig_source_f (1e6, gr.GR_CONST_WAVE, 0, 1.5) - op = gr.head (gr.sizeof_float, 10) - dst1 = gr.vector_sink_f () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertEqual (expected_result, dst_data) - - def test_const_i (self): - tb = self.tb - expected_result = (1, 1, 1, 1) - src1 = gr.sig_source_i (1e6, gr.GR_CONST_WAVE, 0, 1) - op = gr.head (gr.sizeof_int, 4) - dst1 = gr.vector_sink_i () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertEqual (expected_result, dst_data) - - def test_sine_f (self): - tb = self.tb - sqrt2 = math.sqrt(2) / 2 - expected_result = (0, sqrt2, 1, sqrt2, 0, -sqrt2, -1, -sqrt2, 0) - src1 = gr.sig_source_f (8, gr.GR_SIN_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_float, 9) - dst1 = gr.vector_sink_f () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 5) - - def test_cosine_f (self): - tb = self.tb - sqrt2 = math.sqrt(2) / 2 - expected_result = (1, sqrt2, 0, -sqrt2, -1, -sqrt2, 0, sqrt2, 1) - src1 = gr.sig_source_f (8, gr.GR_COS_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_float, 9) - dst1 = gr.vector_sink_f () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 5) - - def test_sqr_c (self): - tb = self.tb #arg6 is a bit before -PI/2 - expected_result = (1j, 1j, 0, 0, 1, 1, 1+0j, 1+1j, 1j) - src1 = gr.sig_source_c (8, gr.GR_SQR_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_gr_complex, 9) - dst1 = gr.vector_sink_c () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertEqual (expected_result, dst_data) - - def test_tri_c (self): - tb = self.tb - expected_result = (1+.5j, .75+.75j, .5+1j, .25+.75j, 0+.5j, .25+.25j, .5+0j, .75+.25j, 1+.5j) - src1 = gr.sig_source_c (8, gr.GR_TRI_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_gr_complex, 9) - dst1 = gr.vector_sink_c () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5) - - def test_saw_c (self): - tb = self.tb - expected_result = (.5+.25j, .625+.375j, .75+.5j, .875+.625j, 0+.75j, .125+.875j, .25+1j, .375+.125j, .5+.25j) - src1 = gr.sig_source_c (8, gr.GR_SAW_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_gr_complex, 9) - dst1 = gr.vector_sink_c () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5) - - def test_sqr_f (self): - tb = self.tb - expected_result = (0, 0, 0, 0, 1, 1, 1, 1, 0) - src1 = gr.sig_source_f (8, gr.GR_SQR_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_float, 9) - dst1 = gr.vector_sink_f () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertEqual (expected_result, dst_data) - - def test_tri_f (self): - tb = self.tb - expected_result = (1, .75, .5, .25, 0, .25, .5, .75, 1) - src1 = gr.sig_source_f (8, gr.GR_TRI_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_float, 9) - dst1 = gr.vector_sink_f () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 5) - - def test_saw_f (self): - tb = self.tb - expected_result = (.5, .625, .75, .875, 0, .125, .25, .375, .5) - src1 = gr.sig_source_f (8, gr.GR_SAW_WAVE, 1.0, 1.0) - op = gr.head (gr.sizeof_float, 9) - dst1 = gr.vector_sink_f () - tb.connect (src1, op) - tb.connect (op, dst1) - tb.run () - dst_data = dst1.data () - self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 5) - -if __name__ == '__main__': - gr_unittest.run(test_sig_source, "test_sig_source.xml") diff --git a/gnuradio-core/src/tests/test_buffers.py b/gnuradio-core/src/tests/test_buffers.py index b867c727c6..2664c136c6 100755 --- a/gnuradio-core/src/tests/test_buffers.py +++ b/gnuradio-core/src/tests/test_buffers.py @@ -25,9 +25,14 @@ from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser -import time +import time, math import sys +def sig_source_f(samp_rate, freq, amp, N): + t = map(lambda x: float(x)/samp_rate, xrange(N)) + y = map(lambda x: math.sin(2.*math.pi*freq*x), t) + return y + # Test script to test setting up the buffers using gr_test # For very large buffers it will fail when you hit the circbuf memory limit. # On linux this limit is shmmax, it will fail when it tries to create a buffer > shmmax. @@ -60,10 +65,11 @@ class my_graph(gr.top_block): sample_rate = int(options.sample_rate) ampl = 0.1 + nsamples=int(sample_rate * seconds) #1 seconds - src0 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 350, ampl) + data = sig_source_f(sample_rate, 350, ampl, nsamples) + src0 = gr.vector_source_f(data) - nsamples=int(sample_rate * seconds) #1 seconds # gr.test (const std::string &name=std::string("gr_test"), # int min_inputs=1, int max_inputs=1, unsigned int sizeof_input_item=1, # int min_outputs=1, int max_outputs=1, unsigned int sizeof_output_item=1, @@ -93,9 +99,8 @@ class my_graph(gr.top_block): #unsigned int history=1,unsigned int output_multiple=1,double relative_rate=1.0, #bool fixed_rate=false dst = audio.sink (sample_rate, options.audio_output) - head= gr.head(gr.sizeof_float, nsamples) - self.connect (src0,test,head,(dst, 0)) + self.connect (src0,test,(dst, 0)) if __name__ == '__main__': diff --git a/gr-analog/CMakeLists.txt b/gr-analog/CMakeLists.txt index 4769ce7ac1..8186de0fa9 100644 --- a/gr-analog/CMakeLists.txt +++ b/gr-analog/CMakeLists.txt @@ -95,6 +95,7 @@ if(ENABLE_PYTHON) add_subdirectory(python) add_subdirectory(grc) add_subdirectory(examples) + add_subdirectory(examples/tags) endif(ENABLE_PYTHON) ######################################################################## diff --git a/gr-analog/examples/CMakeLists.txt b/gr-analog/examples/CMakeLists.txt index 9476009869..f0f55b50c8 100644 --- a/gr-analog/examples/CMakeLists.txt +++ b/gr-analog/examples/CMakeLists.txt @@ -21,6 +21,7 @@ include(GrPython) # Base stuff GR_PYTHON_INSTALL(PROGRAMS + fmtest.py DESTINATION ${GR_PKG_ANALOG_EXAMPLES_DIR} COMPONENT "analog_python" ) diff --git a/gr-filter/examples/fmtest.py b/gr-analog/examples/fmtest.py index 7b7489335b..ca02ee5729 100755 --- a/gr-filter/examples/fmtest.py +++ b/gr-analog/examples/fmtest.py @@ -20,7 +20,8 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, blks2, filter +from gnuradio import gr, filter +from gnuradio import analog import sys, math, time try: @@ -44,19 +45,19 @@ class fmtx(gr.hier_block2): gr.io_signature(1, 1, gr.sizeof_float), gr.io_signature(1, 1, gr.sizeof_gr_complex)) - fmtx = blks2.nbfm_tx (audio_rate, if_rate, max_dev=5e3, tau=75e-6) + fmtx = analog.nbfm_tx(audio_rate, if_rate, max_dev=5e3, tau=75e-6) # Local oscillator - lo = gr.sig_source_c (if_rate, # sample rate - gr.GR_SIN_WAVE, # waveform type - lo_freq, #frequency - 1.0, # amplitude - 0) # DC Offset - mixer = gr.multiply_cc () + lo = analog.sig_source_c(if_rate, # sample rate + analog.GR_SIN_WAVE, # waveform type + lo_freq, # frequency + 1.0, # amplitude + 0) # DC Offset + mixer = gr.multiply_cc() - self.connect (self, fmtx, (mixer, 0)) - self.connect (lo, (mixer, 1)) - self.connect (mixer, self) + self.connect(self, fmtx, (mixer, 0)) + self.connect(lo, (mixer, 1)) + self.connect(mixer, self) class fmtest(gr.top_block): def __init__(self): @@ -74,9 +75,9 @@ class fmtest(gr.top_block): self._if_rate = 4*self._N*self._audio_rate # Create a signal source and frequency modulate it - self.sum = gr.add_cc () + self.sum = gr.add_cc() for n in xrange(self._N): - sig = gr.sig_source_f(self._audio_rate, gr.GR_SIN_WAVE, freq[n], 0.5) + sig = analog.sig_source_f(self._audio_rate, analog.GR_SIN_WAVE, freq[n], 0.5) fm = fmtx(f_lo[n], self._audio_rate, self._if_rate) self.connect(sig, fm) self.connect(fm, (self.sum, n)) @@ -111,8 +112,8 @@ class fmtest(gr.top_block): self.squelch = list() self.snks = list() for i in xrange(self._M): - self.fmdet.append(blks2.nbfm_rx(self._audio_rate, self._chan_rate)) - self.squelch.append(blks2.standard_squelch(self._audio_rate*10)) + self.fmdet.append(analog.nbfm_rx(self._audio_rate, self._chan_rate)) + self.squelch.append(analog.standard_squelch(self._audio_rate*10)) self.snks.append(gr.vector_sink_f()) self.connect((self.pfb, i), self.fmdet[i], self.squelch[i], self.snks[i]) diff --git a/gr-analog/examples/tags/CMakeLists.txt b/gr-analog/examples/tags/CMakeLists.txt new file mode 100644 index 0000000000..adeb655dea --- /dev/null +++ b/gr-analog/examples/tags/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +include(GrPython) + +GR_PYTHON_INSTALL(PROGRAMS + uhd_burst_detector.py + DESTINATION ${GR_PKG_DATA_DIR}/examples/tags + COMPONENT "core_python" +) + diff --git a/gnuradio-core/src/examples/tags/uhd_burst_detector.py b/gr-analog/examples/tags/uhd_burst_detector.py index 512fc715d7..3be0fb8c2e 100755 --- a/gnuradio-core/src/examples/tags/uhd_burst_detector.py +++ b/gr-analog/examples/tags/uhd_burst_detector.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -22,6 +22,7 @@ from gnuradio import eng_notation from gnuradio import gr +from gnuradio import filter, analog from gnuradio import uhd from gnuradio import window from gnuradio.eng_option import eng_option @@ -49,7 +50,7 @@ class uhd_burst_detector(gr.top_block): self.uhd_src.set_gain(self.gain, 0) taps = firdes.low_pass_2(1, 1, 0.4, 0.1, 60) - self.chanfilt = gr.fir_filter_ccc(10, taps) + self.chanfilt = filter.fir_filter_ccc(10, taps) self.tagger = gr.burst_tagger(gr.sizeof_gr_complex) # Dummy signaler to collect a burst on known periods @@ -58,11 +59,11 @@ class uhd_burst_detector(gr.top_block): # Energy detector to get signal burst ## use squelch to detect energy - self.det = gr.simple_squelch_cc(self.threshold, 0.01) + self.det = analog.simple_squelch_cc(self.threshold, 0.01) ## convert to mag squared (float) self.c2m = gr.complex_to_mag_squared() ## average to debounce - self.avg = gr.single_pole_iir_filter_ff(0.01) + self.avg = filter.single_pole_iir_filter_ff(0.01) ## rescale signal for conversion to short self.scale = gr.multiply_const_ff(2**16) ## signal input uses shorts diff --git a/gr-analog/grc/analog_block_tree.xml b/gr-analog/grc/analog_block_tree.xml index b5b2ecd568..5d2ab6512b 100644 --- a/gr-analog/grc/analog_block_tree.xml +++ b/gr-analog/grc/analog_block_tree.xml @@ -37,6 +37,7 @@ <block>analog_ctcss_squelch_ff</block> <block>analog_pwr_squelch_xx</block> <block>analog_simple_squelch_cc</block> + <block>analog_standard_squelch</block> <block>analog_rail_ff</block> </cat> <cat> @@ -49,6 +50,7 @@ <cat> <name>Sources</name> <block>analog_sig_source_x</block> + <block>analog_const_source_x</block> <block>analog_noise_source_x</block> </cat> <cat> diff --git a/grc/blocks/const_source_x.xml b/gr-analog/grc/analog_const_source_x.xml index fe8e56ec4a..de8c306264 100644 --- a/grc/blocks/const_source_x.xml +++ b/gr-analog/grc/analog_const_source_x.xml @@ -6,9 +6,9 @@ --> <block> <name>Constant Source</name> - <key>const_source_x</key> - <import>from gnuradio import gr</import> - <make>gr.sig_source_$(type.fcn)(0, gr.GR_CONST_WAVE, 0, 0, $const)</make> + <key>analog_const_source_x</key> + <import>from gnuradio import analog</import> + <make>analog.sig_source_$(type.fcn)(0, analog.GR_CONST_WAVE, 0, 0, $const)</make> <callback>set_offset($const)</callback> <param> <name>Output Type</name> diff --git a/grc/blocks/blks2_standard_squelch.xml b/gr-analog/grc/analog_standard_squelch.xml index f0baeb6624..264c57ab56 100644 --- a/grc/blocks/blks2_standard_squelch.xml +++ b/gr-analog/grc/analog_standard_squelch.xml @@ -6,9 +6,9 @@ --> <block> <name>Standard Squelch</name> - <key>blks2_standard_squelch</key> - <import>from gnuradio import blks2</import> - <make>blks2.standard_squelch(audio_rate=$audio_rate) + <key>analog_standard_squelch</key> + <import>from gnuradio import analog</import> + <make>analog.standard_squelch(audio_rate=$audio_rate) self.$(id).set_threshold($threshold)</make> <callback>set_threshold($threshold)</callback> <param> diff --git a/gr-analog/include/analog/CMakeLists.txt b/gr-analog/include/analog/CMakeLists.txt index 4de94a88b3..33c4d55a79 100644 --- a/gr-analog/include/analog/CMakeLists.txt +++ b/gr-analog/include/analog/CMakeLists.txt @@ -102,7 +102,6 @@ install(FILES pwr_squelch_ff.h quadrature_demod_cf.h rail_ff.h - rotator.h sig_source_waveform.h simple_squelch_cc.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/analog diff --git a/gr-analog/include/analog/rotator.h b/gr-analog/include/analog/rotator.h deleted file mode 100644 index ee3849eae7..0000000000 --- a/gr-analog/include/analog/rotator.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2003,2008,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _ANALOG_ROTATOR_H_ -#define _ANALOG_ROTATOR_H_ - -#include <analog/api.h> -#include <gr_complex.h> - -namespace gr { - namespace analog { - - class rotator - { - private: - gr_complex d_phase; - gr_complex d_phase_incr; - unsigned int d_counter; - - public: - rotator() : d_phase (1), d_phase_incr (1), d_counter(0) - { } - - void set_phase(gr_complex phase) { d_phase = phase / abs(phase); } - void set_phase_incr(gr_complex incr) { d_phase_incr = incr / abs(incr); } - - gr_complex rotate (gr_complex in) - { - d_counter++; - - gr_complex z = in * d_phase; // rotate in by phase - d_phase *= d_phase_incr; // incr our phase (complex mult == add phases) - - if((d_counter % 512) == 0) - d_phase /= abs(d_phase); // Normalize to ensure multiplication is rotation - - return z; - } - }; - - } /* namespace analog */ -} /* namespace gr */ - -#endif /* _ANALOG_ROTATOR_H_ */ diff --git a/gr-analog/lib/CMakeLists.txt b/gr-analog/lib/CMakeLists.txt index aaf3c8656c..04a8645417 100644 --- a/gr-analog/lib/CMakeLists.txt +++ b/gr-analog/lib/CMakeLists.txt @@ -160,7 +160,6 @@ if(ENABLE_TESTING) ${CMAKE_CURRENT_SOURCE_DIR}/test_gr_analog.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_analog.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_sincos.cc - ${CMAKE_CURRENT_SOURCE_DIR}/qa_rotator.cc ) add_executable(test-gr-analog ${test_gr_analog_sources}) diff --git a/gr-analog/lib/qa_analog.cc b/gr-analog/lib/qa_analog.cc index c3d51863bd..f1e3a45e27 100644 --- a/gr-analog/lib/qa_analog.cc +++ b/gr-analog/lib/qa_analog.cc @@ -35,7 +35,6 @@ qa_gr_analog::suite() CppUnit::TestSuite *s = new CppUnit::TestSuite("gr-analog"); s->addTest(gr::analog::qa_sincos::suite()); - s->addTest(gr::analog::qa_rotator::suite()); return s; } diff --git a/gr-analog/lib/sig_source_X_impl.cc.t b/gr-analog/lib/sig_source_X_impl.cc.t index 60653dc1bb..ad8b7e4b0c 100644 --- a/gr-analog/lib/sig_source_X_impl.cc.t +++ b/gr-analog/lib/sig_source_X_impl.cc.t @@ -211,7 +211,7 @@ namespace gr { #endif default: - throw std::runtime_error("gr_sig_source: invalid waveform"); + throw std::runtime_error("analog::sig_source: invalid waveform"); } return noutput_items; diff --git a/gr-analog/python/CMakeLists.txt b/gr-analog/python/CMakeLists.txt index 08570eea33..f42ee20086 100644 --- a/gr-analog/python/CMakeLists.txt +++ b/gr-analog/python/CMakeLists.txt @@ -25,6 +25,16 @@ include(GrPython) GR_PYTHON_INSTALL( FILES __init__.py + am_demod.py + fm_demod.py + fm_emph.py + nbfm_rx.py + nbfm_tx.py + standard_squelch.py + wfm_rcv.py + wfm_rcv_fmdet.py + wfm_rcv_pll.py + wfm_tx.py DESTINATION ${GR_PYTHON_DIR}/gnuradio/analog COMPONENT "analog_python" ) diff --git a/gr-analog/python/__init__.py b/gr-analog/python/__init__.py index fc345028b9..a5ab5715d7 100644 --- a/gr-analog/python/__init__.py +++ b/gr-analog/python/__init__.py @@ -25,3 +25,14 @@ Blocks and utilities for analog modulation and demodulation. # The presence of this file turns this directory into a Python package from analog_swig import * + +from am_demod import * +from fm_demod import * +from fm_emph import * +from nbfm_rx import * +from nbfm_tx import * +from standard_squelch import * +from wfm_rcv import * +from wfm_rcv_fmdet import * +from wfm_rcv_pll import * +from wfm_tx import * diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/am_demod.py b/gr-analog/python/am_demod.py index 6420348be3..2730aa2622 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/am_demod.py +++ b/gr-analog/python/am_demod.py @@ -1,5 +1,5 @@ # -# Copyright 2006,2007 Free Software Foundation, Inc. +# Copyright 2006,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -19,7 +19,8 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir +from gnuradio import gr +from gnuradio import filter class am_demod_cf(gr.hier_block2): """ @@ -44,13 +45,13 @@ class am_demod_cf(gr.hier_block2): MAG = gr.complex_to_mag() DCR = gr.add_const_ff(-1.0) - audio_taps = optfir.low_pass(0.5, # Filter gain - channel_rate, # Sample rate - audio_pass, # Audio passband - audio_stop, # Audio stopband - 0.1, # Passband ripple - 60) # Stopband attenuation - LPF = gr.fir_filter_fff(audio_decim, audio_taps) + audio_taps = filter.optfir.low_pass(0.5, # Filter gain + channel_rate, # Sample rate + audio_pass, # Audio passband + audio_stop, # Audio stopband + 0.1, # Passband ripple + 60) # Stopband attenuation + LPF = filter.fir_filter_fff(audio_decim, audio_taps) self.connect(self, MAG, DCR, LPF, self) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py b/gr-analog/python/fm_demod.py index cc93d5b45c..1976a076ca 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py +++ b/gr-analog/python/fm_demod.py @@ -1,5 +1,5 @@ # -# Copyright 2006,2007 Free Software Foundation, Inc. +# Copyright 2006,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -19,10 +19,15 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir -from gnuradio.blks2impl.fm_emph import fm_deemph +from gnuradio import gr, filter +from fm_emph import fm_deemph from math import pi +try: + from gnuradio import analog +except ImportError: + import analog_swig as analog + class fm_demod_cf(gr.hier_block2): """ Generalized FM demodulation block with deemphasis and audio @@ -49,15 +54,15 @@ class fm_demod_cf(gr.hier_block2): gr.io_signature(1, 1, gr.sizeof_float)) # Output signature k = channel_rate/(2*pi*deviation) - QUAD = gr.quadrature_demod_cf(k) + QUAD = analog.quadrature_demod_cf(k) - audio_taps = optfir.low_pass(gain, # Filter gain - channel_rate, # Sample rate - audio_pass, # Audio passband - audio_stop, # Audio stopband - 0.1, # Passband ripple - 60) # Stopband attenuation - LPF = gr.fir_filter_fff(audio_decim, audio_taps) + audio_taps = filter.optfir.low_pass(gain, # Filter gain + channel_rate, # Sample rate + audio_pass, # Audio passband + audio_stop, # Audio stopband + 0.1, # Passband ripple + 60) # Stopband attenuation + LPF = filter.fir_filter_fff(audio_decim, audio_taps) if tau is not None: DEEMPH = fm_deemph(channel_rate, tau) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/fm_emph.py b/gr-analog/python/fm_emph.py index 080ebe151f..2821f6e3cd 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/fm_emph.py +++ b/gr-analog/python/fm_emph.py @@ -1,5 +1,5 @@ # -# Copyright 2005,2007 Free Software Foundation, Inc. +# Copyright 2005,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -22,7 +22,6 @@ from gnuradio import gr, filter import math - # # 1 # H(s) = ------- @@ -53,7 +52,7 @@ class fm_deemph(gr.hier_block2): gr.io_signature(1, 1, gr.sizeof_float)) # Output signature w_p = 1/tau - w_pp = math.tan (w_p / (fs * 2)) # prewarped analog freq + w_pp = math.tan(w_p / (fs * 2)) # prewarped analog freq a1 = (w_pp - 1)/(w_pp + 1) b0 = w_pp/(1 + w_pp) @@ -66,7 +65,7 @@ class fm_deemph(gr.hier_block2): print "btaps =", btaps print "ataps =", ataps global plot1 - plot1 = gru.gnuplot_freqz (gru.freqz (btaps, ataps), fs, True) + plot1 = gru.gnuplot_freqz(gru.freqz(btaps, ataps), fs, True) deemph = filter.iir_filter_ffd(btaps, ataps) self.connect(self, deemph, self) @@ -145,7 +144,7 @@ class fm_preemph(gr.hier_block2): print "btaps =", btaps print "ataps =", ataps global plot2 - plot2 = gru.gnuplot_freqz (gru.freqz (btaps, ataps), fs, True) + plot2 = gru.gnuplot_freqz(gru.freqz(btaps, ataps), fs, True) preemph = filter.iir_filter_ffd(btaps, ataps) self.connect(self, preemph, self) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_rx.py b/gr-analog/python/nbfm_rx.py index 40eb255e1e..b2c86db70f 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_rx.py +++ b/gr-analog/python/nbfm_rx.py @@ -1,5 +1,5 @@ # -# Copyright 2005 Free Software Foundation, Inc. +# Copyright 2005,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,9 +20,14 @@ # import math -from gnuradio import gr, optfir -from gnuradio.blks2impl.fm_emph import fm_deemph -#from gnuradio.blks2impl.standard_squelch import standard_squelch +from gnuradio import gr +from gnuradio import filter +from fm_emph import fm_deemph + +try: + from gnuradio import analog +except ImportError: + import analog_swig as analog class nbfm_rx(gr.hier_block2): def __init__(self, audio_rate, quad_rate, tau=75e-6, max_dev=5e3): @@ -59,27 +64,27 @@ class nbfm_rx(gr.hier_block2): raise ValueError, "quad_rate is not an integer multiple of audio_rate" squelch_threshold = 20 # dB - #self.squelch = gr.simple_squelch_cc(squelch_threshold, 0.001) + #self.squelch = analog.simple_squelch_cc(squelch_threshold, 0.001) # FM Demodulator input: complex; output: float k = quad_rate/(2*math.pi*max_dev) - self.quad_demod = gr.quadrature_demod_cf(k) + self.quad_demod = analog.quadrature_demod_cf(k) # FM Deemphasis IIR filter - self.deemph = fm_deemph (quad_rate, tau=tau) + self.deemph = fm_deemph(quad_rate, tau=tau) # compute FIR taps for audio filter audio_decim = quad_rate // audio_rate - audio_taps = gr.firdes.low_pass (1.0, # gain - quad_rate, # sampling rate - 2.7e3, # Audio LPF cutoff - 0.5e3, # Transition band - gr.firdes.WIN_HAMMING) # filter type + audio_taps = filter.firdes.low_pass(1.0, # gain + quad_rate, # sampling rate + 2.7e3, # Audio LPF cutoff + 0.5e3, # Transition band + filter.firdes.WIN_HAMMING) # filter type print "len(audio_taps) =", len(audio_taps) # Decimating audio filter # input: float; output: float; taps: float - self.audio_filter = gr.fir_filter_fff(audio_decim, audio_taps) + self.audio_filter = filter.fir_filter_fff(audio_decim, audio_taps) self.connect(self, self.quad_demod, self.deemph, self.audio_filter, self) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_tx.py b/gr-analog/python/nbfm_tx.py index 75e96f2374..eed5bc08d0 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_tx.py +++ b/gr-analog/python/nbfm_tx.py @@ -1,5 +1,5 @@ # -# Copyright 2005 Free Software Foundation, Inc. +# Copyright 2005,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,10 +20,13 @@ # import math -from gnuradio import gr, optfir, filter -from gnuradio.blks2impl.fm_emph import fm_preemph +from gnuradio import gr, filter +from fm_emph import fm_preemph -#from gnuradio import ctcss +try: + from gnuradio import analog +except ImportError: + import analog_swig as analog class nbfm_tx(gr.hier_block2): def __init__(self, audio_rate, quad_rate, tau=75e-6, max_dev=5e3): @@ -58,23 +61,23 @@ class nbfm_tx(gr.hier_block2): if do_interp: interp_factor = quad_rate / audio_rate - interp_taps = optfir.low_pass (interp_factor, # gain - quad_rate, # Fs - 4500, # passband cutoff - 7000, # stopband cutoff - 0.1, # passband ripple dB - 40) # stopband atten dB + interp_taps = filter.optfir.low_pass(interp_factor, # gain + quad_rate, # Fs + 4500, # passband cutoff + 7000, # stopband cutoff + 0.1, # passband ripple dB + 40) # stopband atten dB #print "len(interp_taps) =", len(interp_taps) self.interpolator = filter.interp_fir_filter_fff (interp_factor, interp_taps) - self.preemph = fm_preemph (quad_rate, tau=tau) + self.preemph = fm_preemph(quad_rate, tau=tau) k = 2 * math.pi * max_dev / quad_rate - self.modulator = gr.frequency_modulator_fc (k) + self.modulator = analog.frequency_modulator_fc(k) if do_interp: - self.connect (self, self.interpolator, self.preemph, self.modulator, self) + self.connect(self, self.interpolator, self.preemph, self.modulator, self) else: self.connect(self, self.preemph, self.modulator, self) @@ -85,5 +88,5 @@ class ctcss_gen_f(gr.hier_block2): gr.io_signature(0, 0, 0), # Input signature gr.io_signature(1, 1, gr.sizeof_float)) # Output signature - self.plgen = gr.sig_source_f(sample_rate, gr.GR_SIN_WAVE, tone_freq, 0.1, 0.0) + self.plgen = analog.sig_source_f(sample_rate, gr.GR_SIN_WAVE, tone_freq, 0.1, 0.0) self.connect(self.plgen, self) diff --git a/gr-analog/python/qa_agc.py b/gr-analog/python/qa_agc.py index dc4922cf84..2733ed3fae 100755 --- a/gr-analog/python/qa_agc.py +++ b/gr-analog/python/qa_agc.py @@ -105,8 +105,8 @@ class test_agc (gr_unittest.TestCase): (1.26766037940979-0.92100900411605835j)) sampling_freq = 100 - src1 = gr.sig_source_c(sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100.0) + src1 = analog.sig_source_c(sampling_freq, analog.GR_SIN_WAVE, + sampling_freq * 0.10, 100.0) dst1 = gr.vector_sink_c() head = gr.head(gr.sizeof_gr_complex, int (5*sampling_freq * 0.10)) @@ -193,8 +193,8 @@ class test_agc (gr_unittest.TestCase): -3.3931560516357422) sampling_freq = 100 - src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100.0) + src1 = analog.sig_source_f(sampling_freq, analog.GR_SIN_WAVE, + sampling_freq * 0.10, 100.0) dst1 = gr.vector_sink_f () head = gr.head (gr.sizeof_float, int (5*sampling_freq * 0.10)) @@ -283,8 +283,8 @@ class test_agc (gr_unittest.TestCase): (0.80901449918746948-0.5877833366394043j)) sampling_freq = 100 - src1 = gr.sig_source_c(sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100) + src1 = analog.sig_source_c(sampling_freq, analog.GR_SIN_WAVE, + sampling_freq * 0.10, 100) dst1 = gr.vector_sink_c() head = gr.head(gr.sizeof_gr_complex, int(5*sampling_freq * 0.10)) @@ -373,8 +373,8 @@ class test_agc (gr_unittest.TestCase): -0.61937344074249268) sampling_freq = 100 - src1 = gr.sig_source_f(sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100) + src1 = analog.sig_source_f(sampling_freq, analog.GR_SIN_WAVE, + sampling_freq * 0.10, 100) dst1 = gr.vector_sink_f() head = gr.head(gr.sizeof_float, int(5*sampling_freq * 0.10)) @@ -449,8 +449,8 @@ class test_agc (gr_unittest.TestCase): (0.80901449918746948-0.5877833366394043j)) sampling_freq = 100 - src1 = gr.sig_source_c(sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 100) + src1 = analog.sig_source_c(sampling_freq, analog.GR_SIN_WAVE, + sampling_freq * 0.10, 100) dst1 = gr.vector_sink_c() head = gr.head(gr.sizeof_gr_complex, int(5*sampling_freq * 0.10)) diff --git a/gr-analog/python/qa_fmdet.py b/gr-analog/python/qa_fmdet.py index b90ef2ffa4..a76ac1d247 100755 --- a/gr-analog/python/qa_fmdet.py +++ b/gr-analog/python/qa_fmdet.py @@ -62,7 +62,7 @@ class test_fmdet_cf(gr_unittest.TestCase): # block is saying, not what the values should actually be. def est_fmdet_cf_002(self): N = 100 - src = gr.sig_source_c(1, gr.GR_SIN_WAVE, 0.2, 1) + src = analog.sig_source_c(1, analog.GR_SIN_WAVE, 0.2, 1) head = gr.head(gr.sizeof_gr_complex, N) op = analog.fmdet_cf(1, 0.1, 0.3, 0.1) dst = gr.vector_sink_f() diff --git a/gr-analog/python/qa_pll_carriertracking.py b/gr-analog/python/qa_pll_carriertracking.py index a292059d1b..e383639d49 100755 --- a/gr-analog/python/qa_pll_carriertracking.py +++ b/gr-analog/python/qa_pll_carriertracking.py @@ -141,7 +141,7 @@ class test_pll_carriertracking(gr_unittest.TestCase): maxf = 1 minf = -1 - src = gr.sig_source_c(sampling_freq, gr.GR_COS_WAVE, freq, 1.0) + src = analog.sig_source_c(sampling_freq, analog.GR_COS_WAVE, freq, 1.0) pll = analog.pll_carriertracking_cc(loop_bw, maxf, minf) head = gr.head(gr.sizeof_gr_complex, int (freq)) dst = gr.vector_sink_c() diff --git a/gr-analog/python/qa_pll_freqdet.py b/gr-analog/python/qa_pll_freqdet.py index 1f808afa61..cc8757c965 100755 --- a/gr-analog/python/qa_pll_freqdet.py +++ b/gr-analog/python/qa_pll_freqdet.py @@ -141,7 +141,7 @@ class test_pll_freqdet(gr_unittest.TestCase): maxf = 1 minf = -1 - src = gr.sig_source_c(sampling_freq, gr.GR_COS_WAVE, freq, 1.0) + src = analog.sig_source_c(sampling_freq, analog.GR_COS_WAVE, freq, 1.0) pll = analog.pll_freqdet_cf(loop_bw, maxf, minf) head = gr.head(gr.sizeof_float, int (freq)) dst = gr.vector_sink_f() diff --git a/gr-analog/python/qa_pll_refout.py b/gr-analog/python/qa_pll_refout.py index 2831b2909d..c63136bc0c 100755 --- a/gr-analog/python/qa_pll_refout.py +++ b/gr-analog/python/qa_pll_refout.py @@ -141,7 +141,7 @@ class test_pll_refout(gr_unittest.TestCase): maxf = 1 minf = -1 - src = gr.sig_source_c(sampling_freq, gr.GR_COS_WAVE, freq, 1.0) + src = analog.sig_source_c(sampling_freq, analog.GR_COS_WAVE, freq, 1.0) pll = analog.pll_refout_cc(loop_bw, maxf, minf) head = gr.head(gr.sizeof_gr_complex, int (freq)) dst = gr.vector_sink_c() diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/standard_squelch.py b/gr-analog/python/standard_squelch.py index bd7fb535ae..986397a48e 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/standard_squelch.py +++ b/gr-analog/python/standard_squelch.py @@ -1,5 +1,5 @@ # -# Copyright 2005,2007 Free Software Foundation, Inc. +# Copyright 2005,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,8 @@ # import math -from gnuradio import gr, optfir +from gnuradio import gr +from gnuradio import filter class standard_squelch(gr.hier_block2): def __init__(self, audio_rate): @@ -30,41 +31,41 @@ class standard_squelch(gr.hier_block2): self.input_node = gr.add_const_ff(0) # FIXME kludge - self.low_iir = gr.iir_filter_ffd((0.0193,0,-0.0193),(1,1.9524,-0.9615)) + self.low_iir = filter.iir_filter_ffd((0.0193,0,-0.0193),(1,1.9524,-0.9615)) self.low_square = gr.multiply_ff() - self.low_smooth = gr.single_pole_iir_filter_ff(1/(0.01*audio_rate)) # 100ms time constant + self.low_smooth = filter.single_pole_iir_filter_ff(1/(0.01*audio_rate)) # 100ms time constant - self.hi_iir = gr.iir_filter_ffd((0.0193,0,-0.0193),(1,1.3597,-0.9615)) + self.hi_iir = filter.iir_filter_ffd((0.0193,0,-0.0193),(1,1.3597,-0.9615)) self.hi_square = gr.multiply_ff() - self.hi_smooth = gr.single_pole_iir_filter_ff(1/(0.01*audio_rate)) + self.hi_smooth = filter.single_pole_iir_filter_ff(1/(0.01*audio_rate)) self.sub = gr.sub_ff(); self.add = gr.add_ff(); self.gate = gr.threshold_ff(0.3,0.43,0) - self.squelch_lpf = gr.single_pole_iir_filter_ff(1/(0.01*audio_rate)) + self.squelch_lpf = filter.single_pole_iir_filter_ff(1/(0.01*audio_rate)) self.div = gr.divide_ff() self.squelch_mult = gr.multiply_ff() - self.connect (self, self.input_node) - self.connect (self.input_node, (self.squelch_mult, 0)) + self.connect(self, self.input_node) + self.connect(self.input_node, (self.squelch_mult, 0)) - self.connect (self.input_node,self.low_iir) - self.connect (self.low_iir,(self.low_square,0)) - self.connect (self.low_iir,(self.low_square,1)) - self.connect (self.low_square,self.low_smooth,(self.sub,0)) - self.connect (self.low_smooth, (self.add,0)) + self.connect(self.input_node,self.low_iir) + self.connect(self.low_iir,(self.low_square,0)) + self.connect(self.low_iir,(self.low_square,1)) + self.connect(self.low_square,self.low_smooth,(self.sub,0)) + self.connect(self.low_smooth, (self.add,0)) - self.connect (self.input_node,self.hi_iir) - self.connect (self.hi_iir,(self.hi_square,0)) - self.connect (self.hi_iir,(self.hi_square,1)) - self.connect (self.hi_square,self.hi_smooth,(self.sub,1)) - self.connect (self.hi_smooth, (self.add,1)) + self.connect(self.input_node,self.hi_iir) + self.connect(self.hi_iir,(self.hi_square,0)) + self.connect(self.hi_iir,(self.hi_square,1)) + self.connect(self.hi_square,self.hi_smooth,(self.sub,1)) + self.connect(self.hi_smooth, (self.add,1)) - self.connect (self.sub, (self.div, 0)) - self.connect (self.add, (self.div, 1)) - self.connect (self.div, self.gate, self.squelch_lpf, (self.squelch_mult,1)) - self.connect (self.squelch_mult, self) + self.connect(self.sub, (self.div, 0)) + self.connect(self.add, (self.div, 1)) + self.connect(self.div, self.gate, self.squelch_lpf, (self.squelch_mult,1)) + self.connect(self.squelch_mult, self) def set_threshold(self, threshold): self.gate.set_hi(threshold) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv.py b/gr-analog/python/wfm_rcv.py index fe4fdd1a6a..d35d219275 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv.py +++ b/gr-analog/python/wfm_rcv.py @@ -1,5 +1,5 @@ # -# Copyright 2005,2007 Free Software Foundation, Inc. +# Copyright 2005,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -19,10 +19,15 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr -from gnuradio.blks2impl.fm_emph import fm_deemph +from gnuradio import gr, filter +from fm_emph import fm_deemph import math +try: + from gnuradio import analog +except ImportError: + import analog_swig as analog + class wfm_rcv(gr.hier_block2): def __init__ (self, quad_rate, audio_decimation): """ @@ -50,19 +55,19 @@ class wfm_rcv(gr.hier_block2): # if they need to. E.g., to plot its output. # # input: complex; output: float - self.fm_demod = gr.quadrature_demod_cf (fm_demod_gain) + self.fm_demod = analog.quadrature_demod_cf(fm_demod_gain) # input: float; output: float - self.deemph = fm_deemph (audio_rate) + self.deemph = fm_deemph(audio_rate) # 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) + audio_coeffs = filter.firdes.low_pass(1.0, # gain + quad_rate, # sampling rate + audio_rate/2 - width_of_transition_band, + width_of_transition_band, + filter.firdes.WIN_HAMMING) # input: float; output: float - self.audio_filter = gr.fir_filter_fff (audio_decimation, audio_coeffs) + self.audio_filter = filter.fir_filter_fff(audio_decimation, audio_coeffs) self.connect (self, self.fm_demod, self.audio_filter, self.deemph, self) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py b/gr-analog/python/wfm_rcv_fmdet.py index 24c710a494..0fc9de1b88 100755..100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py +++ b/gr-analog/python/wfm_rcv_fmdet.py @@ -1,5 +1,5 @@ # -# Copyright 2005,2006 Free Software Foundation, Inc. +# Copyright 2005,2006,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -19,10 +19,15 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr -from gnuradio.blks2impl.fm_emph import fm_deemph +from gnuradio import gr, filter +from fm_emph import fm_deemph import math +try: + from gnuradio import analog +except ImportError: + import analog_swig as analog + class wfm_rcv_fmdet(gr.hier_block2): def __init__ (self, demod_rate, audio_decimation): """ @@ -48,22 +53,22 @@ class wfm_rcv_fmdet(gr.hier_block2): # # input: complex; output: float - self.fm_demod = gr.fmdet_cf (demod_rate, lowfreq, highfreq, 0.05) + self.fm_demod = analog.fmdet_cf(demod_rate, lowfreq, highfreq, 0.05) # input: float; output: float - self.deemph_Left = fm_deemph (audio_rate) - self.deemph_Right = fm_deemph (audio_rate) + self.deemph_Left = fm_deemph(audio_rate) + self.deemph_Right = fm_deemph(audio_rate) # compute FIR filter taps for audio filter width_of_transition_band = audio_rate / 32 - audio_coeffs = gr.firdes.low_pass (1.0 , # gain - demod_rate, # sampling rate - 15000 , - width_of_transition_band, - gr.firdes.WIN_HAMMING) + audio_coeffs = filter.firdes.low_pass(1.0 , # gain + demod_rate, # sampling rate + 15000 , + width_of_transition_band, + filter.firdes.WIN_HAMMING) # input: float; output: float - self.audio_filter = gr.fir_filter_fff (audio_decimation, audio_coeffs) + self.audio_filter = filter.fir_filter_fff(audio_decimation, audio_coeffs) if 1: # Pick off the stereo carrier/2 with this filter. It # attenuated 10 dB so apply 10 dB gain We pick off the @@ -72,12 +77,13 @@ class wfm_rcv_fmdet(gr.hier_block2): ## NOTE THIS WAS HACKED TO OFFSET INSERTION LOSS DUE TO ## DEEMPHASIS - stereo_carrier_filter_coeffs = gr.firdes.complex_band_pass(10.0, - demod_rate, - -19020, - -18980, - width_of_transition_band, - gr.firdes.WIN_HAMMING) + stereo_carrier_filter_coeffs = \ + filter.firdes.complex_band_pass(10.0, + demod_rate, + -19020, + -18980, + width_of_transition_band, + filter.firdes.WIN_HAMMING) #print "len stereo carrier filter = ",len(stereo_carrier_filter_coeffs) #print "stereo carrier filter ", stereo_carrier_filter_coeffs @@ -87,37 +93,41 @@ class wfm_rcv_fmdet(gr.hier_block2): # Left-Right audio. It is attenuated 10 dB so apply 10 dB # gain - stereo_dsbsc_filter_coeffs = gr.firdes.complex_band_pass(20.0, - demod_rate, - 38000-15000/2, - 38000+15000/2, - width_of_transition_band, - gr.firdes.WIN_HAMMING) + stereo_dsbsc_filter_coeffs = \ + filter.firdes.complex_band_pass(20.0, + demod_rate, + 38000-15000/2, + 38000+15000/2, + width_of_transition_band, + filter.firdes.WIN_HAMMING) #print "len stereo dsbsc filter = ",len(stereo_dsbsc_filter_coeffs) #print "stereo dsbsc filter ", stereo_dsbsc_filter_coeffs # construct overlap add filter system from coefficients # for stereo carrier - self.stereo_carrier_filter = gr.fir_filter_fcc(audio_decimation, - stereo_carrier_filter_coeffs) + self.stereo_carrier_filter = \ + filter.fir_filter_fcc(audio_decimation, + stereo_carrier_filter_coeffs) # carrier is twice the picked off carrier so arrange to do # a commplex multiply self.stereo_carrier_generator = gr.multiply_cc(); # Pick off the rds signal - stereo_rds_filter_coeffs = gr.firdes.complex_band_pass(30.0, - demod_rate, - 57000 - 1500, - 57000 + 1500, - width_of_transition_band, - gr.firdes.WIN_HAMMING) + stereo_rds_filter_coeffs = \ + filter.firdes.complex_band_pass(30.0, + demod_rate, + 57000 - 1500, + 57000 + 1500, + width_of_transition_band, + filter.firdes.WIN_HAMMING) #print "len stereo dsbsc filter = ",len(stereo_dsbsc_filter_coeffs) #print "stereo dsbsc filter ", stereo_dsbsc_filter_coeffs # construct overlap add filter system from coefficients for stereo carrier - self.rds_signal_filter = gr.fir_filter_fcc(audio_decimation, - stereo_rds_filter_coeffs) + self.rds_signal_filter = \ + filter.fir_filter_fcc(audio_decimation, + stereo_rds_filter_coeffs) self.rds_carrier_generator = gr.multiply_cc(); self.rds_signal_generator = gr.multiply_cc(); self_rds_signal_processor = gr.null_sink(gr.sizeof_gr_complex); @@ -125,9 +135,9 @@ class wfm_rcv_fmdet(gr.hier_block2): loop_bw = 2*math.pi/100.0 max_freq = -2.0*math.pi*18990/audio_rate; min_freq = -2.0*math.pi*19010/audio_rate; - self.stereo_carrier_pll_recovery = gr.pll_refout_cc(loop_bw, - max_freq, - min_freq); + self.stereo_carrier_pll_recovery = analog.pll_refout_cc(loop_bw, + max_freq, + min_freq); #self.stereo_carrier_pll_recovery.squelch_enable(False) ##pll_refout does not have squelch yet, so disabled for @@ -145,54 +155,55 @@ class wfm_rcv_fmdet(gr.hier_block2): self.Make_Left = gr.add_ff(); self.Make_Right = gr.sub_ff(); - self.stereo_dsbsc_filter = gr.fir_filter_fcc(audio_decimation, - stereo_dsbsc_filter_coeffs) + self.stereo_dsbsc_filter = \ + filter.fir_filter_fcc(audio_decimation, + stereo_dsbsc_filter_coeffs) if 1: # send the real signal to complex filter to pick off the # carrier and then to one side of a multiplier - self.connect (self, self.fm_demod, self.stereo_carrier_filter, - self.stereo_carrier_pll_recovery, - (self.stereo_carrier_generator,0)) + self.connect(self, self.fm_demod, self.stereo_carrier_filter, + self.stereo_carrier_pll_recovery, + (self.stereo_carrier_generator,0)) # send the already filtered carrier to the otherside of the carrier # the resulting signal from this multiplier is the carrier # with correct phase but at -38000 Hz. - self.connect (self.stereo_carrier_pll_recovery, (self.stereo_carrier_generator,1)) + self.connect(self.stereo_carrier_pll_recovery, (self.stereo_carrier_generator,1)) # send the new carrier to one side of the mixer (multiplier) - self.connect (self.stereo_carrier_generator, (self.stereo_basebander,0)) + self.connect(self.stereo_carrier_generator, (self.stereo_basebander,0)) # send the demphasized audio to the DSBSC pick off filter, the complex # DSBSC signal at +38000 Hz is sent to the other side of the mixer/multiplier # the result is BASEBANDED DSBSC with phase zero! - self.connect (self.fm_demod,self.stereo_dsbsc_filter, (self.stereo_basebander,1)) + self.connect(self.fm_demod,self.stereo_dsbsc_filter, (self.stereo_basebander,1)) # Pick off the real part since the imaginary is # theoretically zero and then to one side of a summer - self.connect (self.stereo_basebander, self.LmR_real, (self.Make_Left,0)) + self.connect(self.stereo_basebander, self.LmR_real, (self.Make_Left,0)) #take the same real part of the DSBSC baseband signal and #send it to negative side of a subtracter - self.connect (self.LmR_real,(self.Make_Right,1)) + self.connect(self.LmR_real,(self.Make_Right,1)) # Make rds carrier by taking the squared pilot tone and # multiplying by pilot tone - self.connect (self.stereo_basebander,(self.rds_carrier_generator,0)) - self.connect (self.stereo_carrier_pll_recovery,(self.rds_carrier_generator,1)) + self.connect(self.stereo_basebander,(self.rds_carrier_generator,0)) + self.connect(self.stereo_carrier_pll_recovery,(self.rds_carrier_generator,1)) # take signal, filter off rds, send into mixer 0 channel - self.connect (self.fm_demod,self.rds_signal_filter,(self.rds_signal_generator,0)) + self.connect(self.fm_demod,self.rds_signal_filter,(self.rds_signal_generator,0)) # take rds_carrier_generator output and send into mixer 1 # channel - self.connect (self.rds_carrier_generator,(self.rds_signal_generator,1)) + self.connect(self.rds_carrier_generator,(self.rds_signal_generator,1)) # send basebanded rds signal and send into "processor" # which for now is a null sink - self.connect (self.rds_signal_generator,self_rds_signal_processor) + self.connect(self.rds_signal_generator,self_rds_signal_processor) if 1: diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_pll.py b/gr-analog/python/wfm_rcv_pll.py index 0b8706bf27..c26dfb4928 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_pll.py +++ b/gr-analog/python/wfm_rcv_pll.py @@ -1,5 +1,5 @@ # -# Copyright 2005,2006 Free Software Foundation, Inc. +# Copyright 2005,2006,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -19,12 +19,17 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr -from gnuradio.blks2impl.fm_emph import fm_deemph +from gnuradio import gr, filter +from fm_emph import fm_deemph import math +try: + from gnuradio import analog +except ImportError: + import analog_swig as analog + class wfm_rcv_pll(gr.hier_block2): - def __init__ (self, demod_rate, audio_decimation): + def __init__(self, demod_rate, audio_decimation): """ Hierarchical block for demodulating a broadcast FM signal. @@ -48,32 +53,33 @@ class wfm_rcv_pll(gr.hier_block2): # input: complex; output: float loop_bw = 2*math.pi/100.0 max_freq = 2.0*math.pi*90e3/demod_rate - self.fm_demod = gr.pll_freqdet_cf (loop_bw, max_freq,-max_freq) + self.fm_demod = analog.pll_freqdet_cf(loop_bw, max_freq,-max_freq) # input: float; output: float - self.deemph_Left = fm_deemph (audio_rate) - self.deemph_Right = fm_deemph (audio_rate) + self.deemph_Left = fm_deemph(audio_rate) + self.deemph_Right = fm_deemph(audio_rate) # compute FIR filter taps for audio filter width_of_transition_band = audio_rate / 32 - audio_coeffs = gr.firdes.low_pass (1.0 , # gain - demod_rate, # sampling rate - 15000 , - width_of_transition_band, - gr.firdes.WIN_HAMMING) + audio_coeffs = filter.firdes.low_pass(1.0 , # gain + demod_rate, # sampling rate + 15000 , + width_of_transition_band, + filter.firdes.WIN_HAMMING) # input: float; output: float - self.audio_filter = gr.fir_filter_fff (audio_decimation, audio_coeffs) + self.audio_filter = filter.fir_filter_fff(audio_decimation, audio_coeffs) if 1: # Pick off the stereo carrier/2 with this filter. It attenuated 10 dB so apply 10 dB gain # We pick off the negative frequency half because we want to base band by it! ## NOTE THIS WAS HACKED TO OFFSET INSERTION LOSS DUE TO DEEMPHASIS - stereo_carrier_filter_coeffs = gr.firdes.complex_band_pass(10.0, - demod_rate, - -19020, - -18980, - width_of_transition_band, - gr.firdes.WIN_HAMMING) + stereo_carrier_filter_coeffs = \ + filter.firdes.complex_band_pass(10.0, + demod_rate, + -19020, + -18980, + width_of_transition_band, + filter.firdes.WIN_HAMMING) #print "len stereo carrier filter = ",len(stereo_carrier_filter_coeffs) #print "stereo carrier filter ", stereo_carrier_filter_coeffs @@ -81,17 +87,19 @@ class wfm_rcv_pll(gr.hier_block2): # Pick off the double side band suppressed carrier Left-Right audio. It is attenuated 10 dB so apply 10 dB gain - stereo_dsbsc_filter_coeffs = gr.firdes.complex_band_pass(20.0, - demod_rate, - 38000-15000/2, - 38000+15000/2, - width_of_transition_band, - gr.firdes.WIN_HAMMING) + stereo_dsbsc_filter_coeffs = \ + filter.firdes.complex_band_pass(20.0, + demod_rate, + 38000-15000/2, + 38000+15000/2, + width_of_transition_band, + filter.firdes.WIN_HAMMING) #print "len stereo dsbsc filter = ",len(stereo_dsbsc_filter_coeffs) #print "stereo dsbsc filter ", stereo_dsbsc_filter_coeffs # construct overlap add filter system from coefficients for stereo carrier - self.stereo_carrier_filter = gr.fir_filter_fcc(audio_decimation, stereo_carrier_filter_coeffs) + self.stereo_carrier_filter = \ + filter.fir_filter_fcc(audio_decimation, stereo_carrier_filter_coeffs) # carrier is twice the picked off carrier so arrange to do a commplex multiply @@ -99,37 +107,32 @@ class wfm_rcv_pll(gr.hier_block2): # Pick off the rds signal - stereo_rds_filter_coeffs = gr.firdes.complex_band_pass(30.0, - demod_rate, - 57000 - 1500, - 57000 + 1500, - width_of_transition_band, - gr.firdes.WIN_HAMMING) + stereo_rds_filter_coeffs = \ + filter.firdes.complex_band_pass(30.0, + demod_rate, + 57000 - 1500, + 57000 + 1500, + width_of_transition_band, + filter.firdes.WIN_HAMMING) #print "len stereo dsbsc filter = ",len(stereo_dsbsc_filter_coeffs) #print "stereo dsbsc filter ", stereo_dsbsc_filter_coeffs # construct overlap add filter system from coefficients for stereo carrier - self.rds_signal_filter = gr.fir_filter_fcc(audio_decimation, stereo_rds_filter_coeffs) - - - - - + self.rds_signal_filter = \ + filter.fir_filter_fcc(audio_decimation, stereo_rds_filter_coeffs) self.rds_carrier_generator = gr.multiply_cc(); self.rds_signal_generator = gr.multiply_cc(); self_rds_signal_processor = gr.null_sink(gr.sizeof_gr_complex); - - loop_bw = 2*math.pi/100.0 max_freq = -2.0*math.pi*18990/audio_rate; min_freq = -2.0*math.pi*19010/audio_rate; - self.stereo_carrier_pll_recovery = gr.pll_refout_cc(loop_bw, max_freq, min_freq); + self.stereo_carrier_pll_recovery = \ + analog.pll_refout_cc(loop_bw, max_freq, min_freq); #self.stereo_carrier_pll_recovery.squelch_enable(False) #pll_refout does not have squelch yet, so disabled for now - # set up mixer (multiplier) to get the L-R signal at baseband self.stereo_basebander = gr.multiply_cc(); @@ -140,38 +143,39 @@ class wfm_rcv_pll(gr.hier_block2): self.Make_Left = gr.add_ff(); self.Make_Right = gr.sub_ff(); - self.stereo_dsbsc_filter = gr.fir_filter_fcc(audio_decimation, stereo_dsbsc_filter_coeffs) - + self.stereo_dsbsc_filter = \ + filter.fir_filter_fcc(audio_decimation, stereo_dsbsc_filter_coeffs) if 1: # send the real signal to complex filter to pick off the carrier and then to one side of a multiplier - self.connect (self, self.fm_demod,self.stereo_carrier_filter,self.stereo_carrier_pll_recovery, (self.stereo_carrier_generator,0)) + self.connect(self, self.fm_demod, self.stereo_carrier_filter, + self.stereo_carrier_pll_recovery, (self.stereo_carrier_generator,0)) # send the already filtered carrier to the otherside of the carrier - self.connect (self.stereo_carrier_pll_recovery, (self.stereo_carrier_generator,1)) + self.connect(self.stereo_carrier_pll_recovery, (self.stereo_carrier_generator,1)) # the resulting signal from this multiplier is the carrier with correct phase but at -38000 Hz. # send the new carrier to one side of the mixer (multiplier) - self.connect (self.stereo_carrier_generator, (self.stereo_basebander,0)) + self.connect(self.stereo_carrier_generator, (self.stereo_basebander,0)) # send the demphasized audio to the DSBSC pick off filter, the complex # DSBSC signal at +38000 Hz is sent to the other side of the mixer/multiplier - self.connect (self.fm_demod,self.stereo_dsbsc_filter, (self.stereo_basebander,1)) + self.connect(self.fm_demod,self.stereo_dsbsc_filter, (self.stereo_basebander,1)) # the result is BASEBANDED DSBSC with phase zero! # Pick off the real part since the imaginary is theoretically zero and then to one side of a summer - self.connect (self.stereo_basebander, self.LmR_real, (self.Make_Left,0)) + self.connect(self.stereo_basebander, self.LmR_real, (self.Make_Left,0)) #take the same real part of the DSBSC baseband signal and send it to negative side of a subtracter - self.connect (self.LmR_real,(self.Make_Right,1)) + self.connect(self.LmR_real,(self.Make_Right,1)) # Make rds carrier by taking the squared pilot tone and multiplying by pilot tone - self.connect (self.stereo_basebander,(self.rds_carrier_generator,0)) - self.connect (self.stereo_carrier_pll_recovery,(self.rds_carrier_generator,1)) + self.connect(self.stereo_basebander,(self.rds_carrier_generator,0)) + self.connect(self.stereo_carrier_pll_recovery,(self.rds_carrier_generator,1)) # take signal, filter off rds, send into mixer 0 channel - self.connect (self.fm_demod,self.rds_signal_filter,(self.rds_signal_generator,0)) + self.connect(self.fm_demod,self.rds_signal_filter,(self.rds_signal_generator,0)) # take rds_carrier_generator output and send into mixer 1 channel - self.connect (self.rds_carrier_generator,(self.rds_signal_generator,1)) + self.connect(self.rds_carrier_generator,(self.rds_signal_generator,1)) # send basebanded rds signal and send into "processor" which for now is a null sink - self.connect (self.rds_signal_generator,self_rds_signal_processor) + self.connect(self.rds_signal_generator,self_rds_signal_processor) if 1: diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_tx.py b/gr-analog/python/wfm_tx.py index e7547d6524..be662310db 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_tx.py +++ b/gr-analog/python/wfm_tx.py @@ -1,5 +1,5 @@ # -# Copyright 2005,2007 Free Software Foundation, Inc. +# Copyright 2005,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,8 +20,14 @@ # import math -from gnuradio import gr, optfir -from gnuradio.blks2impl.fm_emph import fm_preemph +from gnuradio import gr +from gnuradio import filter +from fm_emph import fm_preemph + +try: + from gnuradio import analog +except ImportError: + import analog_swig as analog class wfm_tx(gr.hier_block2): def __init__(self, audio_rate, quad_rate, tau=75e-6, max_dev=75e3): @@ -55,22 +61,22 @@ class wfm_tx(gr.hier_block2): if do_interp: interp_factor = quad_rate / audio_rate - interp_taps = optfir.low_pass (interp_factor, # gain - quad_rate, # Fs - 16000, # passband cutoff - 18000, # stopband cutoff - 0.1, # passband ripple dB - 40) # stopband atten dB + interp_taps = filter.optfir.low_pass(interp_factor, # gain + quad_rate, # Fs + 16000, # passband cutoff + 18000, # stopband cutoff + 0.1, # passband ripple dB + 40) # stopband atten dB print "len(interp_taps) =", len(interp_taps) - self.interpolator = gr.interp_fir_filter_fff (interp_factor, interp_taps) + self.interpolator = filter.interp_fir_filter_fff (interp_factor, interp_taps) - self.preemph = fm_preemph (quad_rate, tau=tau) + self.preemph = fm_preemph(quad_rate, tau=tau) k = 2 * math.pi * max_dev / quad_rate - self.modulator = gr.frequency_modulator_fc (k) + self.modulator = analog.frequency_modulator_fc (k) if do_interp: - self.connect (self, self.interpolator, self.preemph, self.modulator, self) + self.connect(self, self.interpolator, self.preemph, self.modulator, self) else: self.connect(self, self.preemph, self.modulator, self) diff --git a/gr-atsc/CMakeLists.txt b/gr-atsc/CMakeLists.txt index 3cb9b39de8..c9a033fc1a 100644 --- a/gr-atsc/CMakeLists.txt +++ b/gr-atsc/CMakeLists.txt @@ -31,6 +31,7 @@ GR_REGISTER_COMPONENT("gr-atsc" ENABLE_GR_ATSC ENABLE_GR_CORE ENABLE_GR_FFT ENABLE_GR_FILTER + ENABLE_GR_ANALOG ) GR_SET_GLOBAL(GR_ATSC_INCLUDE_DIRS diff --git a/gr-atsc/src/lib/CMakeLists.txt b/gr-atsc/src/lib/CMakeLists.txt index 386a8792db..6fc588b8a3 100644 --- a/gr-atsc/src/lib/CMakeLists.txt +++ b/gr-atsc/src/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2011-212 Free Software Foundation, Inc. +# Copyright 2011-2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -23,6 +23,7 @@ include_directories( ${GNURADIO_CORE_INCLUDE_DIRS} ${GR_FILTER_INCLUDE_DIRS} + ${GR_ANALOG_INCLUDE_DIRS} ${GR_ATSC_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} ) @@ -97,6 +98,7 @@ list(APPEND gr_atsc_sources list(APPEND atsc_libs gnuradio-filter + gnuradio-analog gnuradio-core ${Boost_LIBRARIES} ) diff --git a/gr-atsc/src/lib/atsc_fpll.h b/gr-atsc/src/lib/atsc_fpll.h index 0474b8f766..13099b045d 100644 --- a/gr-atsc/src/lib/atsc_fpll.h +++ b/gr-atsc/src/lib/atsc_fpll.h @@ -25,11 +25,13 @@ #include <atsc_api.h> #include <gr_sync_block.h> #include <gr_nco.h> -#include <gr_single_pole_iir.h> -#include <gri_agc_ff.h> +#include <filter/single_pole_iir.h> +#include <analog/agc.h> #include <stdio.h> #include <atsci_diag_output.h> +using namespace gr; + class atsc_fpll; typedef boost::shared_ptr<atsc_fpll> atsc_fpll_sptr; @@ -68,9 +70,9 @@ public: double initial_phase; bool debug_no_update; gr_nco<float,float> nco; - gri_agc_ff agc; // automatic gain control - gr_single_pole_iir<float,float,float> afci; - gr_single_pole_iir<float,float,float> afcq; + analog::kernel::agc_ff agc; // automatic gain control + filter::single_pole_iir<float,float,float> afci; + filter::single_pole_iir<float,float,float> afcq; }; diff --git a/gr-audio/CMakeLists.txt b/gr-audio/CMakeLists.txt index 35fd7fc23d..b264222444 100644 --- a/gr-audio/CMakeLists.txt +++ b/gr-audio/CMakeLists.txt @@ -87,7 +87,6 @@ CPACK_COMPONENT("audio_swig" add_subdirectory(include) add_subdirectory(lib) add_subdirectory(doc) -add_subdirectory(examples/c++) if(ENABLE_PYTHON) add_subdirectory(swig) add_subdirectory(grc) @@ -95,6 +94,10 @@ if(ENABLE_PYTHON) add_subdirectory(examples/grc) endif(ENABLE_PYTHON) +if(ENABLE_GR_ANALOG) + add_subdirectory(examples/c++) +endif(ENABLE_GR_ANALOG) + ######################################################################## # Create Pkg Config File ######################################################################## diff --git a/gr-audio/examples/c++/CMakeLists.txt b/gr-audio/examples/c++/CMakeLists.txt index f0d45817cb..6f3eda2730 100644 --- a/gr-audio/examples/c++/CMakeLists.txt +++ b/gr-audio/examples/c++/CMakeLists.txt @@ -19,8 +19,9 @@ include_directories(${GR_AUDIO_INCLUDE_DIRS}) include_directories(${GNURADIO_CORE_INCLUDE_DIRS}) +include_directories(${GR_ANALOG_INCLUDE_DIRS}) add_executable(dial_tone dial_tone.cc) -target_link_libraries(dial_tone gnuradio-audio) +target_link_libraries(dial_tone gnuradio-audio gnuradio-analog) INSTALL(TARGETS dial_tone diff --git a/gr-audio/examples/c++/dial_tone.cc b/gr-audio/examples/c++/dial_tone.cc index 4cd0ff59cf..801ff35f2e 100644 --- a/gr-audio/examples/c++/dial_tone.cc +++ b/gr-audio/examples/c++/dial_tone.cc @@ -38,9 +38,11 @@ // Include header files for each block used in flowgraph #include <gr_top_block.h> -#include <gr_sig_source_f.h> +#include <analog/sig_source_f.h> #include <gr_audio_sink.h> +using namespace gr; + int main(int argc, char **argv) { int rate = 48000; // Audio card sample rate @@ -52,8 +54,8 @@ int main(int argc, char **argv) gr_top_block_sptr tb = gr_make_top_block("dial_tone"); // Construct a real-valued signal source for each tone, at given sample rate - gr_sig_source_f_sptr src0 = gr_make_sig_source_f(rate, GR_SIN_WAVE, 350, ampl); - gr_sig_source_f_sptr src1 = gr_make_sig_source_f(rate, GR_SIN_WAVE, 440, ampl); + analog::sig_source_f::sptr src0 = analog::sig_source_f::make(rate, analog::GR_SIN_WAVE, 350, ampl); + analog::sig_source_f::sptr src1 = analog::sig_source_f::make(rate, analog::GR_SIN_WAVE, 440, ampl); // Construct an audio sink to accept audio tones audio_sink::sptr sink = audio_make_sink(rate); diff --git a/gr-audio/examples/grc/cvsd_sweep.grc b/gr-audio/examples/grc/cvsd_sweep.grc index b645b747ab..b5735ddf0f 100644 --- a/gr-audio/examples/grc/cvsd_sweep.grc +++ b/gr-audio/examples/grc/cvsd_sweep.grc @@ -1,50 +1,59 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Sat Sep 19 20:30:08 2009</timestamp> + <timestamp>Sat Nov 10 15:10:11 2012</timestamp> <block> - <key>import</key> + <key>options</key> <param> <key>id</key> - <value>import_0</value> + <value>cvsd_sweep</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>import</key> - <value>import math</value> + <key>title</key> + <value>CVSD Vocoder Test</value> </param> <param> - <key>_coordinate</key> - <value>(157, 11)</value> + <key>author</key> + <value></value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>description</key> + <value></value> </param> - </block> - <block> - <key>vocoder_cvsd_decode_bf</key> <param> - <key>id</key> - <value>vocoder_cvsd_decode_bf_0</value> + <key>window_size</key> + <value>1280, 1024</value> </param> <param> - <key>_enabled</key> + <key>generate_options</key> + <value>wx_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> <value>True</value> </param> <param> - <key>resample</key> - <value>resample</value> + <key>max_nouts</key> + <value>0</value> </param> <param> - <key>bw</key> - <value>bw</value> + <key>realtime_scheduling</key> + <value></value> </param> <param> <key>_coordinate</key> - <value>(887, 340)</value> + <value>(10, 10)</value> </param> <param> <key>_rotation</key> @@ -52,42 +61,22 @@ </param> </block> <block> - <key>gr_sig_source_x</key> + <key>import</key> <param> <key>id</key> - <value>tri_source</value> + <value>import_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>samp_rate</key> - <value>audio_rate</value> - </param> - <param> - <key>waveform</key> - <value>gr.GR_TRI_WAVE</value> - </param> - <param> - <key>freq</key> - <value>0.05</value> - </param> - <param> - <key>amp</key> - <value>0.5</value> - </param> - <param> - <key>offset</key> - <value>0</value> + <key>import</key> + <value>import math</value> </param> <param> <key>_coordinate</key> - <value>(44, 316)</value> + <value>(157, 11)</value> </param> <param> <key>_rotation</key> @@ -95,30 +84,26 @@ </param> </block> <block> - <key>gr_throttle</key> + <key>vocoder_cvsd_decode_bf</key> <param> <key>id</key> - <value>throttle</value> + <value>vocoder_cvsd_decode_bf_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>samples_per_second</key> - <value>audio_rate</value> + <key>resample</key> + <value>resample</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>bw</key> + <value>bw</value> </param> <param> <key>_coordinate</key> - <value>(238, 348)</value> + <value>(887, 340)</value> </param> <param> <key>_rotation</key> @@ -206,6 +191,10 @@ <value>gr.GR_MSB_FIRST</value> </param> <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> <key>_coordinate</key> <value>(648, 415)</value> </param> @@ -225,6 +214,14 @@ <value>True</value> </param> <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> <key>_coordinate</key> <value>(676, 483)</value> </param> @@ -435,6 +432,14 @@ <value>0</value> </param> <param> + <key>win</key> + <value>None</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> <key>grid_pos</key> <value>0, 0, 1, 1</value> </param> @@ -443,6 +448,10 @@ <value>displays, 0</value> </param> <param> + <key>freqvar</key> + <value>None</value> + </param> + <param> <key>_coordinate</key> <value>(415, 97)</value> </param> @@ -478,6 +487,10 @@ <value>0</value> </param> <param> + <key>v_offset</key> + <value>0</value> + </param> + <param> <key>t_scale</key> <value>0</value> </param> @@ -494,6 +507,10 @@ <value>1</value> </param> <param> + <key>win_size</key> + <value></value> + </param> + <param> <key>grid_pos</key> <value>1, 0, 1, 1</value> </param> @@ -502,87 +519,16 @@ <value>displays, 0</value> </param> <param> - <key>_coordinate</key> - <value>(414, 425)</value> - </param> - <param> - <key>_rotation</key> - <value>180</value> - </param> - </block> - <block> - <key>wxgui_fftsink2</key> - <param> - <key>id</key> - <value>enc_fft</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>title</key> - <value>Encoded Spectrum</value> - </param> - <param> - <key>samp_rate</key> - <value>audio_rate*resample</value> - </param> - <param> - <key>baseband_freq</key> - <value>0</value> - </param> - <param> - <key>y_per_div</key> - <value>10</value> - </param> - <param> - <key>y_divs</key> - <value>8</value> - </param> - <param> - <key>ref_level</key> - <value>10</value> - </param> - <param> - <key>ref_scale</key> - <value>2.0</value> - </param> - <param> - <key>fft_size</key> - <value>1024</value> - </param> - <param> - <key>fft_rate</key> - <value>30</value> - </param> - <param> - <key>peak_hold</key> - <value>False</value> - </param> - <param> - <key>average</key> - <value>False</value> - </param> - <param> - <key>avg_alpha</key> - <value>0</value> - </param> - <param> - <key>grid_pos</key> - <value>1, 0, 1, 1</value> + <key>trig_mode</key> + <value>gr.gr_TRIG_MODE_AUTO</value> </param> <param> - <key>notebook</key> - <value>displays, 1</value> + <key>y_axis_label</key> + <value>Counts</value> </param> <param> <key>_coordinate</key> - <value>(610, 551)</value> + <value>(414, 425)</value> </param> <param> <key>_rotation</key> @@ -616,6 +562,10 @@ <value>0.5</value> </param> <param> + <key>v_offset</key> + <value>0</value> + </param> + <param> <key>t_scale</key> <value>20.0/(audio_rate*resample)</value> </param> @@ -632,6 +582,10 @@ <value>1</value> </param> <param> + <key>win_size</key> + <value></value> + </param> + <param> <key>grid_pos</key> <value>0, 0, 1, 1</value> </param> @@ -640,6 +594,14 @@ <value>displays, 1</value> </param> <param> + <key>trig_mode</key> + <value>gr.gr_TRIG_MODE_AUTO</value> + </param> + <param> + <key>y_axis_label</key> + <value>Counts</value> + </param> + <param> <key>_coordinate</key> <value>(858, 591)</value> </param> @@ -711,6 +673,14 @@ <value>0</value> </param> <param> + <key>win</key> + <value>None</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> <key>grid_pos</key> <value>0, 0, 1, 1</value> </param> @@ -719,6 +689,10 @@ <value>displays, 2</value> </param> <param> + <key>freqvar</key> + <value>None</value> + </param> + <param> <key>_coordinate</key> <value>(891, 98)</value> </param> @@ -754,6 +728,10 @@ <value>0</value> </param> <param> + <key>v_offset</key> + <value>0</value> + </param> + <param> <key>t_scale</key> <value>0</value> </param> @@ -770,6 +748,10 @@ <value>1</value> </param> <param> + <key>win_size</key> + <value></value> + </param> + <param> <key>grid_pos</key> <value>1, 0, 1, 1</value> </param> @@ -778,6 +760,14 @@ <value>displays, 2</value> </param> <param> + <key>trig_mode</key> + <value>gr.gr_TRIG_MODE_AUTO</value> + </param> + <param> + <key>y_axis_label</key> + <value>Counts</value> + </param> + <param> <key>_coordinate</key> <value>(889, 422)</value> </param> @@ -787,56 +777,170 @@ </param> </block> <block> - <key>options</key> + <key>gr_throttle</key> <param> <key>id</key> - <value>cvsd_sweep</value> + <value>throttle</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>title</key> - <value>CVSD Vocoder Test</value> + <key>type</key> + <value>float</value> </param> <param> - <key>author</key> - <value></value> + <key>samples_per_second</key> + <value>audio_rate</value> </param> <param> - <key>description</key> - <value></value> + <key>vlen</key> + <value>1</value> </param> <param> - <key>window_size</key> - <value>1280, 1024</value> + <key>_coordinate</key> + <value>(238, 348)</value> </param> <param> - <key>generate_options</key> - <value>wx_gui</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>analog_sig_source_x</key> <param> - <key>category</key> - <value>Custom</value> + <key>id</key> + <value>analog_sig_source_x_0</value> </param> <param> - <key>run</key> + <key>_enabled</key> <value>True</value> </param> <param> - <key>realtime_scheduling</key> - <value></value> + <key>type</key> + <value>float</value> + </param> + <param> + <key>samp_rate</key> + <value>audio_rate</value> + </param> + <param> + <key>waveform</key> + <value>analog.GR_TRI_WAVE</value> + </param> + <param> + <key>freq</key> + <value>0.05</value> + </param> + <param> + <key>amp</key> + <value>0.5</value> + </param> + <param> + <key>offset</key> + <value>0</value> </param> <param> <key>_coordinate</key> - <value>(10, 10)</value> + <value>(29, 316)</value> </param> <param> <key>_rotation</key> <value>0</value> </param> </block> + <block> + <key>wxgui_fftsink2</key> + <param> + <key>id</key> + <value>enc_fft</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>title</key> + <value>Encoded Spectrum</value> + </param> + <param> + <key>samp_rate</key> + <value>audio_rate*resample</value> + </param> + <param> + <key>baseband_freq</key> + <value>0</value> + </param> + <param> + <key>y_per_div</key> + <value>10</value> + </param> + <param> + <key>y_divs</key> + <value>8</value> + </param> + <param> + <key>ref_level</key> + <value>10</value> + </param> + <param> + <key>ref_scale</key> + <value>2.0</value> + </param> + <param> + <key>fft_size</key> + <value>1024</value> + </param> + <param> + <key>fft_rate</key> + <value>30</value> + </param> + <param> + <key>peak_hold</key> + <value>False</value> + </param> + <param> + <key>average</key> + <value>False</value> + </param> + <param> + <key>avg_alpha</key> + <value>0</value> + </param> + <param> + <key>win</key> + <value>None</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value>1, 0, 1, 1</value> + </param> + <param> + <key>notebook</key> + <value>displays, 1</value> + </param> + <param> + <key>freqvar</key> + <value>None</value> + </param> + <param> + <key>_coordinate</key> + <value>(610, 559)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> <connection> <source_block_id>vco</source_block_id> <sink_block_id>orig_fft</sink_block_id> @@ -844,12 +948,6 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>tri_source</source_block_id> - <sink_block_id>throttle</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>throttle</source_block_id> <sink_block_id>vco</sink_block_id> <source_key>0</source_key> @@ -915,4 +1013,10 @@ <source_key>0</source_key> <sink_key>0</sink_key> </connection> + <connection> + <source_block_id>analog_sig_source_x_0</source_block_id> + <sink_block_id>throttle</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> </flow_graph> diff --git a/gr-audio/examples/grc/dial_tone.grc b/gr-audio/examples/grc/dial_tone.grc index ac8cbef279..557edbd441 100644 --- a/gr-audio/examples/grc/dial_tone.grc +++ b/gr-audio/examples/grc/dial_tone.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Thu Jul 24 14:27:48 2008</timestamp> + <timestamp>Sat Nov 10 15:10:08 2012</timestamp> <block> <key>options</key> <param> @@ -36,39 +36,24 @@ <value>Custom</value> </param> <param> - <key>_coordinate</key> - <value>(10, 10)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_add_xx</key> - <param> - <key>id</key> - <value>gr_add_xx</value> + <key>run_options</key> + <value>prompt</value> </param> <param> - <key>_enabled</key> + <key>run</key> <value>True</value> </param> <param> - <key>type</key> - <value>float</value> + <key>max_nouts</key> + <value>0</value> </param> <param> - <key>num_inputs</key> - <value>3</value> - </param> - <param> - <key>vlen</key> - <value>1</value> + <key>realtime_scheduling</key> + <value></value> </param> <param> <key>_coordinate</key> - <value>(513, 277)</value> + <value>(10, 10)</value> </param> <param> <key>_rotation</key> @@ -91,7 +76,7 @@ </param> <param> <key>device_name</key> - <value/> + <value></value> </param> <param> <key>ok_to_block</key> @@ -111,34 +96,54 @@ </param> </block> <block> - <key>gr_noise_source_x</key> + <key>variable_slider</key> <param> <key>id</key> - <value>gr_noise_source_x</value> + <value>ampl</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>float</value> + <key>label</key> + <value>Volume</value> </param> <param> - <key>noise_type</key> - <value>gr.GR_GAUSSIAN</value> + <key>value</key> + <value>.4</value> </param> <param> - <key>amp</key> - <value>noise</value> + <key>min</key> + <value>0</value> </param> <param> - <key>seed</key> - <value>42</value> + <key>max</key> + <value>.5</value> + </param> + <param> + <key>num_steps</key> + <value>100</value> + </param> + <param> + <key>style</key> + <value>wx.SL_HORIZONTAL</value> + </param> + <param> + <key>converver</key> + <value>float_converter</value> + </param> + <param> + <key>grid_pos</key> + <value>0, 0, 1, 2</value> + </param> + <param> + <key>notebook</key> + <value></value> </param> <param> <key>_coordinate</key> - <value>(238, 380)</value> + <value>(634, 413)</value> </param> <param> <key>_rotation</key> @@ -146,42 +151,54 @@ </param> </block> <block> - <key>gr_sig_source_x</key> + <key>variable_slider</key> <param> <key>id</key> - <value>gr_sig_source_x</value> + <value>noise</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>float</value> + <key>label</key> + <value>Noise</value> </param> <param> - <key>samp_rate</key> - <value>samp_rate</value> + <key>value</key> + <value>.005</value> </param> <param> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> + <key>min</key> + <value>0</value> </param> <param> - <key>freq</key> - <value>440</value> + <key>max</key> + <value>.2</value> </param> <param> - <key>amp</key> - <value>ampl</value> + <key>num_steps</key> + <value>100</value> </param> <param> - <key>offset</key> - <value>0</value> + <key>style</key> + <value>wx.SL_HORIZONTAL</value> + </param> + <param> + <key>converver</key> + <value>float_converter</value> + </param> + <param> + <key>grid_pos</key> + <value>1, 0, 1, 2</value> + </param> + <param> + <key>notebook</key> + <value></value> </param> <param> <key>_coordinate</key> - <value>(240, 208)</value> + <value>(443, 412)</value> </param> <param> <key>_rotation</key> @@ -189,42 +206,53 @@ </param> </block> <block> - <key>gr_sig_source_x</key> + <key>variable</key> <param> <key>id</key> - <value>gr_sig_source_x0</value> + <value>samp_rate</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>float</value> + <key>value</key> + <value>32000</value> </param> <param> - <key>samp_rate</key> - <value>samp_rate</value> + <key>_coordinate</key> + <value>(11, 171)</value> </param> <param> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>gr_add_xx</key> <param> - <key>freq</key> - <value>350</value> + <key>id</key> + <value>gr_add_xx</value> </param> <param> - <key>amp</key> - <value>ampl</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>offset</key> - <value>0</value> + <key>type</key> + <value>float</value> + </param> + <param> + <key>num_inputs</key> + <value>3</value> + </param> + <param> + <key>vlen</key> + <value>1</value> </param> <param> <key>_coordinate</key> - <value>(240, 38)</value> + <value>(513, 277)</value> </param> <param> <key>_rotation</key> @@ -232,46 +260,42 @@ </param> </block> <block> - <key>variable_slider</key> + <key>analog_sig_source_x</key> <param> <key>id</key> - <value>ampl</value> + <value>analog_sig_source_x_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>label</key> - <value>Volume</value> - </param> - <param> - <key>value</key> - <value>.4</value> + <key>type</key> + <value>float</value> </param> <param> - <key>min</key> - <value>0</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>max</key> - <value>.5</value> + <key>waveform</key> + <value>analog.GR_COS_WAVE</value> </param> <param> - <key>num_steps</key> - <value>100</value> + <key>freq</key> + <value>350</value> </param> <param> - <key>slider_type</key> - <value>horizontal</value> + <key>amp</key> + <value>ampl</value> </param> <param> - <key>grid_pos</key> - <value>0, 0, 1, 2</value> + <key>offset</key> + <value>0</value> </param> <param> <key>_coordinate</key> - <value>(634, 413)</value> + <value>(251, 100)</value> </param> <param> <key>_rotation</key> @@ -279,46 +303,42 @@ </param> </block> <block> - <key>variable_slider</key> + <key>analog_sig_source_x</key> <param> <key>id</key> - <value>noise</value> + <value>analog_sig_source_x_1</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>label</key> - <value>Noise</value> - </param> - <param> - <key>value</key> - <value>.005</value> + <key>type</key> + <value>float</value> </param> <param> - <key>min</key> - <value>0</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>max</key> - <value>.2</value> + <key>waveform</key> + <value>analog.GR_COS_WAVE</value> </param> <param> - <key>num_steps</key> - <value>100</value> + <key>freq</key> + <value>440</value> </param> <param> - <key>slider_type</key> - <value>horizontal</value> + <key>amp</key> + <value>ampl</value> </param> <param> - <key>grid_pos</key> - <value>1, 0, 1, 2</value> + <key>offset</key> + <value>0</value> </param> <param> <key>_coordinate</key> - <value>(443, 412)</value> + <value>(250, 214)</value> </param> <param> <key>_rotation</key> @@ -326,22 +346,34 @@ </param> </block> <block> - <key>variable</key> + <key>analog_noise_source_x</key> <param> <key>id</key> - <value>samp_rate</value> + <value>analog_noise_source_x_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>32000</value> + <key>type</key> + <value>float</value> + </param> + <param> + <key>noise_type</key> + <value>analog.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noise</value> + </param> + <param> + <key>seed</key> + <value>-42</value> </param> <param> <key>_coordinate</key> - <value>(11, 171)</value> + <value>(245, 342)</value> </param> <param> <key>_rotation</key> @@ -349,27 +381,27 @@ </param> </block> <connection> - <source_block_id>gr_sig_source_x0</source_block_id> - <sink_block_id>gr_add_xx</sink_block_id> + <source_block_id>gr_add_xx</source_block_id> + <sink_block_id>audio_sink</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_sig_source_x</source_block_id> + <source_block_id>analog_sig_source_x_0</source_block_id> <sink_block_id>gr_add_xx</sink_block_id> <source_key>0</source_key> - <sink_key>1</sink_key> + <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_noise_source_x</source_block_id> + <source_block_id>analog_sig_source_x_1</source_block_id> <sink_block_id>gr_add_xx</sink_block_id> <source_key>0</source_key> - <sink_key>2</sink_key> + <sink_key>1</sink_key> </connection> <connection> - <source_block_id>gr_add_xx</source_block_id> - <sink_block_id>audio_sink</sink_block_id> + <source_block_id>analog_noise_source_x_0</source_block_id> + <sink_block_id>gr_add_xx</sink_block_id> <source_key>0</source_key> - <sink_key>0</sink_key> + <sink_key>2</sink_key> </connection> </flow_graph> diff --git a/gr-audio/examples/python/dial_tone.py b/gr-audio/examples/python/dial_tone.py index 5661d13d48..c55d0d38dd 100755 --- a/gr-audio/examples/python/dial_tone.py +++ b/gr-audio/examples/python/dial_tone.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005,2007 Free Software Foundation, Inc. +# Copyright 2004,2005,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,6 +25,12 @@ from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + class my_top_block(gr.top_block): def __init__(self): @@ -35,7 +41,7 @@ class my_top_block(gr.top_block): help="pcm output device name. E.g., hw:0,0 or /dev/dsp") parser.add_option("-r", "--sample-rate", type="eng_float", default=48000, help="set sample rate to RATE (48000)") - (options, args) = parser.parse_args () + (options, args) = parser.parse_args() if len(args) != 0: parser.print_help() raise SystemExit, 1 @@ -43,12 +49,11 @@ class my_top_block(gr.top_block): sample_rate = int(options.sample_rate) ampl = 0.1 - src0 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 350, ampl) - src1 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 440, ampl) - dst = audio.sink (sample_rate, options.audio_output) - self.connect (src0, (dst, 0)) - self.connect (src1, (dst, 1)) - + src0 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 350, ampl) + src1 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 440, ampl) + dst = audio.sink(sample_rate, options.audio_output) + self.connect(src0, (dst, 0)) + self.connect(src1, (dst, 1)) if __name__ == '__main__': try: diff --git a/gr-audio/examples/python/dial_tone_daemon.py b/gr-audio/examples/python/dial_tone_daemon.py index b25baebee2..e4dbd95321 100755 --- a/gr-audio/examples/python/dial_tone_daemon.py +++ b/gr-audio/examples/python/dial_tone_daemon.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005,2007,2008 Free Software Foundation, Inc. +# Copyright 2004,2005,2007,2008,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,6 +26,12 @@ from gnuradio.eng_option import eng_option from optparse import OptionParser import os +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + class my_top_block(gr.top_block): def __init__(self): @@ -36,7 +42,7 @@ class my_top_block(gr.top_block): help="pcm output device name. E.g., hw:0,0 or /dev/dsp") parser.add_option("-r", "--sample-rate", type="eng_float", default=48000, help="set sample rate to RATE (48000)") - (options, args) = parser.parse_args () + (options, args) = parser.parse_args() if len(args) != 0: parser.print_help() raise SystemExit, 1 @@ -44,12 +50,11 @@ class my_top_block(gr.top_block): sample_rate = int(options.sample_rate) ampl = 0.1 - src0 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 350, ampl) - src1 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 440, ampl) - dst = audio.sink (sample_rate, options.audio_output) - self.connect (src0, (dst, 0)) - self.connect (src1, (dst, 1)) - + src0 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 350, ampl) + src1 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 440, ampl) + dst = audio.sink(sample_rate, options.audio_output) + self.connect(src0, (dst, 0)) + self.connect(src1, (dst, 1)) if __name__ == '__main__': pid = gru.daemonize() diff --git a/gr-audio/examples/python/dial_tone_wav.py b/gr-audio/examples/python/dial_tone_wav.py index c06af55b70..4d8d6b4019 100755 --- a/gr-audio/examples/python/dial_tone_wav.py +++ b/gr-audio/examples/python/dial_tone_wav.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005,2007,2008 Free Software Foundation, Inc. +# Copyright 2004,2005,2007,2008,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,6 +26,12 @@ from gnuradio import gr from gnuradio.eng_option import eng_option from optparse import OptionParser +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + class my_top_block(gr.top_block): def __init__(self): @@ -45,8 +51,8 @@ class my_top_block(gr.top_block): sample_rate = int(options.sample_rate) ampl = 0.1 - src0 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 350, ampl) - src1 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 440, ampl) + src0 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 350, ampl) + src1 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 440, ampl) head0 = gr.head(gr.sizeof_float, int(options.samples)) head1 = gr.head(gr.sizeof_float, int(options.samples)) dst = gr.wavfile_sink(args[0], 2, int(options.sample_rate), 16) diff --git a/gr-audio/examples/python/mono_tone.py b/gr-audio/examples/python/mono_tone.py index bce486e4ab..ad73d62327 100755 --- a/gr-audio/examples/python/mono_tone.py +++ b/gr-audio/examples/python/mono_tone.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005,2007 Free Software Foundation, Inc. +# Copyright 2004,2005,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,6 +25,12 @@ from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + #import os #print os.getpid() #raw_input('Attach gdb and press Enter: ') @@ -50,11 +56,11 @@ class my_top_block(gr.top_block): sample_rate = int(options.sample_rate) ampl = 0.1 - src0 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 650, ampl) + src0 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 650, ampl) - dst = audio.sink (sample_rate, - options.audio_output, - options.ok_to_block) + dst = audio.sink(sample_rate, + options.audio_output, + options.ok_to_block) self.connect (src0, (dst, 0)) diff --git a/gr-audio/examples/python/multi_tone.py b/gr-audio/examples/python/multi_tone.py index 00c213b634..6232cbef52 100755 --- a/gr-audio/examples/python/multi_tone.py +++ b/gr-audio/examples/python/multi_tone.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2006,2007 Free Software Foundation, Inc. +# Copyright 2004,2006,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,6 +25,12 @@ from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + #import os #print os.getpid() #raw_input('Attach gdb and press Enter: ') @@ -43,7 +49,7 @@ class my_top_block(gr.top_block): help="set maximum channels to use") parser.add_option("-D", "--dont-block", action="store_false", default=True, dest="ok_to_block") - (options, args) = parser.parse_args () + (options, args) = parser.parse_args() if len(args) != 0: parser.print_help() raise SystemExit, 1 @@ -69,19 +75,19 @@ class my_top_block(gr.top_block): # progression = (7, 11, 1, 5) progression = (7, 11, 1, 5, 9) - dst = audio.sink (sample_rate, - options.audio_output, - options.ok_to_block) + dst = audio.sink(sample_rate, + options.audio_output, + options.ok_to_block) max_chan = dst.input_signature().max_streams() if (max_chan == -1) or (max_chan > limit_channels): max_chan = limit_channels - for i in range (max_chan): - quo, rem = divmod (i, len (progression)) + for i in range(max_chan): + quo, rem = divmod(i, len (progression)) freq = base * ratios[progression[rem]] * (quo + 1) - src = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, freq, ampl) - self.connect (src, (dst, i)) + src = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, freq, ampl) + self.connect(src, (dst, i)) if __name__ == '__main__': try: diff --git a/gr-audio/examples/python/test_resampler.py b/gr-audio/examples/python/test_resampler.py index db7f79fba0..93be86086b 100755 --- a/gr-audio/examples/python/test_resampler.py +++ b/gr-audio/examples/python/test_resampler.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005,2007 Free Software Foundation, Inc. +# Copyright 2004,2005,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,6 +25,11 @@ from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) class my_top_block(gr.top_block): @@ -38,7 +43,7 @@ class my_top_block(gr.top_block): help="set input sample rate to RATE (%default)") parser.add_option("-o", "--output-rate", type="eng_float", default=48000, help="set output sample rate to RATE (%default)") - (options, args) = parser.parse_args () + (options, args) = parser.parse_args() if len(args) != 0: parser.print_help() raise SystemExit, 1 @@ -53,11 +58,10 @@ class my_top_block(gr.top_block): print "decim =", decim ampl = 0.1 - src0 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 650, ampl) + src0 = analog.sig_source_f(input_rate, analog.GR_SIN_WAVE, 650, ampl) rr = blks2.rational_resampler_fff(interp, decim) - dst = audio.sink (output_rate, options.audio_output) - self.connect (src0, rr, (dst, 0)) - + dst = audio.sink(output_rate, options.audio_output) + self.connect(src0, rr, (dst, 0)) if __name__ == '__main__': try: diff --git a/gr-channels/CMakeLists.txt b/gr-channels/CMakeLists.txt new file mode 100644 index 0000000000..54eb23fb0f --- /dev/null +++ b/gr-channels/CMakeLists.txt @@ -0,0 +1,111 @@ +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Setup dependencies +######################################################################## +include(GrBoost) + +######################################################################## +# Register component +######################################################################## +include(GrComponent) + +GR_REGISTER_COMPONENT("gr-channels" ENABLE_GR_CHANNELS + ENABLE_GRUEL + ENABLE_VOLK + Boost_FOUND + ENABLE_GR_CORE + ENABLE_GR_FFT + ENABLE_GR_FILTER + ENABLE_GR_ANALOG +) + +GR_SET_GLOBAL(GR_CHANNELS_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/lib + ${CMAKE_CURRENT_SOURCE_DIR}/include +) + +######################################################################## +# Begin conditional configuration +######################################################################## +if(ENABLE_GR_CHANNELS) + +######################################################################## +# Setup CPack components +######################################################################## +include(GrPackage) +CPACK_SET(CPACK_COMPONENT_GROUP_CHANNELS_DESCRIPTION "GNU Radio Channel Model Blocks") + +CPACK_COMPONENT("channels_runtime" + GROUP "Channel Models" + DISPLAY_NAME "Runtime" + DESCRIPTION "Runtime" + DEPENDS "core_runtime" +) + +CPACK_COMPONENT("channels_devel" + GROUP "Channel Models" + DISPLAY_NAME "Development" + DESCRIPTION "C++ headers, package config, import libraries" + DEPENDS "core_devel" +) + +CPACK_COMPONENT("channels_python" + GROUP "Channel Models" + DISPLAY_NAME "Python" + DESCRIPTION "Python modules for runtime; GRC xml files" + DEPENDS "core_python;channels_runtime" +) + +CPACK_COMPONENT("channels_swig" + GROUP "Channel Models" + DISPLAY_NAME "SWIG" + DESCRIPTION "SWIG development .i files" + DEPENDS "core_swig;channels_python;channels_devel" +) + +######################################################################## +# Add subdirectories +######################################################################## +add_subdirectory(include/channels) +add_subdirectory(lib) +if(ENABLE_PYTHON) + add_subdirectory(swig) + add_subdirectory(python) + add_subdirectory(grc) +endif(ENABLE_PYTHON) +#add_subdirectory(examples) +add_subdirectory(doc) + +######################################################################## +# Create Pkg Config File +######################################################################## +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-channels.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-channels.pc +@ONLY) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-channels.pc + DESTINATION ${GR_LIBRARY_DIR}/pkgconfig + COMPONENT "channels_devel" +) + +endif(ENABLE_GR_CHANNELS) diff --git a/gr-channels/doc/CMakeLists.txt b/gr-channels/doc/CMakeLists.txt new file mode 100644 index 0000000000..53f878c215 --- /dev/null +++ b/gr-channels/doc/CMakeLists.txt @@ -0,0 +1,23 @@ +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +install( + FILES README.channels + DESTINATION ${GR_PKG_DOC_DIR} +) diff --git a/gr-channels/doc/README.channels b/gr-channels/doc/README.channels new file mode 100644 index 0000000000..2488266a0b --- /dev/null +++ b/gr-channels/doc/README.channels @@ -0,0 +1,13 @@ +This is the gr-channels package. It contains signal processing blocks to +simulate channel models. + +The Python namespace is in gnuradio.channels, which would be normally +imported as: + + from gnuradio import channels + +See the Doxygen documentation for details about the blocks available +in this package. A quick listing of the details can be found in Python +after importing by using: + + help(channels) diff --git a/gr-channels/doc/channels.dox b/gr-channels/doc/channels.dox new file mode 100644 index 0000000000..c4440b45b0 --- /dev/null +++ b/gr-channels/doc/channels.dox @@ -0,0 +1,23 @@ +/*! \page page_channels Channel Model Blocks + +\section Introduction + +This is the gr-channels package. It contains signal processing blocks to +simulate channel models. + +The Python namespace is in gnuradio.channels, which would be normally +imported as: + +\code + from gnuradio import channels +\endcode + +See the Doxygen documentation for details about the blocks available +in this package. A quick listing of the details can be found in Python +after importing by using: + +\code + help(channels) +\endcode + +*/ diff --git a/gr-channels/gnuradio-channels.pc.in b/gr-channels/gnuradio-channels.pc.in new file mode 100644 index 0000000000..9e6192db2b --- /dev/null +++ b/gr-channels/gnuradio-channels.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: gnuradio-channels +Description: GNU Radio's channel model blocks +Requires: gnuradio-core gnuradio-filter +Version: @LIBVER@ +Libs: -L${libdir} -lgnuradio-channels -lgnuradio-filter +Cflags: -I${includedir} diff --git a/gr-channels/grc/CMakeLists.txt b/gr-channels/grc/CMakeLists.txt new file mode 100644 index 0000000000..9e77fcc4ef --- /dev/null +++ b/gr-channels/grc/CMakeLists.txt @@ -0,0 +1,25 @@ +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +install(FILES + channels_block_tree.xml + channels_channel_model.xml + DESTINATION ${GRC_BLOCKS_DIR} + COMPONENT "channels_python" +) diff --git a/gr-channels/grc/channels_block_tree.xml b/gr-channels/grc/channels_block_tree.xml new file mode 100644 index 0000000000..587eebb6e9 --- /dev/null +++ b/gr-channels/grc/channels_block_tree.xml @@ -0,0 +1,35 @@ +<?xml version="1.0"?> + +<!-- + Copyright 2012 Free Software Foundation, Inc. + + This file is part of GNU Radio + + GNU Radio is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GNU Radio is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Radio; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, + Boston, MA 02110-1301, USA. +--> + +<!-- +################################################### +##Block Tree for GR Channel Model blocks. +################################################### + --> +<cat> + <name></name> <!-- Blank for Root Name --> + <cat> + <name>Channel Models</name> + <block>channels_channel_model</block> + </cat> +</cat> diff --git a/gr-filter/grc/filter_channel_model.xml b/gr-channels/grc/channels_channel_model.xml index 6d780974a2..fa881a10b5 100644 --- a/gr-filter/grc/filter_channel_model.xml +++ b/gr-channels/grc/channels_channel_model.xml @@ -6,10 +6,10 @@ --> <block> <name>Channel Model</name> - <key>channel_model</key> - <import>from gnuradio import filter</import> + <key>channels_channel_model</key> + <import>from gnuradio import channels</import> <import>from gnuradio.filter import firdes</import> - <make>filter.channel_model( + <make>channels.channel_model( noise_voltage=$noise_voltage, frequency_offset=$freq_offset, epsilon=$epsilon, diff --git a/gr-channels/include/channels/CMakeLists.txt b/gr-channels/include/channels/CMakeLists.txt new file mode 100644 index 0000000000..a913b96819 --- /dev/null +++ b/gr-channels/include/channels/CMakeLists.txt @@ -0,0 +1,29 @@ +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Install header files +######################################################################## +install(FILES + api.h + channel_model.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/channels + COMPONENT "channels_devel" +) + diff --git a/gnuradio-core/src/lib/general/gr_dpll_bb.i b/gr-channels/include/channels/api.h index f31a873743..41e65ca7cd 100644 --- a/gnuradio-core/src/lib/general/gr_dpll_bb.i +++ b/gr-channels/include/channels/api.h @@ -1,6 +1,5 @@ -/* -*- c++ -*- */ /* - * Copyright 2007 Free Software Foundation, Inc. + * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,12 +19,15 @@ * Boston, MA 02110-1301, USA. */ -GR_SWIG_BLOCK_MAGIC(gr,dpll_bb) +#ifndef INCLUDED_CHANNELS_API_H +#define INCLUDED_CHANNELS_API_H - gr_dpll_bb_sptr gr_make_dpll_bb (float period, float gain); +#include <gruel/attributes.h> -class gr_dpll_bb : public gr_sync_block -{ - private: - gr_dpll_bb (float period, float gain); -}; +#ifdef gnuradio_channels_EXPORTS +# define CHANNELS_API __GR_ATTR_EXPORT +#else +# define CHANNELS_API __GR_ATTR_IMPORT +#endif + +#endif /* INCLUDED_CHANNELS_API_H */ diff --git a/gr-filter/include/filter/channel_model.h b/gr-channels/include/channels/channel_model.h index 49c08181f7..e509933af0 100644 --- a/gr-filter/include/filter/channel_model.h +++ b/gr-channels/include/channels/channel_model.h @@ -20,15 +20,15 @@ * Boston, MA 02110-1301, USA. */ -#ifndef INCLUDED_FILTER_CHANNEL_MODEL_H -#define INCLUDED_FILTER_CHANNEL_MODEL_H +#ifndef INCLUDED_CHANNELS_CHANNEL_MODEL_H +#define INCLUDED_CHANNELS_CHANNEL_MODEL_H -#include <filter/api.h> +#include <channels/api.h> #include <gr_hier_block2.h> #include <gr_types.h> namespace gr { - namespace filter { + namespace channels { /*! * \brief channel simulator @@ -44,10 +44,10 @@ namespace gr { * Multipath can be approximated in this model by using a FIR * filter representation of a multipath delay profile.. */ - class FILTER_API channel_model : virtual public gr_hier_block2 + class CHANNELS_API channel_model : virtual public gr_hier_block2 { public: - // gr::filter::channel_model::sptr + // gr::channels::channel_model::sptr typedef boost::shared_ptr<channel_model> sptr; /*! \brief Build the channel simulator. @@ -81,7 +81,7 @@ namespace gr { virtual double timing_offset() const = 0; }; - } /* namespace filter */ + } /* namespace channels */ } /* namespace gr */ -#endif /* INCLUDED_FILTER_CHANNEL_MODEL_H */ +#endif /* INCLUDED_CHANNELS_CHANNEL_MODEL_H */ diff --git a/gr-channels/lib/CMakeLists.txt b/gr-channels/lib/CMakeLists.txt new file mode 100644 index 0000000000..679586707f --- /dev/null +++ b/gr-channels/lib/CMakeLists.txt @@ -0,0 +1,55 @@ +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Setup the include and linker paths +######################################################################## +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${GNURADIO_CORE_INCLUDE_DIRS} + ${GR_FILTER_INCLUDE_DIRS} + ${GR_ANALOG_INCLUDE_DIRS} + ${GR_CHANNELS_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} +) + +link_directories(${Boost_LIBRARY_DIRS}) + +######################################################################## +# Setup library +######################################################################## +list(APPEND channels_sources + channel_model_impl.cc +) + +list(APPEND channels_libs + volk + gnuradio-core + gnuradio-filter + gnuradio-analog + ${Boost_LIBRARIES} +) + +add_library(gnuradio-channels SHARED ${channels_sources}) +target_link_libraries(gnuradio-channels ${channels_libs}) +GR_LIBRARY_FOO(gnuradio-channels RUNTIME_COMPONENT "channels_runtime" DEVEL_COMPONENT "channels_devel") +add_dependencies(gnuradio-channels + channels_generated_includes channels_generated_swigs + gnuradio-core gnuradio-filter gnuradio-analog) diff --git a/gr-filter/lib/channel_model_impl.cc b/gr-channels/lib/channel_model_impl.cc index 88732d95d3..5b5586c1bd 100644 --- a/gr-filter/lib/channel_model_impl.cc +++ b/gr-channels/lib/channel_model_impl.cc @@ -25,7 +25,7 @@ #include <iostream> namespace gr { - namespace filter { + namespace channels { channel_model::sptr channel_model::make(double noise_voltage, @@ -57,13 +57,15 @@ namespace gr { d_taps.push_back(0); } - d_timing_offset = fractional_interpolator_cc::make(0, epsilon); + d_timing_offset = filter::fractional_interpolator_cc::make(0, epsilon); - d_multipath = fir_filter_ccc::make(1, d_taps); + d_multipath = filter::fir_filter_ccc::make(1, d_taps); d_noise_adder = gr_make_add_cc(); - d_noise = gr_make_noise_source_c(GR_GAUSSIAN, noise_voltage, noise_seed); - d_freq_offset = gr_make_sig_source_c(1, GR_SIN_WAVE, frequency_offset, 1.0, 0.0); + d_noise = analog::noise_source_c::make(analog::GR_GAUSSIAN, + noise_voltage, noise_seed); + d_freq_offset = analog::sig_source_c::make(1, analog::GR_SIN_WAVE, + frequency_offset, 1.0, 0.0); d_mixer_offset = gr_make_multiply_cc(); connect(self(), 0, d_timing_offset, 0); @@ -131,5 +133,5 @@ namespace gr { return d_timing_offset->interp_ratio(); } - } /* namespace filter */ + } /* namespace channels */ } /* namespace gr */ diff --git a/gr-filter/lib/channel_model_impl.h b/gr-channels/lib/channel_model_impl.h index 95a63d7904..9c36f6369e 100644 --- a/gr-filter/lib/channel_model_impl.h +++ b/gr-channels/lib/channel_model_impl.h @@ -20,31 +20,32 @@ * Boston, MA 02110-1301, USA. */ -#ifndef INCLUDED_FILTER_CHANNEL_MODEL_IMPL_H -#define INCLUDED_FILTER_CHANNEL_MODEL_IMPL_H +#ifndef INCLUDED_CHANNELS_CHANNEL_MODEL_IMPL_H +#define INCLUDED_CHANNELS_CHANNEL_MODEL_IMPL_H #include <gr_top_block.h> -#include <gr_sig_source_c.h> #include <gr_add_cc.h> #include <gr_multiply_cc.h> -#include <gr_noise_source_c.h> -#include <filter/channel_model.h> +#include <analog/sig_source_c.h> +#include <analog/noise_source_c.h> +#include <channels/channel_model.h> #include <filter/fractional_interpolator_cc.h> #include <filter/fir_filter_ccc.h> namespace gr { - namespace filter { + namespace channels { - class FILTER_API channel_model_impl : public channel_model + class CHANNELS_API channel_model_impl : public channel_model { private: - gr_sig_source_c_sptr d_freq_offset; gr_add_cc_sptr d_noise_adder; - gr_noise_source_c_sptr d_noise; gr_multiply_cc_sptr d_mixer_offset; - fractional_interpolator_cc::sptr d_timing_offset; - fir_filter_ccc::sptr d_multipath; + analog::sig_source_c::sptr d_freq_offset; + analog::noise_source_c::sptr d_noise; + + filter::fractional_interpolator_cc::sptr d_timing_offset; + filter::fir_filter_ccc::sptr d_multipath; std::vector<gr_complex> d_taps; @@ -68,7 +69,7 @@ namespace gr { double timing_offset() const; }; - } /* namespace filter */ + } /* namespace channels */ } /* namespace gr */ -#endif /* INCLUDED_FILTER_CHANNEL_MODEL_IMPL_H */ +#endif /* INCLUDED_CHANNELS_CHANNEL_MODEL_IMPL_H */ diff --git a/gr-channels/python/CMakeLists.txt b/gr-channels/python/CMakeLists.txt new file mode 100644 index 0000000000..b394b32392 --- /dev/null +++ b/gr-channels/python/CMakeLists.txt @@ -0,0 +1,49 @@ +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +include(GrPython) + +GR_PYTHON_INSTALL( + FILES + __init__.py + DESTINATION ${GR_PYTHON_DIR}/gnuradio/channels + COMPONENT "channels_python" +) + +######################################################################## +# Handle the unit tests +######################################################################## +if(ENABLE_TESTING) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS + ${CMAKE_BINARY_DIR}/gnuradio-core/src/python + ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig + ${CMAKE_BINARY_DIR}/gr-channels/python + ${CMAKE_BINARY_DIR}/gr-channels/swig + ${CMAKE_BINARY_DIR}/gr-analog/python + ${CMAKE_BINARY_DIR}/gr-analog/swig + ) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-channels) + GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING) diff --git a/gr-channels/python/__init__.py b/gr-channels/python/__init__.py new file mode 100644 index 0000000000..da50a05fc4 --- /dev/null +++ b/gr-channels/python/__init__.py @@ -0,0 +1,27 @@ +# +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +''' +This is the gr-channels package. This package provides GNU Radio +processing blocks for channel models and related functions. +''' + +from channels_swig import * diff --git a/gr-filter/python/qa_channel_model.py b/gr-channels/python/qa_channel_model.py index 7f1c61b4e3..0a99477097 100755 --- a/gr-filter/python/qa_channel_model.py +++ b/gr-channels/python/qa_channel_model.py @@ -21,7 +21,8 @@ # from gnuradio import gr, gr_unittest -import filter_swig as filter +import analog_swig as analog +import channels_swig as channels import math class test_channel_model(gr_unittest.TestCase): @@ -37,9 +38,9 @@ class test_channel_model(gr_unittest.TestCase): fs = 1000 # baseband sampling rate freq = 100 - signal = gr.sig_source_c(fs, gr.GR_SIN_WAVE, freq, 1) + signal = analog.sig_source_c(fs, analog.GR_SIN_WAVE, freq, 1) head = gr.head(gr.sizeof_gr_complex, N) - op = filter.channel_model(0.0, 0.0, 1.0, [1,], 0) + op = channels.channel_model(0.0, 0.0, 1.0, [1,], 0) snk = gr.vector_sink_c() snk1 = gr.vector_sink_c() diff --git a/gr-channels/swig/CMakeLists.txt b/gr-channels/swig/CMakeLists.txt new file mode 100644 index 0000000000..e28d952e7a --- /dev/null +++ b/gr-channels/swig/CMakeLists.txt @@ -0,0 +1,53 @@ +# Copyright 2012 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Setup swig generation +######################################################################## +include(GrPython) +include(GrSwig) + +set(GR_SWIG_TARGET_DEPS core_swig) + +set(GR_SWIG_INCLUDE_DIRS + ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} + ${GR_FILTER_INCLUDE_DIRS} + ${GR_CHANNELS_INCLUDE_DIRS} +) + +set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/channels_swig_doc.i) +set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include/channels) + +set(GR_SWIG_LIBRARIES gnuradio-channels) + +GR_SWIG_MAKE(channels_swig channels_swig.i) + +GR_SWIG_INSTALL( + TARGETS channels_swig + DESTINATION ${GR_PYTHON_DIR}/gnuradio/channels + COMPONENT "channels_python" +) + +install( + FILES + channels_swig.i + ${CMAKE_CURRENT_BINARY_DIR}/channels_swig_doc.i + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig + COMPONENT "channels_swig" +) diff --git a/gnuradio-core/src/lib/gengen/gr_noise_type.h b/gr-channels/swig/channels_swig.i index d2aba9b0c7..364f8d0fbd 100644 --- a/gnuradio-core/src/lib/gengen/gr_noise_type.h +++ b/gr-channels/swig/channels_swig.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,11 +20,17 @@ * Boston, MA 02110-1301, USA. */ -#ifndef INCLUDED_GR_NOISE_TYPE_H -#define INCLUDED_GR_NOISE_TYPE_H +#define CHANNELS_API -typedef enum { - GR_UNIFORM = 200, GR_GAUSSIAN, GR_LAPLACIAN, GR_IMPULSE -} gr_noise_type_t; +%include "gnuradio.i" -#endif /* INCLUDED_GR_NOISE_TYPE_H */ +//load generated python docstrings +%include "channels_swig_doc.i" + +%{ +#include "channels/channel_model.h" +%} + +%include "channels/channel_model.h" + +GR_SWIG_BLOCK_MAGIC2(channels, channel_model); diff --git a/gr-digital/examples/berawgn.py b/gr-digital/examples/berawgn.py index 2d95a1345f..8ff43b7b92 100755 --- a/gr-digital/examples/berawgn.py +++ b/gr-digital/examples/berawgn.py @@ -36,6 +36,7 @@ magnitude below what you chose for N_BITS. import math import numpy from gnuradio import gr, digital +from gnuradio import analog try: from scipy.special import erfc @@ -92,9 +93,9 @@ class BERAWGNSimu(gr.top_block): src = gr.vector_source_b(data, False) mod = digital.chunks_to_symbols_bc((self.const.points()), 1) add = gr.add_vcc() - noise = gr.noise_source_c(gr.GR_GAUSSIAN, - self.EbN0_to_noise_voltage(EbN0), - RAND_SEED) + noise = analog.noise_source_c(analog.GR_GAUSSIAN, + self.EbN0_to_noise_voltage(EbN0), + RAND_SEED) demod = digital.constellation_decoder_cb(self.const.base()) ber = BitErrors(self.const.bits_per_symbol()) self.sink = gr.vector_sink_f() diff --git a/gr-digital/examples/demod/ber_simulation.grc b/gr-digital/examples/demod/ber_simulation.grc index f41b9cf79b..3097aa8fa5 100644 --- a/gr-digital/examples/demod/ber_simulation.grc +++ b/gr-digital/examples/demod/ber_simulation.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Mon Jul 16 21:09:12 2012</timestamp> + <timestamp>Sat Nov 10 15:31:44 2012</timestamp> <block> <key>options</key> <param> @@ -354,41 +354,6 @@ </param> </block> <block> - <key>gr_noise_source_x</key> - <param> - <key>id</key> - <value>gr_noise_source_x</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>noise_type</key> - <value>gr.GR_GAUSSIAN</value> - </param> - <param> - <key>amp</key> - <value>1.0 / math.sqrt(2.0 * const.bits_per_symbol() * 10**(EbN0/10))</value> - </param> - <param> - <key>seed</key> - <value>42</value> - </param> - <param> - <key>_coordinate</key> - <value>(16, 224)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>variable_slider</key> <param> <key>id</key> @@ -522,6 +487,29 @@ </param> </block> <block> + <key>digital_constellation_decoder_cb</key> + <param> + <key>id</key> + <value>digital_constellation_decoder_cb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>constellation</key> + <value>const.base()</value> + </param> + <param> + <key>_coordinate</key> + <value>(622, 164)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> <key>gr_add_xx</key> <param> <key>id</key> @@ -553,22 +541,34 @@ </param> </block> <block> - <key>digital_constellation_decoder_cb</key> + <key>analog_noise_source_x</key> <param> <key>id</key> - <value>digital_constellation_decoder_cb_0</value> + <value>analog_noise_source_x_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>constellation</key> - <value>const.base()</value> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>noise_type</key> + <value>analog.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>1.0/math.sqrt(2.0 * const.bits_per_symbol() * 10*(EbN0/10))</value> + </param> + <param> + <key>seed</key> + <value>-42</value> </param> <param> <key>_coordinate</key> - <value>(622, 164)</value> + <value>(16, 224)</value> </param> <param> <key>_rotation</key> @@ -588,12 +588,6 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_noise_source_x</source_block_id> - <sink_block_id>gr_add_xx</sink_block_id> - <source_key>0</source_key> - <sink_key>1</sink_key> - </connection> - <connection> <source_block_id>random_source_x</source_block_id> <sink_block_id>gr_throttle</sink_block_id> <source_key>0</source_key> @@ -629,4 +623,10 @@ <source_key>0</source_key> <sink_key>0</sink_key> </connection> + <connection> + <source_block_id>analog_noise_source_x_0</source_block_id> + <sink_block_id>gr_add_xx</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> </flow_graph> diff --git a/gr-digital/examples/demod/dpsk_loopback.grc b/gr-digital/examples/demod/dpsk_loopback.grc index c9867bea20..7a6b2d293f 100644 --- a/gr-digital/examples/demod/dpsk_loopback.grc +++ b/gr-digital/examples/demod/dpsk_loopback.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Thu Jul 5 16:26:53 2012</timestamp> + <timestamp>Sat Nov 10 15:13:23 2012</timestamp> <block> <key>options</key> <param> @@ -139,10 +139,10 @@ </param> </block> <block> - <key>gr_sig_source_x</key> + <key>gr_throttle</key> <param> <key>id</key> - <value>gr_sig_source_x_0</value> + <value>gr_throttle_0_0</value> </param> <param> <key>_enabled</key> @@ -153,28 +153,16 @@ <value>float</value> </param> <param> - <key>samp_rate</key> + <key>samples_per_second</key> <value>samp_rate</value> </param> <param> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> - </param> - <param> - <key>freq</key> - <value>freq</value> - </param> - <param> - <key>amp</key> + <key>vlen</key> <value>1</value> </param> <param> - <key>offset</key> - <value>0</value> - </param> - <param> <key>_coordinate</key> - <value>(184, 9)</value> + <value>(381, 51)</value> </param> <param> <key>_rotation</key> @@ -182,10 +170,10 @@ </param> </block> <block> - <key>digital_dxpsk_mod</key> + <key>blks2_packet_encoder</key> <param> <key>id</key> - <value>digital_dxpsk_mod_1</value> + <value>blks2_packet_encoder_0</value> </param> <param> <key>_enabled</key> @@ -193,62 +181,31 @@ </param> <param> <key>type</key> - <value>dbpsk</value> + <value>float</value> </param> <param> <key>samples_per_symbol</key> <value>2</value> </param> <param> - <key>excess_bw</key> - <value>0.35</value> - </param> - <param> - <key>gray_coded</key> - <value>True</value> - </param> - <param> - <key>verbose</key> - <value>False</value> - </param> - <param> - <key>log</key> - <value>False</value> - </param> - <param> - <key>_coordinate</key> - <value>(745, 16)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> + <key>bits_per_symbol</key> + <value>1</value> </param> - </block> - <block> - <key>gr_throttle</key> <param> - <key>id</key> - <value>gr_throttle_0_0</value> + <key>access_code</key> + <value></value> </param> <param> - <key>_enabled</key> + <key>pad_for_usrp</key> <value>True</value> </param> <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>samples_per_second</key> - <value>samp_rate</value> - </param> - <param> - <key>vlen</key> - <value>1</value> + <key>payload_length</key> + <value>0</value> </param> <param> <key>_coordinate</key> - <value>(358, 39)</value> + <value>(598, 19)</value> </param> <param> <key>_rotation</key> @@ -256,10 +213,10 @@ </param> </block> <block> - <key>blks2_packet_encoder</key> + <key>digital_dxpsk_mod</key> <param> <key>id</key> - <value>blks2_packet_encoder_0</value> + <value>digital_dxpsk_mod_1</value> </param> <param> <key>_enabled</key> @@ -267,31 +224,31 @@ </param> <param> <key>type</key> - <value>float</value> + <value>dbpsk</value> </param> <param> <key>samples_per_symbol</key> <value>2</value> </param> <param> - <key>bits_per_symbol</key> - <value>1</value> + <key>excess_bw</key> + <value>0.35</value> </param> <param> - <key>access_code</key> - <value></value> + <key>mod_code</key> + <value>"gray"</value> </param> <param> - <key>pad_for_usrp</key> - <value>True</value> + <key>verbose</key> + <value>False</value> </param> <param> - <key>payload_length</key> - <value>0</value> + <key>log</key> + <value>False</value> </param> <param> <key>_coordinate</key> - <value>(541, 9)</value> + <value>(806, 27)</value> </param> <param> <key>_rotation</key> @@ -333,12 +290,8 @@ <value>6.28/100.0</value> </param> <param> - <key>omega_relative_limit</key> - <value>0.005</value> - </param> - <param> - <key>gray_coded</key> - <value>True</value> + <key>mod_code</key> + <value>"gray"</value> </param> <param> <key>verbose</key> @@ -354,38 +307,7 @@ </param> <param> <key>_coordinate</key> - <value>(746, 135)</value> - </param> - <param> - <key>_rotation</key> - <value>180</value> - </param> - </block> - <block> - <key>blks2_packet_decoder</key> - <param> - <key>id</key> - <value>blks2_packet_decoder_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>access_code</key> - <value></value> - </param> - <param> - <key>threshold</key> - <value>-1</value> - </param> - <param> - <key>_coordinate</key> - <value>(545, 187)</value> + <value>(745, 139)</value> </param> <param> <key>_rotation</key> @@ -460,7 +382,81 @@ </param> <param> <key>_coordinate</key> - <value>(184, 165)</value> + <value>(184, 163)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>analog_sig_source_x</key> + <param> + <key>id</key> + <value>analog_sig_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>samp_rate</key> + <value>samp_rate</value> + </param> + <param> + <key>waveform</key> + <value>analog.GR_COS_WAVE</value> + </param> + <param> + <key>freq</key> + <value>freq</value> + </param> + <param> + <key>amp</key> + <value>1</value> + </param> + <param> + <key>offset</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(190, 19)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blks2_packet_decoder</key> + <param> + <key>id</key> + <value>blks2_packet_decoder_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>access_code</key> + <value></value> + </param> + <param> + <key>threshold</key> + <value>-1</value> + </param> + <param> + <key>_coordinate</key> + <value>(545, 187)</value> </param> <param> <key>_rotation</key> @@ -498,7 +494,7 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_sig_source_x_0</source_block_id> + <source_block_id>analog_sig_source_x_0</source_block_id> <sink_block_id>gr_throttle_0_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> diff --git a/gr-digital/examples/demod/gfsk_loopback.grc b/gr-digital/examples/demod/gfsk_loopback.grc index 364314aa9a..51f5ade77a 100644 --- a/gr-digital/examples/demod/gfsk_loopback.grc +++ b/gr-digital/examples/demod/gfsk_loopback.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Mon Aug 20 19:52:22 2012</timestamp> + <timestamp>Tue Nov 6 20:52:00 2012</timestamp> <block> <key>options</key> <param> @@ -61,37 +61,6 @@ </param> </block> <block> - <key>gr_throttle</key> - <param> - <key>id</key> - <value>gr_throttle_0_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>samples_per_second</key> - <value>samp_rate</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(413, 50)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>variable</key> <param> <key>id</key> @@ -138,49 +107,6 @@ </param> </block> <block> - <key>gr_sig_source_x</key> - <param> - <key>id</key> - <value>gr_sig_source_x_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>samp_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> - </param> - <param> - <key>freq</key> - <value>freq</value> - </param> - <param> - <key>amp</key> - <value>1</value> - </param> - <param> - <key>offset</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(215, 18)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>variable</key> <param> <key>id</key> @@ -281,10 +207,18 @@ <value>1024</value> </param> <param> - <key>bw</key> + <key>srate</key> <value>samp_rate</value> </param> <param> + <key>ymin</key> + <value>-1</value> + </param> + <param> + <key>ymax</key> + <value>1</value> + </param> + <param> <key>nconnections</key> <value>1</value> </param> @@ -302,10 +236,10 @@ </param> </block> <block> - <key>qtgui_time_sink_x</key> + <key>blks2_packet_encoder</key> <param> <key>id</key> - <value>qtgui_time_sink_x_1_0</value> + <value>blks2_packet_encoder_0</value> </param> <param> <key>_enabled</key> @@ -316,28 +250,28 @@ <value>float</value> </param> <param> - <key>name</key> - <value>QT GUI Plot</value> + <key>samples_per_symbol</key> + <value>sps</value> </param> <param> - <key>size</key> - <value>1024</value> + <key>bits_per_symbol</key> + <value>1</value> </param> <param> - <key>bw</key> - <value>samp_rate</value> + <key>access_code</key> + <value></value> </param> <param> - <key>nconnections</key> - <value>1</value> + <key>pad_for_usrp</key> + <value>True</value> </param> <param> - <key>gui_hint</key> - <value></value> + <key>payload_length</key> + <value>0</value> </param> <param> <key>_coordinate</key> - <value>(888, 386)</value> + <value>(237, 261)</value> </param> <param> <key>_rotation</key> @@ -345,38 +279,30 @@ </param> </block> <block> - <key>digital_gfsk_mod</key> + <key>blks2_packet_decoder</key> <param> <key>id</key> - <value>digital_gfsk_mod_0</value> + <value>blks2_packet_decoder_0</value> </param> <param> <key>_enabled</key> - <value>False</value> - </param> - <param> - <key>samples_per_symbol</key> - <value>sps</value> - </param> - <param> - <key>sensitivity</key> - <value>fm_sensitivity</value> + <value>True</value> </param> <param> - <key>bt</key> - <value>0.35</value> + <key>type</key> + <value>float</value> </param> <param> - <key>verbose</key> - <value>False</value> + <key>access_code</key> + <value></value> </param> <param> - <key>log</key> - <value>False</value> + <key>threshold</key> + <value>-1</value> </param> <param> <key>_coordinate</key> - <value>(456, 277)</value> + <value>(720, 130)</value> </param> <param> <key>_rotation</key> @@ -384,50 +310,30 @@ </param> </block> <block> - <key>digital_gfsk_demod</key> + <key>gr_throttle</key> <param> <key>id</key> - <value>digital_gfsk_demod_0</value> + <value>gr_throttle_0_0</value> </param> <param> <key>_enabled</key> - <value>False</value> - </param> - <param> - <key>samples_per_symbol</key> - <value>sps</value> - </param> - <param> - <key>sensitivity</key> - <value>fm_sensitivity</value> - </param> - <param> - <key>gain_mu</key> - <value>0.175</value> - </param> - <param> - <key>mu</key> - <value>0.5</value> - </param> - <param> - <key>omega_relative_limit</key> - <value>0.005</value> + <value>True</value> </param> <param> - <key>freq_error</key> - <value>0.0</value> + <key>type</key> + <value>float</value> </param> <param> - <key>verbose</key> - <value>False</value> + <key>samples_per_second</key> + <value>samp_rate</value> </param> <param> - <key>log</key> - <value>False</value> + <key>vlen</key> + <value>1</value> </param> <param> <key>_coordinate</key> - <value>(670, 253)</value> + <value>(413, 50)</value> </param> <param> <key>_rotation</key> @@ -435,10 +341,10 @@ </param> </block> <block> - <key>blks2_packet_encoder</key> + <key>analog_sig_source_x</key> <param> <key>id</key> - <value>blks2_packet_encoder_0</value> + <value>analog_sig_source_x_0</value> </param> <param> <key>_enabled</key> @@ -449,28 +355,28 @@ <value>float</value> </param> <param> - <key>samples_per_symbol</key> - <value>sps</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>bits_per_symbol</key> - <value>1</value> + <key>waveform</key> + <value>analog.GR_COS_WAVE</value> </param> <param> - <key>access_code</key> - <value></value> + <key>freq</key> + <value>freq</value> </param> <param> - <key>pad_for_usrp</key> - <value>True</value> + <key>amp</key> + <value>1</value> </param> <param> - <key>payload_length</key> + <key>offset</key> <value>0</value> </param> <param> <key>_coordinate</key> - <value>(237, 261)</value> + <value>(214, 18)</value> </param> <param> <key>_rotation</key> @@ -478,10 +384,10 @@ </param> </block> <block> - <key>digital_gmsk_mod</key> + <key>digital_gfsk_demod</key> <param> <key>id</key> - <value>digital_gmsk_mod_0</value> + <value>digital_gfsk_demod_0</value> </param> <param> <key>_enabled</key> @@ -489,11 +395,27 @@ </param> <param> <key>samples_per_symbol</key> - <value>2</value> + <value>sps</value> </param> <param> - <key>bt</key> - <value>0.35</value> + <key>sensitivity</key> + <value>fm_sensitivity</value> + </param> + <param> + <key>gain_mu</key> + <value>0.175</value> + </param> + <param> + <key>mu</key> + <value>0.5</value> + </param> + <param> + <key>omega_relative_limit</key> + <value>0.005</value> + </param> + <param> + <key>freq_error</key> + <value>0.0</value> </param> <param> <key>verbose</key> @@ -505,7 +427,7 @@ </param> <param> <key>_coordinate</key> - <value>(342, 457)</value> + <value>(670, 253)</value> </param> <param> <key>_rotation</key> @@ -513,22 +435,38 @@ </param> </block> <block> - <key>gr_quadrature_demod_cf</key> + <key>digital_gfsk_mod</key> <param> <key>id</key> - <value>gr_quadrature_demod_cf_0</value> + <value>digital_gfsk_mod_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>gain</key> - <value>1</value> + <key>samples_per_symbol</key> + <value>sps</value> + </param> + <param> + <key>sensitivity</key> + <value>fm_sensitivity</value> + </param> + <param> + <key>bt</key> + <value>0.35</value> + </param> + <param> + <key>verbose</key> + <value>False</value> + </param> + <param> + <key>log</key> + <value>False</value> </param> <param> <key>_coordinate</key> - <value>(679, 402)</value> + <value>(456, 277)</value> </param> <param> <key>_rotation</key> @@ -536,10 +474,10 @@ </param> </block> <block> - <key>blks2_packet_decoder</key> + <key>qtgui_time_sink_x</key> <param> <key>id</key> - <value>blks2_packet_decoder_0</value> + <value>qtgui_time_sink_x_1_0</value> </param> <param> <key>_enabled</key> @@ -550,63 +488,59 @@ <value>float</value> </param> <param> - <key>access_code</key> - <value></value> + <key>name</key> + <value>QT GUI Plot</value> </param> <param> - <key>threshold</key> - <value>-1</value> + <key>size</key> + <value>1024</value> </param> <param> - <key>_coordinate</key> - <value>(720, 130)</value> + <key>srate</key> + <value>samp_rate</value> </param> <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>digital_gmsk_demod</key> - <param> - <key>id</key> - <value>digital_gmsk_demod_0</value> + <key>ymin</key> + <value>-1</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>ymax</key> + <value>1</value> </param> <param> - <key>samples_per_symbol</key> - <value>2</value> + <key>nconnections</key> + <value>1</value> </param> <param> - <key>gain_mu</key> - <value>0.175</value> + <key>gui_hint</key> + <value></value> </param> <param> - <key>mu</key> - <value>0.5</value> + <key>_coordinate</key> + <value>(888, 386)</value> </param> <param> - <key>omega_relative_limit</key> - <value>0.005</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>analog_quadrature_demod_cf</key> <param> - <key>freq_error</key> - <value>0.0</value> + <key>id</key> + <value>analog_quadrature_demod_cf_0</value> </param> <param> - <key>verbose</key> - <value>False</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>log</key> - <value>False</value> + <key>gain</key> + <value>1</value> </param> <param> <key>_coordinate</key> - <value>(622, 498)</value> + <value>(673, 403)</value> </param> <param> <key>_rotation</key> @@ -614,12 +548,6 @@ </param> </block> <connection> - <source_block_id>gr_sig_source_x_0</source_block_id> - <sink_block_id>gr_throttle_0_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>blks2_packet_encoder_0</source_block_id> <sink_block_id>digital_gfsk_mod_0</sink_block_id> <source_key>0</source_key> @@ -632,12 +560,6 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>digital_gfsk_mod_0</source_block_id> - <sink_block_id>gr_quadrature_demod_cf_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>digital_gfsk_demod_0</source_block_id> <sink_block_id>blks2_packet_decoder_0</sink_block_id> <source_key>0</source_key> @@ -656,32 +578,20 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_quadrature_demod_cf_0</source_block_id> - <sink_block_id>qtgui_time_sink_x_1_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>blks2_packet_encoder_0</source_block_id> - <sink_block_id>digital_gmsk_mod_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>digital_gmsk_mod_0</source_block_id> - <sink_block_id>digital_gmsk_demod_0</sink_block_id> + <source_block_id>analog_sig_source_x_0</source_block_id> + <sink_block_id>gr_throttle_0_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>digital_gmsk_mod_0</source_block_id> - <sink_block_id>gr_quadrature_demod_cf_0</sink_block_id> + <source_block_id>digital_gfsk_mod_0</source_block_id> + <sink_block_id>analog_quadrature_demod_cf_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>digital_gmsk_demod_0</source_block_id> - <sink_block_id>blks2_packet_decoder_0</sink_block_id> + <source_block_id>analog_quadrature_demod_cf_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_1_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gr-digital/examples/demod/gmsk_loopback.grc b/gr-digital/examples/demod/gmsk_loopback.grc index 84912ac58b..c4361fbed8 100644 --- a/gr-digital/examples/demod/gmsk_loopback.grc +++ b/gr-digital/examples/demod/gmsk_loopback.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Mon Aug 20 19:53:13 2012</timestamp> + <timestamp>Tue Nov 6 20:49:18 2012</timestamp> <block> <key>options</key> <param> @@ -61,37 +61,6 @@ </param> </block> <block> - <key>gr_throttle</key> - <param> - <key>id</key> - <value>gr_throttle_0_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>samples_per_second</key> - <value>samp_rate</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(413, 50)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>variable</key> <param> <key>id</key> @@ -138,49 +107,6 @@ </param> </block> <block> - <key>gr_sig_source_x</key> - <param> - <key>id</key> - <value>gr_sig_source_x_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>samp_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> - </param> - <param> - <key>freq</key> - <value>freq</value> - </param> - <param> - <key>amp</key> - <value>1</value> - </param> - <param> - <key>offset</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(215, 18)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>variable</key> <param> <key>id</key> @@ -281,10 +207,18 @@ <value>1024</value> </param> <param> - <key>bw</key> + <key>srate</key> <value>samp_rate</value> </param> <param> + <key>ymin</key> + <value>-1</value> + </param> + <param> + <key>ymax</key> + <value>1</value> + </param> + <param> <key>nconnections</key> <value>1</value> </param> @@ -302,10 +236,10 @@ </param> </block> <block> - <key>qtgui_time_sink_x</key> + <key>blks2_packet_encoder</key> <param> <key>id</key> - <value>qtgui_time_sink_x_1_0</value> + <value>blks2_packet_encoder_0</value> </param> <param> <key>_enabled</key> @@ -316,28 +250,28 @@ <value>float</value> </param> <param> - <key>name</key> - <value>QT GUI Plot</value> + <key>samples_per_symbol</key> + <value>sps</value> </param> <param> - <key>size</key> - <value>1024</value> + <key>bits_per_symbol</key> + <value>1</value> </param> <param> - <key>bw</key> - <value>samp_rate</value> + <key>access_code</key> + <value></value> </param> <param> - <key>nconnections</key> - <value>1</value> + <key>pad_for_usrp</key> + <value>True</value> </param> <param> - <key>gui_hint</key> - <value></value> + <key>payload_length</key> + <value>0</value> </param> <param> <key>_coordinate</key> - <value>(888, 386)</value> + <value>(237, 261)</value> </param> <param> <key>_rotation</key> @@ -345,10 +279,10 @@ </param> </block> <block> - <key>blks2_packet_encoder</key> + <key>blks2_packet_decoder</key> <param> <key>id</key> - <value>blks2_packet_encoder_0</value> + <value>blks2_packet_decoder_0</value> </param> <param> <key>_enabled</key> @@ -359,28 +293,63 @@ <value>float</value> </param> <param> - <key>samples_per_symbol</key> - <value>sps</value> + <key>access_code</key> + <value></value> </param> <param> - <key>bits_per_symbol</key> - <value>1</value> + <key>threshold</key> + <value>-1</value> </param> <param> - <key>access_code</key> - <value></value> + <key>_coordinate</key> + <value>(720, 130)</value> </param> <param> - <key>pad_for_usrp</key> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_gmsk_demod</key> + <param> + <key>id</key> + <value>digital_gmsk_demod_0</value> + </param> + <param> + <key>_enabled</key> <value>True</value> </param> <param> - <key>payload_length</key> - <value>0</value> + <key>samples_per_symbol</key> + <value>2</value> + </param> + <param> + <key>gain_mu</key> + <value>0.175</value> + </param> + <param> + <key>mu</key> + <value>0.5</value> + </param> + <param> + <key>omega_relative_limit</key> + <value>0.005</value> + </param> + <param> + <key>freq_error</key> + <value>0.0</value> + </param> + <param> + <key>verbose</key> + <value>False</value> + </param> + <param> + <key>log</key> + <value>False</value> </param> <param> <key>_coordinate</key> - <value>(237, 261)</value> + <value>(666, 261)</value> </param> <param> <key>_rotation</key> @@ -388,22 +357,30 @@ </param> </block> <block> - <key>gr_quadrature_demod_cf</key> + <key>gr_throttle</key> <param> <key>id</key> - <value>gr_quadrature_demod_cf_0</value> + <value>gr_throttle_0_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>gain</key> + <key>type</key> + <value>float</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> <value>1</value> </param> <param> <key>_coordinate</key> - <value>(679, 402)</value> + <value>(413, 50)</value> </param> <param> <key>_rotation</key> @@ -411,10 +388,10 @@ </param> </block> <block> - <key>blks2_packet_decoder</key> + <key>analog_sig_source_x</key> <param> <key>id</key> - <value>blks2_packet_decoder_0</value> + <value>analog_sig_source_x_0</value> </param> <param> <key>_enabled</key> @@ -425,16 +402,28 @@ <value>float</value> </param> <param> - <key>access_code</key> - <value></value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>threshold</key> - <value>-1</value> + <key>waveform</key> + <value>analog.GR_COS_WAVE</value> + </param> + <param> + <key>freq</key> + <value>freq</value> + </param> + <param> + <key>amp</key> + <value>1</value> + </param> + <param> + <key>offset</key> + <value>0</value> </param> <param> <key>_coordinate</key> - <value>(720, 130)</value> + <value>(210, 18)</value> </param> <param> <key>_rotation</key> @@ -442,34 +431,50 @@ </param> </block> <block> - <key>digital_gmsk_mod</key> + <key>qtgui_time_sink_x</key> <param> <key>id</key> - <value>digital_gmsk_mod_0</value> + <value>qtgui_time_sink_x_1_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>samples_per_symbol</key> - <value>2</value> + <key>type</key> + <value>float</value> </param> <param> - <key>bt</key> - <value>0.35</value> + <key>name</key> + <value>QT GUI Plot</value> </param> <param> - <key>verbose</key> - <value>False</value> + <key>size</key> + <value>1024</value> </param> <param> - <key>log</key> - <value>False</value> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>ymin</key> + <value>-1</value> + </param> + <param> + <key>ymax</key> + <value>1</value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>gui_hint</key> + <value></value> </param> <param> <key>_coordinate</key> - <value>(446, 285)</value> + <value>(888, 386)</value> </param> <param> <key>_rotation</key> @@ -477,10 +482,10 @@ </param> </block> <block> - <key>digital_gmsk_demod</key> + <key>digital_gmsk_mod</key> <param> <key>id</key> - <value>digital_gmsk_demod_0</value> + <value>digital_gmsk_mod_0</value> </param> <param> <key>_enabled</key> @@ -491,32 +496,43 @@ <value>2</value> </param> <param> - <key>gain_mu</key> - <value>0.175</value> + <key>bt</key> + <value>0.35</value> </param> <param> - <key>mu</key> - <value>0.5</value> + <key>verbose</key> + <value>False</value> </param> <param> - <key>omega_relative_limit</key> - <value>0.005</value> + <key>log</key> + <value>False</value> </param> <param> - <key>freq_error</key> - <value>0.0</value> + <key>_coordinate</key> + <value>(446, 285)</value> </param> <param> - <key>verbose</key> - <value>False</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>analog_quadrature_demod_cf</key> <param> - <key>log</key> - <value>False</value> + <key>id</key> + <value>analog_quadrature_demod_cf_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>gain</key> + <value>1</value> </param> <param> <key>_coordinate</key> - <value>(666, 261)</value> + <value>(675, 402)</value> </param> <param> <key>_rotation</key> @@ -524,12 +540,6 @@ </param> </block> <connection> - <source_block_id>gr_sig_source_x_0</source_block_id> - <sink_block_id>gr_throttle_0_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>gr_throttle_0_0</source_block_id> <sink_block_id>blks2_packet_encoder_0</sink_block_id> <source_key>0</source_key> @@ -542,12 +552,6 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_quadrature_demod_cf_0</source_block_id> - <sink_block_id>qtgui_time_sink_x_1_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>blks2_packet_encoder_0</source_block_id> <sink_block_id>digital_gmsk_mod_0</sink_block_id> <source_key>0</source_key> @@ -560,14 +564,26 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>digital_gmsk_mod_0</source_block_id> - <sink_block_id>gr_quadrature_demod_cf_0</sink_block_id> + <source_block_id>digital_gmsk_demod_0</source_block_id> + <sink_block_id>blks2_packet_decoder_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>digital_gmsk_demod_0</source_block_id> - <sink_block_id>blks2_packet_decoder_0</sink_block_id> + <source_block_id>analog_sig_source_x_0</source_block_id> + <sink_block_id>gr_throttle_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_quadrature_demod_cf_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_1_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_gmsk_mod_0</source_block_id> + <sink_block_id>analog_quadrature_demod_cf_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gr-digital/examples/narrowband/receive_path.py b/gr-digital/examples/narrowband/receive_path.py index 308f955645..a1a07b5f26 100644 --- a/gr-digital/examples/narrowband/receive_path.py +++ b/gr-digital/examples/narrowband/receive_path.py @@ -23,6 +23,7 @@ from gnuradio import gr, gru, filter from gnuradio import eng_notation from gnuradio import digital +from gnuradio import analog import copy import sys @@ -78,7 +79,7 @@ class receive_path(gr.hier_block2): # Carrier Sensing Blocks alpha = 0.001 thresh = 30 # in dB, will have to adjust - self.probe = gr.probe_avg_mag_sqrd_c(thresh,alpha) + self.probe = analog.probe_avg_mag_sqrd_c(thresh,alpha) # Display some information about the setup if self._verbose: diff --git a/gr-digital/examples/narrowband/rx_voice.py b/gr-digital/examples/narrowband/rx_voice.py index 100caff8ea..079f8cb9b9 100755 --- a/gr-digital/examples/narrowband/rx_voice.py +++ b/gr-digital/examples/narrowband/rx_voice.py @@ -20,7 +20,8 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, blks2, audio, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -75,7 +76,7 @@ class my_top_block(gr.top_block): audio_rate = self.audio_tx.sample_rate usrp_rate = self.source.get_sample_rate() rrate = audio_rate / usrp_rate - self.resampler = blks2.pfb_arb_resampler_ccf(rrate) + self.resampler = filter.pfb.arb_resampler_ccf(rrate) self.connect(self.source, self.resampler, self.rxpath) diff --git a/gr-digital/examples/ofdm/receive_path.py b/gr-digital/examples/ofdm/receive_path.py index b5094ac24d..2a6813f8f9 100644 --- a/gr-digital/examples/ofdm/receive_path.py +++ b/gr-digital/examples/ofdm/receive_path.py @@ -22,6 +22,7 @@ from gnuradio import gr from gnuradio import eng_notation from gnuradio import digital +from gnuradio import analog import copy import sys @@ -51,7 +52,7 @@ class receive_path(gr.hier_block2): # Carrier Sensing Blocks alpha = 0.001 thresh = 30 # in dB, will have to adjust - self.probe = gr.probe_avg_mag_sqrd_c(thresh,alpha) + self.probe = analog.probe_avg_mag_sqrd_c(thresh,alpha) self.connect(self, self.ofdm_rx) self.connect(self.ofdm_rx, self.probe) diff --git a/gr-digital/include/digital/cpmmod_bc.h b/gr-digital/include/digital/cpmmod_bc.h index f65ca8059f..7d91915cdd 100644 --- a/gr-digital/include/digital/cpmmod_bc.h +++ b/gr-digital/include/digital/cpmmod_bc.h @@ -25,7 +25,7 @@ #include <digital/api.h> #include <gr_hier_block2.h> -#include <gr_cpm.h> +#include <analog/cpm.h> namespace gr { namespace digital { @@ -71,7 +71,7 @@ namespace gr { * \param beta For LSRC, this is the rolloff factor. For Gaussian * pulses, this is the 3 dB time-bandwidth product. */ - static sptr make(gr_cpm::cpm_type type, float h, + static sptr make(analog::cpm::cpm_type type, float h, int samples_per_sym, int L, double beta=0.3); diff --git a/gr-digital/lib/cpmmod_bc_impl.cc b/gr-digital/lib/cpmmod_bc_impl.cc index 044090d59a..d6c3a29a29 100644 --- a/gr-digital/lib/cpmmod_bc_impl.cc +++ b/gr-digital/lib/cpmmod_bc_impl.cc @@ -29,13 +29,13 @@ namespace gr { namespace digital { cpmmod_bc::sptr - cpmmod_bc::make(gr_cpm::cpm_type type, float h, + cpmmod_bc::make(analog::cpm::cpm_type type, float h, int samples_per_sym, int L, double beta) { return gnuradio::get_initial_sptr (new cpmmod_bc_impl("cpmmod_bc", - (gr_cpm::cpm_type)type, + (analog::cpm::cpm_type)type, h, samples_per_sym, L, beta)); } @@ -46,30 +46,30 @@ namespace gr { { return gnuradio::get_initial_sptr (new cpmmod_bc_impl("gmskmod_bc", - gr_cpm::GAUSSIAN, 0.5, + analog::cpm::GAUSSIAN, 0.5, samples_per_sym, L, beta)); } cpmmod_bc_impl::cpmmod_bc_impl(const std::string &name, - gr_cpm::cpm_type type, float h, + analog::cpm::cpm_type type, float h, int samples_per_sym, int L, double beta) : gr_hier_block2(name, gr_make_io_signature(1, 1, sizeof(char)), gr_make_io_signature2(1, 1, sizeof(gr_complex), sizeof(float))), d_type(type), d_index(h), d_sps(samples_per_sym), d_length(L), d_beta(beta), - d_taps(gr_cpm::phase_response(type, samples_per_sym, L, beta)), + d_taps(analog::cpm::phase_response(type, samples_per_sym, L, beta)), d_char_to_float(gr_make_char_to_float()), - d_pulse_shaper(gr::filter::interp_fir_filter_fff::make(samples_per_sym, d_taps)), - d_fm(gr_make_frequency_modulator_fc(M_PI * h)) + d_pulse_shaper(filter::interp_fir_filter_fff::make(samples_per_sym, d_taps)), + d_fm(analog::frequency_modulator_fc::make(M_PI * h)) { switch(type) { - case gr_cpm::LRC: - case gr_cpm::LSRC: - case gr_cpm::LREC: - case gr_cpm::TFM: - case gr_cpm::GAUSSIAN: + case analog::cpm::LRC: + case analog::cpm::LSRC: + case analog::cpm::LREC: + case analog::cpm::TFM: + case analog::cpm::GAUSSIAN: break; default: diff --git a/gr-digital/lib/cpmmod_bc_impl.h b/gr-digital/lib/cpmmod_bc_impl.h index d27853e301..3051e49df9 100644 --- a/gr-digital/lib/cpmmod_bc_impl.h +++ b/gr-digital/lib/cpmmod_bc_impl.h @@ -25,8 +25,7 @@ #include <digital/cpmmod_bc.h> #include <gr_char_to_float.h> -#include <gr_frequency_modulator_fc.h> -#include <gr_cpm.h> +#include <analog/frequency_modulator_fc.h> #include <filter/interp_fir_filter_fff.h> namespace gr { @@ -45,11 +44,11 @@ namespace gr { std::vector<float> d_taps; gr_char_to_float_sptr d_char_to_float; gr::filter::interp_fir_filter_fff::sptr d_pulse_shaper; - gr_frequency_modulator_fc_sptr d_fm; + analog::frequency_modulator_fc::sptr d_fm; public: cpmmod_bc_impl(const std::string &name, - gr_cpm::cpm_type type, float h, + analog::cpm::cpm_type type, float h, int samples_per_sym, int L, double beta=0.3); ~cpmmod_bc_impl(); diff --git a/gr-digital/python/CMakeLists.txt b/gr-digital/python/CMakeLists.txt index fdb5acd819..4ea656e29c 100644 --- a/gr-digital/python/CMakeLists.txt +++ b/gr-digital/python/CMakeLists.txt @@ -73,6 +73,8 @@ foreach(py_qa_test_file ${py_qa_test_files}) ${CMAKE_BINARY_DIR}/gr-digital/swig ${CMAKE_BINARY_DIR}/gr-filter/python ${CMAKE_BINARY_DIR}/gr-filter/swig + ${CMAKE_BINARY_DIR}/gr-analog/python + ${CMAKE_BINARY_DIR}/gr-analog/swig ) set(GR_TEST_TARGET_DEPS volk gruel gnuradio-core gnuradio-digital) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) diff --git a/gr-digital/python/cpm.py b/gr-digital/python/cpm.py index a2c9f2f0e0..1929a73d30 100644 --- a/gr-digital/python/cpm.py +++ b/gr-digital/python/cpm.py @@ -25,6 +25,7 @@ # See gnuradio-examples/python/digital for examples from gnuradio import gr, filter +from gnuradio import analog from math import pi import numpy @@ -126,7 +127,7 @@ class cpm_mod(gr.hier_block2): if cpm_type == 0: # CPFSK self.taps= (1.0/self._symbols_per_pulse/2,) * self.ntaps elif cpm_type == 1: # GMSK - gaussian_taps = gr.firdes.gaussian( + gaussian_taps = filter.firdes.gaussian( 1.0/2, # gain samples_per_symbol, # symbol_rate bt, # bandwidth * symbol time @@ -145,7 +146,7 @@ class cpm_mod(gr.hier_block2): self.filter = filter.pfb.arb_resampler_fff(samples_per_symbol, self.taps) # FM modulation - self.fmmod = gr.frequency_modulator_fc(sensitivity) + self.fmmod = analog.frequency_modulator_fc(sensitivity) if verbose: self._print_verbage() diff --git a/gr-digital/python/generic_mod_demod.py b/gr-digital/python/generic_mod_demod.py index 855249dc63..b71118ebcb 100644 --- a/gr-digital/python/generic_mod_demod.py +++ b/gr-digital/python/generic_mod_demod.py @@ -36,6 +36,11 @@ try: except ImportError: import filter_swig as filter +try: + from gnuradio import analog +except ImportError: + import analog_swig as analog + # default values (used in __init__ and add_options) _def_samples_per_symbol = 2 _def_excess_bw = 0.35 @@ -264,7 +269,7 @@ class generic_demod(gr.hier_block2): ntaps = 11 * int(self._samples_per_symbol*nfilts) # Automatic gain control - self.agc = gr.agc2_cc(0.6e-1, 1e-3, 1, 1, 100) + self.agc = analog.agc2_cc(0.6e-1, 1e-3, 1, 1, 100) # Frequency correction fll_ntaps = 55 diff --git a/gr-digital/python/gfsk.py b/gr-digital/python/gfsk.py index 09f12ebc30..c69dd4d7d8 100644 --- a/gr-digital/python/gfsk.py +++ b/gr-digital/python/gfsk.py @@ -2,7 +2,7 @@ # GFSK modulation and demodulation. # # -# Copyright 2005,2006,2007 Free Software Foundation, Inc. +# Copyright 2005-2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,6 +25,7 @@ # See gnuradio-examples/python/digital for examples from gnuradio import gr +from gnuradio import analog import modulation_utils import digital_swig as digital from math import pi @@ -102,7 +103,7 @@ class gfsk_mod(gr.hier_block2): # Form Gaussian filter # Generate Gaussian response (Needs to be convolved with window below). - self.gaussian_taps = gr.firdes.gaussian( + self.gaussian_taps = filter.firdes.gaussian( 1.0, # gain samples_per_symbol, # symbol_rate bt, # bandwidth * symbol time @@ -114,7 +115,7 @@ class gfsk_mod(gr.hier_block2): self.gaussian_filter = filter.interp_fir_filter_fff(samples_per_symbol, self.taps) # FM modulation - self.fmmod = gr.frequency_modulator_fc(sensitivity) + self.fmmod = frequency.frequency_modulator_fc(sensitivity) # small amount of output attenuation to prevent clipping USRP sink self.amp = gr.multiply_const_cc(0.999) @@ -230,7 +231,7 @@ class gfsk_demod(gr.hier_block2): # Demodulate FM #sensitivity = (pi / 2) / samples_per_symbol - self.fmdemod = gr.quadrature_demod_cf(1.0 / sensitivity) + self.fmdemod = analog.quadrature_demod_cf(1.0 / sensitivity) # the clock recovery block tracks the symbol clock and resamples as needed. # the output of the block is a stream of soft symbols (float) diff --git a/gr-digital/python/gmsk.py b/gr-digital/python/gmsk.py index e7853dd0af..c0f5c439aa 100644 --- a/gr-digital/python/gmsk.py +++ b/gr-digital/python/gmsk.py @@ -2,7 +2,7 @@ # GMSK modulation and demodulation. # # -# Copyright 2005,2006,2007 Free Software Foundation, Inc. +# Copyright 2005-2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,6 +25,7 @@ # See gnuradio-examples/python/digital for examples from gnuradio import gr +from gnuradio import analog import modulation_utils import digital_swig as digital from math import pi @@ -101,7 +102,7 @@ class gmsk_mod(gr.hier_block2): # Form Gaussian filter # Generate Gaussian response (Needs to be convolved with window below). - self.gaussian_taps = gr.firdes.gaussian( + self.gaussian_taps = filter.firdes.gaussian( 1, # gain samples_per_symbol, # symbol_rate bt, # bandwidth * symbol time @@ -113,7 +114,7 @@ class gmsk_mod(gr.hier_block2): self.gaussian_filter = filter.interp_fir_filter_fff(samples_per_symbol, self.taps) # FM modulation - self.fmmod = gr.frequency_modulator_fc(sensitivity) + self.fmmod = analog.frequency_modulator_fc(sensitivity) if verbose: self._print_verbage() @@ -220,7 +221,7 @@ class gmsk_demod(gr.hier_block2): # Demodulate FM sensitivity = (pi / 2) / samples_per_symbol - self.fmdemod = gr.quadrature_demod_cf(1.0 / sensitivity) + self.fmdemod = analog.quadrature_demod_cf(1.0 / sensitivity) # the clock recovery block tracks the symbol clock and resamples as needed. # the output of the block is a stream of soft symbols (float) diff --git a/gr-digital/python/ofdm_receiver.py b/gr-digital/python/ofdm_receiver.py index 1dc3cdf7cd..ace64a8089 100644 --- a/gr-digital/python/ofdm_receiver.py +++ b/gr-digital/python/ofdm_receiver.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright 2006-2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -23,6 +23,7 @@ import math from numpy import fft from gnuradio import gr +from gnuradio import analog import digital_swig as digital from ofdm_sync_pn import ofdm_sync_pn @@ -119,7 +120,7 @@ class ofdm_receiver(gr.hier_block2): # Set up blocks - self.nco = gr.frequency_modulator_fc(nco_sensitivity) # generate a signal proportional to frequency error of sync block + self.nco = analog.frequency_modulator_fc(nco_sensitivity) # generate a signal proportional to frequency error of sync block self.sigmix = gr.multiply_cc() self.sampler = digital.ofdm_sampler(fft_length, fft_length+cp_length) self.fft_demod = gr.fft_vcc(fft_length, True, win, True) diff --git a/gr-digital/python/qa_constellation.py b/gr-digital/python/qa_constellation.py index 750337a119..9d6f4c6427 100755 --- a/gr-digital/python/qa_constellation.py +++ b/gr-digital/python/qa_constellation.py @@ -23,7 +23,7 @@ import random from cmath import exp, pi, log -from gnuradio import gr, gr_unittest, blks2 +from gnuradio import gr, gr_unittest from utils import mod_codes import digital_swig as digital diff --git a/gr-digital/python/qa_constellation_receiver.py b/gr-digital/python/qa_constellation_receiver.py index 871df2da28..6da3fc1066 100755 --- a/gr-digital/python/qa_constellation_receiver.py +++ b/gr-digital/python/qa_constellation_receiver.py @@ -22,10 +22,11 @@ import random -from gnuradio import gr, blks2, gr_unittest +from gnuradio import gr, gr_unittest from utils import mod_codes, alignment import packet_utils import filter_swig as filter +import analog_swig as analog from generic_mod_demod import generic_mod, generic_demod from qa_constellation import tested_constellations, twod_constell @@ -38,7 +39,7 @@ SEED = 1239 # TESTING PARAMETERS # The number of symbols to test with. # We need this many to let the frequency recovery block converge. -DATA_LENGTH = 2000 +DATA_LENGTH = 1000 # Test fails if fraction of output that is correct is less than this. REQ_CORRECT = 0.7 @@ -51,6 +52,28 @@ TIMING_OFFSET = 1.0 FREQ_BW = 2*math.pi/100.0 PHASE_BW = 2*math.pi/100.0 +class channel_model(gr.hier_block2): + def __init__(self, noise_voltage, freq, timing): + gr.hier_block2.__init__(self, "channel_model", + gr.io_signature(1, 1, gr.sizeof_gr_complex), + gr.io_signature(1, 1, gr.sizeof_gr_complex)) + + + timing_offset = filter.fractional_interpolator_cc(0, timing) + noise_adder = gr.add_cc() + noise = analog.noise_source_c(analog.GR_GAUSSIAN, + noise_voltage, 0) + freq_offset = analog.sig_source_c(1, analog.GR_SIN_WAVE, + freq, 1.0, 0.0) + mixer_offset = gr.multiply_cc(); + + self.connect(self, timing_offset) + self.connect(timing_offset, (mixer_offset,0)) + self.connect(freq_offset, (mixer_offset,1)) + self.connect(mixer_offset, (noise_adder,1)) + self.connect(noise, (noise_adder,0)) + self.connect(noise_adder, self) + class test_constellation_receiver(gr_unittest.TestCase): @@ -131,9 +154,9 @@ class rec_test_tb(gr.top_block): mod = generic_mod(constellation, differential=differential) # Channel if freq_offset: - channel = filter.channel_model(NOISE_VOLTAGE, FREQUENCY_OFFSET, TIMING_OFFSET) + channel = channel_model(NOISE_VOLTAGE, FREQUENCY_OFFSET, TIMING_OFFSET) else: - channel = filter.channel_model(NOISE_VOLTAGE, 0, TIMING_OFFSET) + channel = channel_model(NOISE_VOLTAGE, 0, TIMING_OFFSET) # Receiver Blocks if freq_offset: demod = generic_demod(constellation, differential=differential, diff --git a/gr-digital/python/qa_cpm.py b/gr-digital/python/qa_cpm.py index 2221d16b6f..bfeb2bcdd4 100755 --- a/gr-digital/python/qa_cpm.py +++ b/gr-digital/python/qa_cpm.py @@ -22,6 +22,7 @@ from gnuradio import gr, gr_unittest import digital_swig as digital +import analog_swig as analog import numpy class test_cpm(gr_unittest.TestCase): @@ -51,16 +52,16 @@ class test_cpm(gr_unittest.TestCase): msg="Phase shift was not correct for CPM method " + name) def test_001_lrec(self): - self.do_check_phase_shift(gr.cpm.LRC, 'LREC') + self.do_check_phase_shift(analog.cpm.LRC, 'LREC') def test_001_lrc(self): - self.do_check_phase_shift(gr.cpm.LRC, 'LRC') + self.do_check_phase_shift(analog.cpm.LRC, 'LRC') def test_001_lsrc(self): - self.do_check_phase_shift(gr.cpm.LSRC, 'LSRC') + self.do_check_phase_shift(analog.cpm.LSRC, 'LSRC') def test_001_ltfm(self): - self.do_check_phase_shift(gr.cpm.TFM, 'TFM') + self.do_check_phase_shift(analog.cpm.TFM, 'TFM') def test_001_lgmsk(self): sps = 2 @@ -82,7 +83,7 @@ class test_cpm(gr_unittest.TestCase): msg="Phase shift was not correct for GMSK") def test_phase_response(self): - phase_response = gr.cpm.phase_response(gr.cpm.LREC, 2, 4) + phase_response = analog.cpm.phase_response(analog.cpm.LREC, 2, 4) self.assertAlmostEqual(numpy.sum(phase_response), 1) diff --git a/gr-digital/python/qa_fll_band_edge.py b/gr-digital/python/qa_fll_band_edge.py index a4269931f5..1e699bbdd4 100755 --- a/gr-digital/python/qa_fll_band_edge.py +++ b/gr-digital/python/qa_fll_band_edge.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -23,6 +23,7 @@ from gnuradio import gr, gr_unittest import digital_swig as digital import filter_swig as filter +import analog_swig as analog import random, math class test_fll_band_edge_cc(gr_unittest.TestCase): @@ -40,7 +41,7 @@ class test_fll_band_edge_cc(gr_unittest.TestCase): ntaps = 45 # Create pulse shape filter - rrc_taps = gr.firdes.root_raised_cosine( + rrc_taps = filter.firdes.root_raised_cosine( sps, sps, 1.0, rolloff, ntaps) # The frequency offset to correct @@ -53,7 +54,7 @@ class test_fll_band_edge_cc(gr_unittest.TestCase): self.rrc = filter.interp_fir_filter_ccf(sps, rrc_taps) # Mix symbols with a complex sinusoid to spin them - self.nco = gr.sig_source_c(1, gr.GR_SIN_WAVE, foffset, 1) + self.nco = analog.sig_source_c(1, analog.GR_SIN_WAVE, foffset, 1) self.mix = gr.multiply_cc() # FLL will despin the symbols to an arbitrary phase diff --git a/gr-digital/swig/CMakeLists.txt b/gr-digital/swig/CMakeLists.txt index 8ba6b361dd..5ec34008aa 100644 --- a/gr-digital/swig/CMakeLists.txt +++ b/gr-digital/swig/CMakeLists.txt @@ -33,7 +33,7 @@ set(GR_SWIG_INCLUDE_DIRS set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/digital_swig_doc.i) set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../lib) -set(GR_SWIG_LIBRARIES gnuradio-digital gnuradio-filter) +set(GR_SWIG_LIBRARIES gnuradio-digital gnuradio-filter gnuradio-analog) GR_SWIG_MAKE(digital_swig digital_swig.i) diff --git a/gr-digital/swig/digital_swig.i b/gr-digital/swig/digital_swig.i index 3783da75ea..34a921f754 100644 --- a/gr-digital/swig/digital_swig.i +++ b/gr-digital/swig/digital_swig.i @@ -20,13 +20,14 @@ */ #define DIGITAL_API +#define ANALOG_API %include "gnuradio.i" //load generated python docstrings %include "digital_swig_doc.i" -%include "gr_cpm.h" +%include "analog/cpm.h" %include "gri_control_loop.h" diff --git a/gr-fcd/CMakeLists.txt b/gr-fcd/CMakeLists.txt index 1185b3a32d..ff61ce28c6 100644 --- a/gr-fcd/CMakeLists.txt +++ b/gr-fcd/CMakeLists.txt @@ -110,9 +110,12 @@ if(ENABLE_PYTHON) add_subdirectory(grc) add_subdirectory(examples/grc) endif(ENABLE_PYTHON) -add_subdirectory(examples/c++) add_subdirectory(doc) +if(ENABLE_GR_ANALOG) + add_subdirectory(examples/c++) +endif(ENABLE_GR_ANALOG) + ######################################################################## # Create Pkg Config File ######################################################################## diff --git a/gr-fcd/examples/c++/CMakeLists.txt b/gr-fcd/examples/c++/CMakeLists.txt index adad7338cf..1bbeb5953e 100644 --- a/gr-fcd/examples/c++/CMakeLists.txt +++ b/gr-fcd/examples/c++/CMakeLists.txt @@ -21,9 +21,10 @@ include_directories(${GR_FCD_INCLUDE_DIRS}) include_directories(${GNURADIO_CORE_INCLUDE_DIRS}) include_directories(${GR_FILTER_INCLUDE_DIRS}) include_directories(${GR_AUDIO_INCLUDE_DIRS}) +include_directories(${GR_ANALOG_INCLUDE_DIRS}) add_executable(fcd_nfm_rx fcd_nfm_rx.cc) -target_link_libraries(fcd_nfm_rx gnuradio-fcd gnuradio-filter) +target_link_libraries(fcd_nfm_rx gnuradio-fcd gnuradio-filter gnuradio-analog) INSTALL(TARGETS fcd_nfm_rx diff --git a/gr-fcd/examples/c++/fcd_nfm_rx.cc b/gr-fcd/examples/c++/fcd_nfm_rx.cc index 61417018a6..a0eee134d0 100644 --- a/gr-fcd/examples/c++/fcd_nfm_rx.cc +++ b/gr-fcd/examples/c++/fcd_nfm_rx.cc @@ -35,7 +35,7 @@ #include <gr_top_block.h> #include <filter/firdes.h> #include <filter/fir_filter_ccf.h> -#include <gr_quadrature_demod_cf.h> +#include <analog/quadrature_demod_cf.h> #include <gr_audio_sink.h> #include <fcd_source_c.h> @@ -43,7 +43,7 @@ #include <iostream> #include <boost/program_options.hpp> - +using namespace gr; namespace po = boost::program_options; int main(int argc, char **argv) @@ -85,12 +85,13 @@ int main(int argc, char **argv) fcd->set_lna_gain(gain); // Low pass filter - std::vector<float> taps = gr::filter::firdes::low_pass(1.0, 96000, 5000.0, 1000.0); - gr::filter::fir_filter_ccf::sptr filter = gr::filter::fir_filter_ccf::make (2, taps); + std::vector<float> taps = filter::firdes::low_pass(1.0, 96000, 5000.0, 1000.0); + filter::fir_filter_ccf::sptr filter = filter::fir_filter_ccf::make (2, taps); // FM demodulator // gain = sample_rate / (2*pi*max_dev) - gr_quadrature_demod_cf_sptr demod = gr_make_quadrature_demod_cf (rate/(2.0*pi*5000.0)); + analog::quadrature_demod_cf::sptr demod = \ + analog::quadrature_demod_cf::make(rate/(2.0*pi*5000.0)); // Audio sink audio_sink::sptr sink = audio_make_sink(rate); diff --git a/gr-fcd/examples/grc/fcd_nfm_rx.grc b/gr-fcd/examples/grc/fcd_nfm_rx.grc index 9dac3fcb85..98d06d9ef1 100644 --- a/gr-fcd/examples/grc/fcd_nfm_rx.grc +++ b/gr-fcd/examples/grc/fcd_nfm_rx.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Sun May 8 18:05:32 2011</timestamp> + <timestamp>Tue Nov 6 12:24:50 2012</timestamp> <block> <key>options</key> <param> @@ -44,6 +44,10 @@ <value>True</value> </param> <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> <key>realtime_scheduling</key> <value></value> </param> @@ -375,10 +379,10 @@ </param> </block> <block> - <key>low_pass_filter</key> + <key>gr_multiply_const_vxx</key> <param> <key>id</key> - <value>low_pass_filter</value> + <value>gr_multiply_const_vxx_1</value> </param> <param> <key>_enabled</key> @@ -386,43 +390,19 @@ </param> <param> <key>type</key> - <value>fir_filter_ccf</value> - </param> - <param> - <key>decim</key> - <value>1</value> + <value>float</value> </param> <param> - <key>interp</key> - <value>1</value> + <key>const</key> + <value>af_gain</value> </param> <param> - <key>gain</key> + <key>vlen</key> <value>1</value> </param> <param> - <key>samp_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>cutoff_freq</key> - <value>width/2</value> - </param> - <param> - <key>width</key> - <value>trans</value> - </param> - <param> - <key>win</key> - <value>firdes.WIN_HAMMING</value> - </param> - <param> - <key>beta</key> - <value>6.76</value> - </param> - <param> <key>_coordinate</key> - <value>(742, 258)</value> + <value>(674, 507)</value> </param> <param> <key>_rotation</key> @@ -430,26 +410,34 @@ </param> </block> <block> - <key>gr_simple_squelch_cc</key> + <key>audio_sink</key> <param> <key>id</key> - <value>gr_simple_squelch_cc_0</value> + <value>audio_sink</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>threshold</key> - <value>sql_lev</value> + <key>samp_rate</key> + <value>48000</value> </param> <param> - <key>alpha</key> - <value>1</value> + <key>device_name</key> + <value></value> + </param> + <param> + <key>ok_to_block</key> + <value>True</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> </param> <param> <key>_coordinate</key> - <value>(226, 499)</value> + <value>(882, 511)</value> </param> <param> <key>_rotation</key> @@ -457,34 +445,22 @@ </param> </block> <block> - <key>blks2_nbfm_rx</key> + <key>variable</key> <param> <key>id</key> - <value>nbfm_normal</value> + <value>samp_rate</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>audio_rate</key> - <value>48000</value> - </param> - <param> - <key>quad_rate</key> + <key>value</key> <value>96000</value> </param> <param> - <key>tau</key> - <value>75e-6</value> - </param> - <param> - <key>max_dev</key> - <value>5e3</value> - </param> - <param> <key>_coordinate</key> - <value>(441, 483)</value> + <value>(210, 12)</value> </param> <param> <key>_rotation</key> @@ -492,65 +468,54 @@ </param> </block> <block> - <key>gr_multiply_const_vxx</key> + <key>variable_slider</key> <param> <key>id</key> - <value>gr_multiply_const_vxx_1</value> + <value>sql_lev</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>const</key> - <value>af_gain</value> + <key>label</key> + <value>SQL</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>value</key> + <value>-100</value> </param> <param> - <key>_coordinate</key> - <value>(674, 507)</value> + <key>min</key> + <value>-100</value> </param> <param> - <key>_rotation</key> + <key>max</key> <value>0</value> </param> - </block> - <block> - <key>audio_sink</key> <param> - <key>id</key> - <value>audio_sink</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> + <key>num_steps</key> + <value>500</value> </param> <param> - <key>samp_rate</key> - <value>48000</value> + <key>style</key> + <value>wx.SL_HORIZONTAL</value> </param> <param> - <key>device_name</key> - <value></value> + <key>converver</key> + <value>float_converter</value> </param> <param> - <key>ok_to_block</key> - <value>True</value> + <key>grid_pos</key> + <value>7,2,1,1</value> </param> <param> - <key>num_inputs</key> - <value>2</value> + <key>notebook</key> + <value></value> </param> <param> <key>_coordinate</key> - <value>(882, 511)</value> + <value>(328, 728)</value> </param> <param> <key>_rotation</key> @@ -561,7 +526,7 @@ <key>variable</key> <param> <key>id</key> - <value>samp_rate</value> + <value>xlate_filter_taps</value> </param> <param> <key>_enabled</key> @@ -569,11 +534,11 @@ </param> <param> <key>value</key> - <value>96000</value> + <value>firdes.low_pass(1, samp_rate, 48000, 5000, firdes.WIN_HAMMING, 6.76)</value> </param> <param> <key>_coordinate</key> - <value>(210, 12)</value> + <value>(428, 294)</value> </param> <param> <key>_rotation</key> @@ -581,78 +546,85 @@ </param> </block> <block> - <key>wxgui_fftsink2</key> + <key>variable_chooser</key> <param> <key>id</key> - <value>fftsink</value> + <value>display_selector</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>complex</value> + <key>label</key> + <value>Spectrum</value> </param> <param> - <key>title</key> - <value></value> + <key>value</key> + <value>0</value> </param> <param> - <key>samp_rate</key> - <value>samp_rate</value> + <key>choices</key> + <value>[0, 1]</value> </param> <param> - <key>baseband_freq</key> - <value>rx_freq*display_selector</value> + <key>labels</key> + <value>['Baseband','RF']</value> </param> <param> - <key>y_per_div</key> - <value>10</value> + <key>type</key> + <value>drop_down</value> </param> <param> - <key>y_divs</key> - <value>10</value> + <key>style</key> + <value>wx.RA_HORIZONTAL</value> </param> <param> - <key>ref_level</key> - <value>0</value> + <key>grid_pos</key> + <value>5,0,1,1</value> </param> <param> - <key>ref_scale</key> - <value>1.0</value> + <key>notebook</key> + <value></value> </param> <param> - <key>fft_size</key> - <value>512</value> + <key>_coordinate</key> + <value>(481, 728)</value> </param> <param> - <key>fft_rate</key> - <value>15</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>variable_text_box</key> <param> - <key>peak_hold</key> - <value>False</value> + <key>id</key> + <value>freq</value> </param> <param> - <key>average</key> + <key>_enabled</key> <value>True</value> </param> <param> - <key>avg_alpha</key> - <value>0.5</value> + <key>label</key> + <value>FCD Freq</value> </param> <param> - <key>win</key> - <value>None</value> + <key>value</key> + <value>144470000</value> </param> <param> - <key>win_size</key> - <value>800,300</value> + <key>converver</key> + <value>float_converter</value> + </param> + <param> + <key>formatter</key> + <value>None</value> </param> <param> <key>grid_pos</key> - <value>0,0,5,4</value> + <value>5,1,1,1</value> </param> <param> <key>notebook</key> @@ -660,7 +632,7 @@ </param> <param> <key>_coordinate</key> - <value>(742, 24)</value> + <value>(339, 9)</value> </param> <param> <key>_rotation</key> @@ -671,7 +643,7 @@ <key>variable_slider</key> <param> <key>id</key> - <value>sql_lev</value> + <value>rf_gain</value> </param> <param> <key>_enabled</key> @@ -679,23 +651,23 @@ </param> <param> <key>label</key> - <value>SQL</value> + <value>RF</value> </param> <param> <key>value</key> - <value>-100</value> + <value>20</value> </param> <param> <key>min</key> - <value>-100</value> + <value>-5</value> </param> <param> <key>max</key> - <value>0</value> + <value>30</value> </param> <param> <key>num_steps</key> - <value>500</value> + <value>35</value> </param> <param> <key>style</key> @@ -707,7 +679,7 @@ </param> <param> <key>grid_pos</key> - <value>7,2,1,1</value> + <value>7,1,1,1</value> </param> <param> <key>notebook</key> @@ -715,7 +687,7 @@ </param> <param> <key>_coordinate</key> - <value>(328, 728)</value> + <value>(11, 725)</value> </param> <param> <key>_rotation</key> @@ -723,22 +695,54 @@ </param> </block> <block> - <key>variable</key> + <key>fcd_source_c</key> <param> <key>id</key> - <value>xlate_filter_taps</value> + <value>fcd_source_c_1</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>firdes.low_pass(1, samp_rate, 48000, 5000, firdes.WIN_HAMMING, 6.76)</value> + <key>device_name</key> + <value>hw:1</value> + </param> + <param> + <key>freq</key> + <value>freq</value> + </param> + <param> + <key>lna</key> + <value>rf_gain</value> + </param> + <param> + <key>mixer</key> + <value>+12</value> + </param> + <param> + <key>ppm</key> + <value>-120</value> + </param> + <param> + <key>dci</key> + <value>0.0</value> + </param> + <param> + <key>dcq</key> + <value>0.0</value> + </param> + <param> + <key>iq_phase</key> + <value>0.0</value> + </param> + <param> + <key>iq_gain</key> + <value>1.0</value> </param> <param> <key>_coordinate</key> - <value>(428, 294)</value> + <value>(165, 157)</value> </param> <param> <key>_rotation</key> @@ -746,93 +750,90 @@ </param> </block> <block> - <key>variable_chooser</key> + <key>wxgui_fftsink2</key> <param> <key>id</key> - <value>display_selector</value> + <value>fftsink</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>label</key> - <value>Spectrum</value> + <key>type</key> + <value>complex</value> </param> <param> - <key>value</key> - <value>0</value> + <key>title</key> + <value></value> </param> <param> - <key>choices</key> - <value>[0, 1]</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>labels</key> - <value>['Baseband','RF']</value> + <key>baseband_freq</key> + <value>rx_freq*display_selector</value> </param> <param> - <key>type</key> - <value>drop_down</value> + <key>y_per_div</key> + <value>10</value> </param> <param> - <key>style</key> - <value>wx.RA_HORIZONTAL</value> + <key>y_divs</key> + <value>10</value> </param> <param> - <key>grid_pos</key> - <value>5,0,1,1</value> + <key>ref_level</key> + <value>0</value> </param> <param> - <key>notebook</key> - <value></value> + <key>ref_scale</key> + <value>1.0</value> </param> <param> - <key>_coordinate</key> - <value>(481, 728)</value> + <key>fft_size</key> + <value>512</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>fft_rate</key> + <value>15</value> </param> - </block> - <block> - <key>variable_text_box</key> <param> - <key>id</key> - <value>freq</value> + <key>peak_hold</key> + <value>False</value> </param> <param> - <key>_enabled</key> + <key>average</key> <value>True</value> </param> <param> - <key>label</key> - <value>FCD Freq</value> - </param> - <param> - <key>value</key> - <value>144470000</value> + <key>avg_alpha</key> + <value>0.5</value> </param> <param> - <key>converver</key> - <value>float_converter</value> + <key>win</key> + <value>None</value> </param> <param> - <key>formatter</key> - <value>None</value> + <key>win_size</key> + <value>800,300</value> </param> <param> <key>grid_pos</key> - <value>5,1,1,1</value> + <value>0,0,5,4</value> </param> <param> <key>notebook</key> <value></value> </param> <param> + <key>freqvar</key> + <value>None</value> + </param> + <param> <key>_coordinate</key> - <value>(339, 9)</value> + <value>(742, 24)</value> </param> <param> <key>_rotation</key> @@ -840,10 +841,10 @@ </param> </block> <block> - <key>gr_freq_xlating_fir_filter_xxx</key> + <key>freq_xlating_fir_filter_xxx</key> <param> <key>id</key> - <value>xlating_fir_filter</value> + <value>freq_xlating_fir_filter_xxx_0</value> </param> <param> <key>_enabled</key> @@ -871,7 +872,7 @@ </param> <param> <key>_coordinate</key> - <value>(433, 189)</value> + <value>(422, 173)</value> </param> <param> <key>_rotation</key> @@ -879,105 +880,116 @@ </param> </block> <block> - <key>variable_slider</key> + <key>blks2_nbfm_rx</key> <param> <key>id</key> - <value>rf_gain</value> + <value>nbfm_normal</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>label</key> - <value>RF</value> + <key>audio_rate</key> + <value>48000</value> </param> <param> - <key>value</key> - <value>20</value> + <key>quad_rate</key> + <value>96000</value> </param> <param> - <key>min</key> - <value>-5</value> + <key>tau</key> + <value>75e-6</value> </param> <param> - <key>max</key> - <value>30</value> + <key>max_dev</key> + <value>5e3</value> </param> <param> - <key>num_steps</key> - <value>35</value> + <key>_coordinate</key> + <value>(441, 483)</value> </param> <param> - <key>style</key> - <value>wx.SL_HORIZONTAL</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>low_pass_filter</key> <param> - <key>converver</key> - <value>float_converter</value> + <key>id</key> + <value>low_pass_filter</value> </param> <param> - <key>grid_pos</key> - <value>7,1,1,1</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>notebook</key> - <value></value> + <key>type</key> + <value>fir_filter_ccf</value> </param> <param> - <key>_coordinate</key> - <value>(11, 725)</value> + <key>decim</key> + <value>1</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>interp</key> + <value>1</value> </param> - </block> - <block> - <key>fcd_source_c</key> <param> - <key>id</key> - <value>fcd_source_c_1</value> + <key>gain</key> + <value>1</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>device_name</key> - <value>hw:1</value> + <key>cutoff_freq</key> + <value>width/2</value> </param> <param> - <key>freq</key> - <value>freq</value> + <key>width</key> + <value>trans</value> </param> <param> - <key>lna</key> - <value>rf_gain</value> + <key>win</key> + <value>firdes.WIN_HAMMING</value> </param> <param> - <key>ppm</key> - <value>-120</value> + <key>beta</key> + <value>6.76</value> </param> <param> - <key>dci</key> - <value>0.0</value> + <key>_coordinate</key> + <value>(742, 258)</value> </param> <param> - <key>dcq</key> - <value>0.0</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>analog_simple_squelch_cc</key> <param> - <key>iq_phase</key> - <value>0.0</value> + <key>id</key> + <value>analog_simple_squelch_cc_0</value> </param> <param> - <key>iq_gain</key> - <value>1.0</value> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>threshold</key> + <value>sql_lev</value> + </param> + <param> + <key>alpha</key> + <value>1</value> </param> <param> <key>_coordinate</key> - <value>(165, 157)</value> + <value>(227, 499)</value> </param> <param> <key>_rotation</key> @@ -985,50 +997,50 @@ </param> </block> <connection> - <source_block_id>xlating_fir_filter</source_block_id> - <sink_block_id>fftsink</sink_block_id> + <source_block_id>gr_multiply_const_vxx_1</source_block_id> + <sink_block_id>audio_sink</sink_block_id> <source_key>0</source_key> - <sink_key>0</sink_key> + <sink_key>1</sink_key> </connection> <connection> - <source_block_id>xlating_fir_filter</source_block_id> - <sink_block_id>low_pass_filter</sink_block_id> + <source_block_id>gr_multiply_const_vxx_1</source_block_id> + <sink_block_id>audio_sink</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>low_pass_filter</source_block_id> - <sink_block_id>gr_simple_squelch_cc_0</sink_block_id> + <source_block_id>nbfm_normal</source_block_id> + <sink_block_id>gr_multiply_const_vxx_1</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_multiply_const_vxx_1</source_block_id> - <sink_block_id>audio_sink</sink_block_id> + <source_block_id>fcd_source_c_1</source_block_id> + <sink_block_id>freq_xlating_fir_filter_xxx_0</sink_block_id> <source_key>0</source_key> - <sink_key>1</sink_key> + <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_multiply_const_vxx_1</source_block_id> - <sink_block_id>audio_sink</sink_block_id> + <source_block_id>freq_xlating_fir_filter_xxx_0</source_block_id> + <sink_block_id>fftsink</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_simple_squelch_cc_0</source_block_id> - <sink_block_id>nbfm_normal</sink_block_id> + <source_block_id>freq_xlating_fir_filter_xxx_0</source_block_id> + <sink_block_id>low_pass_filter</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>nbfm_normal</source_block_id> - <sink_block_id>gr_multiply_const_vxx_1</sink_block_id> + <source_block_id>analog_simple_squelch_cc_0</source_block_id> + <sink_block_id>nbfm_normal</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>fcd_source_c_1</source_block_id> - <sink_block_id>xlating_fir_filter</sink_block_id> + <source_block_id>low_pass_filter</source_block_id> + <sink_block_id>analog_simple_squelch_cc_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gr-filter/apps/gr_filter_design b/gr-filter/apps/gr_filter_design index cc21ea5e76..6de52f4cb9 100755 --- a/gr-filter/apps/gr_filter_design +++ b/gr-filter/apps/gr_filter_design @@ -2,7 +2,8 @@ import sys, os, re, csv from optparse import OptionParser -from gnuradio import gr, blks2, eng_notation +from gnuradio import gr, eng_notation +from gnuradio import filter try: import scipy @@ -477,8 +478,8 @@ class gr_plot_filter(QtGui.QMainWindow): if(ret): try: - taps = blks2.optfir.low_pass(gain, fs, pb, sb, - ripple, atten) + taps = filter.optfir.low_pass(gain, fs, pb, sb, + ripple, atten) except RuntimeError, e: reply = QtGui.QMessageBox.information(self, "Filter did not converge", e.args[0], "&Ok") @@ -508,8 +509,8 @@ class gr_plot_filter(QtGui.QMainWindow): sb1 = pb1 - tb sb2 = pb2 + tb try: - taps = blks2.optfir.band_pass(gain, fs, sb1, pb1, pb2, sb2, - ripple, atten) + taps = filter.optfir.band_pass(gain, fs, sb1, pb1, pb2, sb2, + ripple, atten) except RuntimeError, e: reply = QtGui.QMessageBox.information(self, "Filter did not converge", e.args[0], "&Ok") @@ -541,8 +542,8 @@ class gr_plot_filter(QtGui.QMainWindow): sb1 = pb1 - tb sb2 = pb2 + tb try: - taps = blks2.optfir.complex_band_pass(gain, fs, sb1, pb1, pb2, sb2, - ripple, atten) + taps = filter.optfir.complex_band_pass(gain, fs, sb1, pb1, pb2, sb2, + ripple, atten) except RuntimeError, e: reply = QtGui.QMessageBox.information(self, "Filter did not converge", e.args[0], "&Ok") @@ -573,8 +574,8 @@ class gr_plot_filter(QtGui.QMainWindow): pb1 = sb1 - tb pb2 = sb2 + tb try: - taps = blks2.optfir.band_reject(gain, fs, pb1, sb1, sb2, pb2, - ripple, atten) + taps = filter.optfir.band_reject(gain, fs, pb1, sb1, sb2, pb2, + ripple, atten) except RuntimeError, e: reply = QtGui.QMessageBox.information(self, "Filter did not converge", e.args[0], "&Ok") @@ -601,8 +602,8 @@ class gr_plot_filter(QtGui.QMainWindow): if(r): try: - taps = blks2.optfir.high_pass(gain, fs, sb, pb, - atten, ripple) + taps = filter.optfir.high_pass(gain, fs, sb, pb, + atten, ripple) except RuntimeError, e: reply = QtGui.QMessageBox.information(self, "Filter did not converge", e.args[0], "&Ok") diff --git a/gr-filter/examples/CMakeLists.txt b/gr-filter/examples/CMakeLists.txt index d94e5c16e1..a3901b60f3 100644 --- a/gr-filter/examples/CMakeLists.txt +++ b/gr-filter/examples/CMakeLists.txt @@ -27,7 +27,6 @@ GR_PYTHON_INSTALL(PROGRAMS fft_filter_ccc.py fir_filter_ccc.py fir_filter_fff.py - fmtest.py interpolate.py reconstruction.py resampler.py diff --git a/gr-filter/examples/channelize.py b/gr-filter/examples/channelize.py index 1f784d9b06..1745b3f7af 100755 --- a/gr-filter/examples/channelize.py +++ b/gr-filter/examples/channelize.py @@ -20,22 +20,28 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, blks2 +from gnuradio import gr from gnuradio import filter import sys, time try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + +try: import scipy from scipy import fftpack except ImportError: - print "Error: Program requires scipy (see: www.scipy.org)." + sys.stderr.write("Error: Program requires scipy (see: www.scipy.org).\n") sys.exit(1) try: import pylab from pylab import mlab except ImportError: - print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)." + sys.stderr.write("Error: Program requires matplotlib (see: matplotlib.sourceforge.net).\n") sys.exit(1) class pfb_top_block(gr.top_block): @@ -66,7 +72,7 @@ class pfb_top_block(gr.top_block): freqs = [-70, -50, -30, -10, 10, 20, 40, 60, 80] for i in xrange(len(freqs)): f = freqs[i] + (M/2-M+i+1)*self._fs - self.signals.append(gr.sig_source_c(self._ifs, gr.GR_SIN_WAVE, f, 1)) + self.signals.append(analog.sig_source_c(self._ifs, analog.GR_SIN_WAVE, f, 1)) self.connect(self.signals[i], (self.add,i)) self.head = gr.head(gr.sizeof_gr_complex, self._N) diff --git a/gr-filter/examples/chirp_channelize.py b/gr-filter/examples/chirp_channelize.py index 3638c55d1a..e52a44dde4 100755 --- a/gr-filter/examples/chirp_channelize.py +++ b/gr-filter/examples/chirp_channelize.py @@ -20,22 +20,28 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, blks2 +from gnuradio import gr from gnuradio import filter import sys, time try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + +try: import scipy from scipy import fftpack except ImportError: - print "Error: Program requires scipy (see: www.scipy.org)." + sys.stderr.write("Error: Program requires scipy (see: www.scipy.org).\n") sys.exit(1) try: import pylab from pylab import mlab except ImportError: - print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)." + sys.stderr.write("Error: Program requires matplotlib (see: matplotlib.sourceforge.net).\n") sys.exit(1) class pfb_top_block(gr.top_block): @@ -59,7 +65,7 @@ class pfb_top_block(gr.top_block): repeated = True if(repeated): - self.vco_input = gr.sig_source_f(self._fs, gr.GR_SIN_WAVE, 0.25, 110) + self.vco_input = analog.sig_source_f(self._fs, analog.GR_SIN_WAVE, 0.25, 110) else: amp = 100 data = scipy.arange(0, amp, amp/float(self._N)) diff --git a/gr-filter/examples/decimate.py b/gr-filter/examples/decimate.py index 7f1f03d8f2..4a7a5eb155 100755 --- a/gr-filter/examples/decimate.py +++ b/gr-filter/examples/decimate.py @@ -25,17 +25,23 @@ from gnuradio import filter import sys, time try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + +try: import scipy from scipy import fftpack except ImportError: - print "Error: Program requires scipy (see: www.scipy.org)." + sys.stderr.write("Error: Program requires scipy (see: www.scipy.org).\n") sys.exit(1) try: import pylab from pylab import mlab except ImportError: - print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)." + sys.stderr.write("Error: Program requires matplotlib (see: matplotlib.sourceforge.net).\n") sys.exit(1) class pfb_top_block(gr.top_block): @@ -65,7 +71,7 @@ class pfb_top_block(gr.top_block): self.add = gr.add_cc() freqs = [10, 20, 2040] for i in xrange(len(freqs)): - self.signals.append(gr.sig_source_c(self._fs, gr.GR_SIN_WAVE, freqs[i], 1)) + self.signals.append(analog.sig_source_c(self._fs, analog.GR_SIN_WAVE, freqs[i], 1)) self.connect(self.signals[i], (self.add,i)) self.head = gr.head(gr.sizeof_gr_complex, self._N) diff --git a/gr-filter/examples/fft_filter_ccc.py b/gr-filter/examples/fft_filter_ccc.py index 45e241a6f6..676e7d9f16 100755 --- a/gr-filter/examples/fft_filter_ccc.py +++ b/gr-filter/examples/fft_filter_ccc.py @@ -1,6 +1,7 @@ #!/usr/bin/env python from gnuradio import gr, filter +from gnuradio import analog from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -33,7 +34,7 @@ class example_fft_filter_ccc(gr.top_block): self._tw, self._at) print "Num. Taps: ", len(taps) - self.src = gr.noise_source_c(gr.GR_GAUSSIAN, 1) + self.src = analog.noise_source_c(analog.GR_GAUSSIAN, 1) self.head = gr.head(gr.sizeof_gr_complex, self._nsamps) self.filt0 = filter.fft_filter_ccc(self._decim, taps) diff --git a/gr-filter/examples/fir_filter_ccc.py b/gr-filter/examples/fir_filter_ccc.py index baa05eeb7c..6e68fc0af7 100755 --- a/gr-filter/examples/fir_filter_ccc.py +++ b/gr-filter/examples/fir_filter_ccc.py @@ -1,6 +1,7 @@ #!/usr/bin/env python from gnuradio import gr, filter +from gnuradio import analog from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -30,7 +31,7 @@ class example_fir_filter_ccc(gr.top_block): taps = filter.firdes.low_pass_2(1, self._fs, self._bw, self._tw, self._at) print "Num. Taps: ", len(taps) - self.src = gr.noise_source_c(gr.GR_GAUSSIAN, 1) + self.src = analog.noise_source_c(analog.GR_GAUSSIAN, 1) self.head = gr.head(gr.sizeof_gr_complex, self._nsamps) self.filt0 = filter.fir_filter_ccc(self._decim, taps) diff --git a/gr-filter/examples/fir_filter_fff.py b/gr-filter/examples/fir_filter_fff.py index 48769f00df..a1a8ab9573 100755 --- a/gr-filter/examples/fir_filter_fff.py +++ b/gr-filter/examples/fir_filter_fff.py @@ -1,6 +1,7 @@ #!/usr/bin/env python from gnuradio import gr, filter +from gnuradio import analog from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -30,7 +31,7 @@ class example_fir_filter_fff(gr.top_block): taps = filter.firdes.low_pass_2(1, self._fs, self._bw, self._tw, self._at) print "Num. Taps: ", len(taps) - self.src = gr.noise_source_f(gr.GR_GAUSSIAN, 1) + self.src = analog.noise_source_f(analog.GR_GAUSSIAN, 1) self.head = gr.head(gr.sizeof_float, self._nsamps) self.filt0 = filter.fir_filter_fff(self._decim, taps) diff --git a/gr-filter/examples/interpolate.py b/gr-filter/examples/interpolate.py index 56d78d597b..45f4b3f801 100755 --- a/gr-filter/examples/interpolate.py +++ b/gr-filter/examples/interpolate.py @@ -25,17 +25,23 @@ from gnuradio import filter import sys, time try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + +try: import scipy from scipy import fftpack except ImportError: - print "Error: Program requires scipy (see: www.scipy.org)." + sys.stderr.write("Error: Program requires scipy (see: www.scipy.org).\n") sys.exit(1) try: import pylab from pylab import mlab except ImportError: - print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)." + sys.stderr.write("Error: Program requires matplotlib (see: matplotlib.sourceforge.net).\n") sys.exit(1) class pfb_top_block(gr.top_block): @@ -78,8 +84,8 @@ class pfb_top_block(gr.top_block): print "Taps per channel: ", tpc # Create a couple of signals at different frequencies - self.signal1 = gr.sig_source_c(self._fs, gr.GR_SIN_WAVE, freq1, 0.5) - self.signal2 = gr.sig_source_c(self._fs, gr.GR_SIN_WAVE, freq2, 0.5) + self.signal1 = analog.sig_source_c(self._fs, analog.GR_SIN_WAVE, freq1, 0.5) + self.signal2 = analog.sig_source_c(self._fs, analog.GR_SIN_WAVE, freq2, 0.5) self.signal = gr.add_cc() self.head = gr.head(gr.sizeof_gr_complex, self._N) diff --git a/gr-filter/examples/reconstruction.py b/gr-filter/examples/reconstruction.py index f4908006fc..75c224e79c 100755 --- a/gr-filter/examples/reconstruction.py +++ b/gr-filter/examples/reconstruction.py @@ -24,6 +24,12 @@ from gnuradio import gr, digital from gnuradio import filter try: + from gnuradio import channels +except ImportError: + print "Error: Program requires gr-channels." + sys.exit(1) + +try: import scipy from scipy import fftpack except ImportError: diff --git a/gr-filter/examples/resampler.py b/gr-filter/examples/resampler.py index 395e095cbd..5efb435631 100755 --- a/gr-filter/examples/resampler.py +++ b/gr-filter/examples/resampler.py @@ -25,15 +25,21 @@ from gnuradio import filter import sys try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + +try: import scipy except ImportError: - print "Error: Program requires scipy (see: www.scipy.org)." + sys.stderr.write("Error: Program requires scipy (see: www.scipy.org).\n") sys.exit(1) try: import pylab except ImportError: - print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)." + sys.stderr.write("Error: Program requires matplotlib (see: matplotlib.sourceforge.net).\n") sys.exit(1) class mytb(gr.top_block): @@ -46,8 +52,8 @@ class mytb(gr.top_block): # Creating our own taps taps = gr.firdes.low_pass_2(32, 32, 0.25, 0.1, 80) - self.src = gr.sig_source_c(fs_in, gr.GR_SIN_WAVE, fc, 1) - #self.src = gr.noise_source_c(gr.GR_GAUSSIAN, 1) + self.src = analog.sig_source_c(fs_in, analog.GR_SIN_WAVE, fc, 1) + #self.src = analog.noise_source_c(analog.GR_GAUSSIAN, 1) self.head = gr.head(gr.sizeof_gr_complex, N) # A resampler with our taps diff --git a/gr-filter/examples/resampler_demo.grc b/gr-filter/examples/resampler_demo.grc index b3991ac198..7616d0bccd 100644 --- a/gr-filter/examples/resampler_demo.grc +++ b/gr-filter/examples/resampler_demo.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Tue Jun 19 21:31:30 2012</timestamp> + <timestamp>Sat Nov 10 14:47:16 2012</timestamp> <block> <key>options</key> <param> @@ -44,6 +44,10 @@ <value>True</value> </param> <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> <key>realtime_scheduling</key> <value></value> </param> @@ -57,22 +61,22 @@ </param> </block> <block> - <key>import</key> + <key>variable</key> <param> <key>id</key> - <value>import_0</value> + <value>rs_taps</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>import</key> - <value>import math</value> + <key>value</key> + <value>firdes.low_pass(nphases, nphases, frac_bw, 0.5-frac_bw)</value> </param> <param> <key>_coordinate</key> - <value>(11, 59)</value> + <value>(273, 154)</value> </param> <param> <key>_rotation</key> @@ -83,7 +87,7 @@ <key>variable</key> <param> <key>id</key> - <value>rs_taps</value> + <value>nphases</value> </param> <param> <key>_enabled</key> @@ -91,11 +95,11 @@ </param> <param> <key>value</key> - <value>firdes.low_pass(nphases, nphases, frac_bw, 0.5-frac_bw)</value> + <value>32</value> </param> <param> <key>_coordinate</key> - <value>(273, 154)</value> + <value>(185, 153)</value> </param> <param> <key>_rotation</key> @@ -103,61 +107,42 @@ </param> </block> <block> - <key>gr_add_const_vxx</key> + <key>variable_static_text</key> <param> <key>id</key> - <value>adder</value> + <value>samp_rate</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>const</key> - <value>-1.0</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(227, 303)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> + <key>label</key> + <value>Sample Rate</value> </param> - </block> - <block> - <key>gr_throttle</key> <param> - <key>id</key> - <value>throttle</value> + <key>value</key> + <value>44100</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>converver</key> + <value>float_converter</value> </param> <param> - <key>type</key> - <value>float</value> + <key>formatter</key> + <value>None</value> </param> <param> - <key>samples_per_second</key> - <value>samp_rate</value> + <key>grid_pos</key> + <value>0, 0, 1, 1</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>notebook</key> + <value></value> </param> <param> <key>_coordinate</key> - <value>(227, 493)</value> + <value>(179, 14)</value> </param> <param> <key>_rotation</key> @@ -165,78 +150,77 @@ </param> </block> <block> - <key>wxgui_fftsink2</key> + <key>variable_static_text</key> <param> <key>id</key> - <value>orig_fft</value> + <value>new_rate</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>title</key> - <value>Original Spectrum</value> + <key>label</key> + <value>Resampled Rate</value> </param> <param> - <key>samp_rate</key> - <value>samp_rate</value> + <key>value</key> + <value>48000</value> </param> <param> - <key>baseband_freq</key> - <value>0</value> + <key>converver</key> + <value>float_converter</value> </param> <param> - <key>y_per_div</key> - <value>10</value> + <key>formatter</key> + <value>None</value> </param> <param> - <key>y_divs</key> - <value>10</value> + <key>grid_pos</key> + <value>0, 1, 1, 1</value> </param> <param> - <key>ref_level</key> - <value>30</value> + <key>notebook</key> + <value></value> </param> <param> - <key>ref_scale</key> - <value>2.0</value> + <key>_coordinate</key> + <value>(328, 15)</value> </param> <param> - <key>fft_size</key> - <value>1024</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>variable_static_text</key> <param> - <key>fft_rate</key> - <value>30</value> + <key>id</key> + <value>frac_bw</value> </param> <param> - <key>peak_hold</key> - <value>False</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>average</key> - <value>False</value> + <key>label</key> + <value>Fractional Bandwidth</value> </param> <param> - <key>avg_alpha</key> - <value>0</value> + <key>value</key> + <value>0.45</value> </param> <param> - <key>win</key> - <value>None</value> + <key>converver</key> + <value>float_converter</value> </param> <param> - <key>win_size</key> - <value></value> + <key>formatter</key> + <value>lambda x: "%0.2f"%x</value> </param> <param> <key>grid_pos</key> - <value>1, 0, 1, 3</value> + <value>0,2,1,1</value> </param> <param> <key>notebook</key> @@ -244,18 +228,18 @@ </param> <param> <key>_coordinate</key> - <value>(409, 289)</value> + <value>(473, 14)</value> </param> <param> <key>_rotation</key> - <value>180</value> + <value>0</value> </param> </block> <block> - <key>gr_sig_source_x</key> + <key>gr_throttle</key> <param> <key>id</key> - <value>tri_source</value> + <value>throttle</value> </param> <param> <key>_enabled</key> @@ -266,28 +250,16 @@ <value>float</value> </param> <param> - <key>samp_rate</key> + <key>samples_per_second</key> <value>samp_rate</value> </param> <param> - <key>waveform</key> - <value>gr.GR_TRI_WAVE</value> - </param> - <param> - <key>freq</key> - <value>0.05</value> - </param> - <param> - <key>amp</key> - <value>2.0</value> - </param> - <param> - <key>offset</key> - <value>0</value> + <key>vlen</key> + <value>1</value> </param> <param> <key>_coordinate</key> - <value>(21, 271)</value> + <value>(227, 493)</value> </param> <param> <key>_rotation</key> @@ -295,65 +267,61 @@ </param> </block> <block> - <key>variable</key> + <key>pfb_arb_resampler_xxx</key> <param> <key>id</key> - <value>nphases</value> + <value>pfb_arb_resampler_xxx_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>32</value> - </param> - <param> - <key>_coordinate</key> - <value>(185, 153)</value> + <key>type</key> + <value>ccf</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>rrate</key> + <value>float(new_rate)/samp_rate</value> </param> - </block> - <block> - <key>variable_static_text</key> <param> - <key>id</key> - <value>samp_rate</value> + <key>taps</key> + <value>rs_taps</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>nfilts</key> + <value>nphases</value> </param> <param> - <key>label</key> - <value>Sample Rate</value> + <key>atten</key> + <value>100</value> </param> <param> - <key>value</key> - <value>44100</value> + <key>_coordinate</key> + <value>(649, 469)</value> </param> <param> - <key>converver</key> - <value>float_converter</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>analog_frequency_modulator_fc</key> <param> - <key>formatter</key> - <value>None</value> + <key>id</key> + <value>analog_frequency_modulator_fc_0</value> </param> <param> - <key>grid_pos</key> - <value>0, 0, 1, 1</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>notebook</key> - <value></value> + <key>sensitivity</key> + <value>math.pi</value> </param> <param> <key>_coordinate</key> - <value>(179, 14)</value> + <value>(429, 501)</value> </param> <param> <key>_rotation</key> @@ -361,112 +329,94 @@ </param> </block> <block> - <key>variable_static_text</key> + <key>wxgui_fftsink2</key> <param> <key>id</key> - <value>new_rate</value> + <value>orig_fft</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>label</key> - <value>Resampled Rate</value> + <key>type</key> + <value>complex</value> </param> <param> - <key>value</key> - <value>48000</value> + <key>title</key> + <value>Original Spectrum</value> </param> <param> - <key>converver</key> - <value>float_converter</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>formatter</key> - <value>None</value> + <key>baseband_freq</key> + <value>0</value> </param> <param> - <key>grid_pos</key> - <value>0, 1, 1, 1</value> + <key>y_per_div</key> + <value>10</value> </param> <param> - <key>notebook</key> - <value></value> + <key>y_divs</key> + <value>10</value> </param> <param> - <key>_coordinate</key> - <value>(328, 15)</value> + <key>ref_level</key> + <value>30</value> </param> <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>variable_static_text</key> - <param> - <key>id</key> - <value>frac_bw</value> + <key>ref_scale</key> + <value>2.0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>fft_size</key> + <value>1024</value> </param> <param> - <key>label</key> - <value>Fractional Bandwidth</value> + <key>fft_rate</key> + <value>30</value> </param> <param> - <key>value</key> - <value>0.45</value> + <key>peak_hold</key> + <value>False</value> </param> <param> - <key>converver</key> - <value>float_converter</value> + <key>average</key> + <value>False</value> </param> <param> - <key>formatter</key> - <value>lambda x: "%0.2f"%x</value> + <key>avg_alpha</key> + <value>0</value> </param> <param> - <key>grid_pos</key> - <value>0,2,1,1</value> + <key>win</key> + <value>None</value> </param> <param> - <key>notebook</key> + <key>win_size</key> <value></value> </param> <param> - <key>_coordinate</key> - <value>(473, 14)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_frequency_modulator_fc</key> - <param> - <key>id</key> - <value>fm_mod</value> + <key>grid_pos</key> + <value>1, 0, 1, 3</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>notebook</key> + <value></value> </param> <param> - <key>sensitivity</key> - <value>math.pi</value> + <key>freqvar</key> + <value>None</value> </param> <param> <key>_coordinate</key> - <value>(411, 493)</value> + <value>(414, 279)</value> </param> <param> <key>_rotation</key> - <value>0</value> + <value>180</value> </param> </block> <block> @@ -548,8 +498,12 @@ <value></value> </param> <param> + <key>freqvar</key> + <value>None</value> + </param> + <param> <key>_coordinate</key> - <value>(640, 256)</value> + <value>(645, 241)</value> </param> <param> <key>_rotation</key> @@ -557,10 +511,10 @@ </param> </block> <block> - <key>pfb_arb_resampler_xxx</key> + <key>gr_add_const_vxx</key> <param> <key>id</key> - <value>pfb_arb_resampler_xxx_0</value> + <value>adder</value> </param> <param> <key>_enabled</key> @@ -568,35 +522,91 @@ </param> <param> <key>type</key> - <value>ccf</value> + <value>float</value> </param> <param> - <key>rrate</key> - <value>float(new_rate)/samp_rate</value> + <key>const</key> + <value>-1.0</value> </param> <param> - <key>taps</key> - <value>rs_taps</value> + <key>vlen</key> + <value>1</value> </param> <param> - <key>nfilts</key> - <value>nphases</value> + <key>_coordinate</key> + <value>(227, 303)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_sig_source_x</key> + <param> + <key>id</key> + <value>analog_sig_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>samp_rate</key> + <value>samp_rate</value> + </param> + <param> + <key>waveform</key> + <value>analog.GR_TRI_WAVE</value> + </param> + <param> + <key>freq</key> + <value>0.05</value> + </param> + <param> + <key>amp</key> + <value>2</value> + </param> + <param> + <key>offset</key> + <value>0</value> </param> <param> <key>_coordinate</key> - <value>(649, 469)</value> + <value>(36, 271)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>import</key> + <param> + <key>id</key> + <value>import_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>import</key> + <value>import math</value> + </param> + <param> + <key>_coordinate</key> + <value>(11, 75)</value> </param> <param> <key>_rotation</key> <value>0</value> </param> </block> - <connection> - <source_block_id>tri_source</source_block_id> - <sink_block_id>adder</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> <connection> <source_block_id>adder</source_block_id> <sink_block_id>throttle</sink_block_id> @@ -604,26 +614,32 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>fm_mod</source_block_id> - <sink_block_id>orig_fft</sink_block_id> + <source_block_id>pfb_arb_resampler_xxx_0</source_block_id> + <sink_block_id>resamp_fft</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> <source_block_id>throttle</source_block_id> - <sink_block_id>fm_mod</sink_block_id> + <sink_block_id>analog_frequency_modulator_fc_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>fm_mod</source_block_id> + <source_block_id>analog_frequency_modulator_fc_0</source_block_id> <sink_block_id>pfb_arb_resampler_xxx_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>pfb_arb_resampler_xxx_0</source_block_id> - <sink_block_id>resamp_fft</sink_block_id> + <source_block_id>analog_frequency_modulator_fc_0</source_block_id> + <sink_block_id>orig_fft</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_sig_source_x_0</source_block_id> + <sink_block_id>adder</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gr-filter/examples/synth_filter.py b/gr-filter/examples/synth_filter.py index a5b6fdf4cb..505141614a 100755 --- a/gr-filter/examples/synth_filter.py +++ b/gr-filter/examples/synth_filter.py @@ -25,15 +25,21 @@ from gnuradio import filter import sys try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + +try: import scipy except ImportError: - print "Error: Program requires scipy (see: www.scipy.org)." + sys.stderr.write("Error: Program requires scipy (see: www.scipy.org).\n") sys.exit(1) try: import pylab except ImportError: - print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)." + sys.stderr.write("Error: Program requires matplotlib (see: matplotlib.sourceforge.net).\n") sys.exit(1) def main(): @@ -45,7 +51,7 @@ def main(): sigs = list() for fi in freqs: - s = gr.sig_source_c(fs, gr.GR_SIN_WAVE, fi, 1) + s = analog.sig_source_c(fs, analog.GR_SIN_WAVE, fi, 1) sigs.append(s) taps = filter.firdes.low_pass_2(len(freqs), fs, diff --git a/gr-filter/examples/synth_to_chan.py b/gr-filter/examples/synth_to_chan.py index b5f4c958ef..bd39a17e59 100755 --- a/gr-filter/examples/synth_to_chan.py +++ b/gr-filter/examples/synth_to_chan.py @@ -25,15 +25,21 @@ from gnuradio import filter import sys try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + +try: import scipy except ImportError: - print "Error: Program requires scipy (see: www.scipy.org)." + sys.stderr.write("Error: Program requires scipy (see: www.scipy.org).\n") sys.exit(1) try: import pylab except ImportError: - print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)." + sys.stderr.write("Error: Program requires matplotlib (see: matplotlib.sourceforge.net).\n") sys.exit(1) def main(): @@ -46,8 +52,8 @@ def main(): sigs = list() fmtx = list() for fi in freqs: - s = gr.sig_source_f(fs, gr.GR_SIN_WAVE, fi, 1) - fm = blks2.nbfm_tx (fs, 4*fs, max_dev=10000, tau=75e-6) + s = analog.sig_source_f(fs, gr.GR_SIN_WAVE, fi, 1) + fm = analog.nbfm_tx(fs, 4*fs, max_dev=10000, tau=75e-6) sigs.append(s) fmtx.append(fm) @@ -62,7 +68,7 @@ def main(): noise_level = 0.01 head = gr.head(gr.sizeof_gr_complex, N) - noise = gr.noise_source_c(gr.GR_GAUSSIAN, noise_level) + noise = analog.noise_source_c(gr.GR_GAUSSIAN, noise_level) addnoise = gr.add_cc() snk_synth = gr.vector_sink_c() diff --git a/gr-filter/grc/CMakeLists.txt b/gr-filter/grc/CMakeLists.txt index 0940f1c73c..1ca23d560e 100644 --- a/gr-filter/grc/CMakeLists.txt +++ b/gr-filter/grc/CMakeLists.txt @@ -35,7 +35,6 @@ install(FILES filter_pfb_synthesizer.xml filter_rational_resampler_base_xxx.xml filter_single_pole_iir_filter_xx.xml - filter_channel_model.xml filter_low_pass_filter.xml filter_high_pass_filter.xml filter_band_pass_filter.xml diff --git a/gr-filter/grc/filter_block_tree.xml b/gr-filter/grc/filter_block_tree.xml index 976833abb8..9b72dcf605 100644 --- a/gr-filter/grc/filter_block_tree.xml +++ b/gr-filter/grc/filter_block_tree.xml @@ -53,6 +53,5 @@ <block>pfb_synthesizer_ccf</block> <block>rational_resampler_base_xxx</block> <block>single_pole_iir_filter_xx</block> - <block>channel_model</block> </cat> </cat> diff --git a/gr-filter/include/filter/CMakeLists.txt b/gr-filter/include/filter/CMakeLists.txt index 536b74b54e..9070a7489f 100644 --- a/gr-filter/include/filter/CMakeLists.txt +++ b/gr-filter/include/filter/CMakeLists.txt @@ -110,7 +110,6 @@ install(FILES pfb_synthesizer_ccf.h single_pole_iir_filter_cc.h single_pole_iir_filter_ff.h - channel_model.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/filter COMPONENT "filter_devel" ) diff --git a/gr-filter/lib/CMakeLists.txt b/gr-filter/lib/CMakeLists.txt index c47528046a..3b4bf9f178 100644 --- a/gr-filter/lib/CMakeLists.txt +++ b/gr-filter/lib/CMakeLists.txt @@ -137,7 +137,6 @@ list(APPEND filter_sources pfb_synthesizer_ccf_impl.cc single_pole_iir_filter_cc_impl.cc single_pole_iir_filter_ff_impl.cc - channel_model_impl.cc ) list(APPEND filter_libs diff --git a/gr-filter/python/qa_filter_delay_fc.py b/gr-filter/python/qa_filter_delay_fc.py index 57b063e7b5..420d6fb05f 100755 --- a/gr-filter/python/qa_filter_delay_fc.py +++ b/gr-filter/python/qa_filter_delay_fc.py @@ -24,6 +24,16 @@ from gnuradio import gr, gr_unittest import filter_swig as filter import math +def sin_source_f(samp_rate, freq, amp, N): + t = map(lambda x: float(x)/samp_rate, xrange(N)) + y = map(lambda x: math.sin(2.*math.pi*freq*x), t) + return y + +def cos_source_f(samp_rate, freq, amp, N): + t = map(lambda x: float(x)/samp_rate, xrange(N)) + y = map(lambda x: math.cos(2.*math.pi*freq*x), t) + return y + class test_filter_delay_fc(gr_unittest.TestCase): def setUp(self): @@ -102,18 +112,17 @@ class test_filter_delay_fc(gr_unittest.TestCase): sampling_freq = 100 ntaps = 51 - src1 = gr.sig_source_f(sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 1.0) - head = gr.head(gr.sizeof_float, int(ntaps + sampling_freq * 0.10)) + N = int(ntaps + sampling_freq * 0.10) + data = sin_source_f(sampling_freq, sampling_freq * 0.10, 1.0, N) + src1 = gr.vector_source_f(data) dst2 = gr.vector_sink_c() # calculate taps taps = filter.firdes_hilbert(ntaps) hd = filter.filter_delay_fc(taps) - tb.connect(src1, head) - tb.connect(head, hd) - tb.connect(hd,dst2) + tb.connect(src1, hd) + tb.connect(hd, dst2) tb.run() @@ -194,19 +203,17 @@ class test_filter_delay_fc(gr_unittest.TestCase): sampling_freq = 100 ntaps = 51 - src1 = gr.sig_source_f(sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 1.0) - head = gr.head(gr.sizeof_float, int(ntaps + sampling_freq * 0.10)) + N = int(ntaps + sampling_freq * 0.10) + data = sin_source_f(sampling_freq, sampling_freq * 0.10, 1.0, N) + src1 = gr.vector_source_f(data) dst2 = gr.vector_sink_c() - # calculate taps taps = filter.firdes_hilbert(ntaps) hd = filter.filter_delay_fc(taps) - tb.connect(src1, head) - tb.connect(head, (hd,0)) - tb.connect(head, (hd,1)) + tb.connect(src1, (hd,0)) + tb.connect(src1, (hd,1)) tb.connect(hd,dst2) tb.run() @@ -287,23 +294,20 @@ class test_filter_delay_fc(gr_unittest.TestCase): sampling_freq = 100 ntaps = 51 + N = int(ntaps + sampling_freq * 0.10) - src1 = gr.sig_source_f(sampling_freq, gr.GR_SIN_WAVE,sampling_freq * 0.10, 1.0) - src2 = gr.sig_source_f(sampling_freq, gr.GR_COS_WAVE,sampling_freq * 0.10, 1.0) - - head1 = gr.head(gr.sizeof_float, int(ntaps + sampling_freq * 0.10)) - head2 = gr.head(gr.sizeof_float, int(ntaps + sampling_freq * 0.10)) + data1 = sin_source_f(sampling_freq, sampling_freq * 0.10, 1.0, N) + data2 = cos_source_f(sampling_freq, sampling_freq * 0.10, 1.0, N) + src1 = gr.vector_source_f(data1) + src2 = gr.vector_source_f(data2) taps = filter.firdes_hilbert(ntaps) hd = filter.filter_delay_fc(taps) dst2 = gr.vector_sink_c() - tb.connect(src1, head1) - tb.connect(src2, head2) - - tb.connect(head1, (hd,0)) - tb.connect(head2, (hd,1)) + tb.connect(src1, (hd,0)) + tb.connect(src2, (hd,1)) tb.connect(hd, dst2) tb.run() diff --git a/gr-filter/python/qa_fractional_interpolator.py b/gr-filter/python/qa_fractional_interpolator.py index 9e0f685d80..ab4cc4cf9a 100755 --- a/gr-filter/python/qa_fractional_interpolator.py +++ b/gr-filter/python/qa_fractional_interpolator.py @@ -24,6 +24,17 @@ from gnuradio import gr, gr_unittest import filter_swig as filter import math +def sig_source_f(samp_rate, freq, amp, N): + t = map(lambda x: float(x)/samp_rate, xrange(N)) + y = map(lambda x: math.sin(2.*math.pi*freq*x), t) + return y + +def sig_source_c(samp_rate, freq, amp, N): + t = map(lambda x: float(x)/samp_rate, xrange(N)) + y = map(lambda x: math.cos(2.*math.pi*freq*x) + \ + 1j*math.sin(2.*math.pi*freq*x), t) + return y + class test_fractional_resampler(gr_unittest.TestCase): def setUp(self): @@ -38,12 +49,12 @@ class test_fractional_resampler(gr_unittest.TestCase): rrate = 1.123 # resampling rate freq = 10 - signal = gr.sig_source_f(fs, gr.GR_SIN_WAVE, freq, 1) - head = gr.head(gr.sizeof_float, N) + data = sig_source_f(fs, freq, 1, N) + signal = gr.vector_source_f(data) op = filter.fractional_interpolator_ff(0, rrate) snk = gr.vector_sink_f() - self.tb.connect(signal, head, op, snk) + self.tb.connect(signal, op, snk) self.tb.run() Ntest = 5000 @@ -64,12 +75,12 @@ class test_fractional_resampler(gr_unittest.TestCase): rrate = 1.123 # resampling rate freq = 10 - signal = gr.sig_source_c(fs, gr.GR_SIN_WAVE, freq, 1) - head = gr.head(gr.sizeof_gr_complex, N) + data = sig_source_c(fs, freq, 1, N) + signal = gr.vector_source_c(data) op = filter.fractional_interpolator_cc(0.0, rrate) snk = gr.vector_sink_c() - self.tb.connect(signal, head, op, snk) + self.tb.connect(signal, op, snk) self.tb.run() Ntest = 5000 diff --git a/gr-filter/python/qa_hilbert.py b/gr-filter/python/qa_hilbert.py index b460b6438f..c3522ed192 100755 --- a/gr-filter/python/qa_hilbert.py +++ b/gr-filter/python/qa_hilbert.py @@ -24,6 +24,11 @@ from gnuradio import gr, gr_unittest import filter_swig as filter import math +def sig_source_f(samp_rate, freq, amp, N): + t = map(lambda x: float(x)/samp_rate, xrange(N)) + y = map(lambda x: math.sin(2.*math.pi*freq*x), t) + return y + class test_hilbert(gr_unittest.TestCase): def setUp(self): @@ -99,15 +104,14 @@ class test_hilbert(gr_unittest.TestCase): (0.5877838134765625 +0.80908381938934326j), (3.218399768911695e-08 +1.0000815391540527j)) + + N = int(ntaps + sampling_freq * 0.10) + data = sig_source_f(sampling_freq, sampling_freq * 0.10, 1.0, N) + src1 = gr.vector_source_f(data) - src1 = gr.sig_source_f(sampling_freq, gr.GR_SIN_WAVE, - sampling_freq * 0.10, 1.0) - - head = gr.head(gr.sizeof_float, int (ntaps + sampling_freq * 0.10)) hilb = filter.hilbert_fc(ntaps) dst1 = gr.vector_sink_c() - tb.connect(src1, head) - tb.connect(head, hilb) + tb.connect(src1, hilb) tb.connect(hilb, dst1) tb.run() dst_data = dst1.data() diff --git a/gr-filter/python/qa_pfb_arb_resampler.py b/gr-filter/python/qa_pfb_arb_resampler.py index a4e22f4c02..98272013ef 100755 --- a/gr-filter/python/qa_pfb_arb_resampler.py +++ b/gr-filter/python/qa_pfb_arb_resampler.py @@ -24,6 +24,17 @@ from gnuradio import gr, gr_unittest import filter_swig as filter import math +def sig_source_c(samp_rate, freq, amp, N): + t = map(lambda x: float(x)/samp_rate, xrange(N)) + y = map(lambda x: math.cos(2.*math.pi*freq*x) + \ + 1j*math.sin(2.*math.pi*freq*x), t) + return y + +def sig_source_f(samp_rate, freq, amp, N): + t = map(lambda x: float(x)/samp_rate, xrange(N)) + y = map(lambda x: math.sin(2.*math.pi*freq*x), t) + return y + class test_pfb_arb_resampler(gr_unittest.TestCase): def setUp(self): @@ -43,12 +54,12 @@ class test_pfb_arb_resampler(gr_unittest.TestCase): window=filter.firdes.WIN_BLACKMAN_hARRIS) freq = 100 - signal = gr.sig_source_f(fs, gr.GR_SIN_WAVE, freq, 1) - head = gr.head(gr.sizeof_float, N) + data = sig_source_f(fs, freq, 1, N) + signal = gr.vector_source_f(data) pfb = filter.pfb_arb_resampler_fff(rrate, taps) snk = gr.vector_sink_f() - self.tb.connect(signal, head, pfb, snk) + self.tb.connect(signal, pfb, snk) self.tb.run() Ntest = 50 @@ -72,12 +83,12 @@ class test_pfb_arb_resampler(gr_unittest.TestCase): window=filter.firdes.WIN_BLACKMAN_hARRIS) freq = 100 - signal = gr.sig_source_c(fs, gr.GR_SIN_WAVE, freq, 1) - head = gr.head(gr.sizeof_gr_complex, N) + data = sig_source_c(fs, freq, 1, N) + signal = gr.vector_source_c(data) pfb = filter.pfb_arb_resampler_ccf(rrate, taps) snk = gr.vector_sink_c() - self.tb.connect(signal, head, pfb, snk) + self.tb.connect(signal, pfb, snk) self.tb.run() Ntest = 50 diff --git a/gr-filter/python/qa_pfb_channelizer.py b/gr-filter/python/qa_pfb_channelizer.py index c0ed8327df..e9a4d446e7 100755 --- a/gr-filter/python/qa_pfb_channelizer.py +++ b/gr-filter/python/qa_pfb_channelizer.py @@ -24,6 +24,12 @@ from gnuradio import gr, gr_unittest import filter_swig as filter import math +def sig_source_c(samp_rate, freq, amp, N): + t = map(lambda x: float(x)/samp_rate, xrange(N)) + y = map(lambda x: math.cos(2.*math.pi*freq*x) + \ + 1j*math.sin(2.*math.pi*freq*x), t) + return y + class test_pfb_channelizer(gr_unittest.TestCase): def setUp(self): @@ -47,14 +53,14 @@ class test_pfb_channelizer(gr_unittest.TestCase): freqs = [-200, -100, 0, 100, 200] for i in xrange(len(freqs)): f = freqs[i] + (M/2-M+i+1)*fs - signals.append(gr.sig_source_c(ifs, gr.GR_SIN_WAVE, f, 1)) + data = sig_source_c(ifs, f, 1, N) + signals.append(gr.vector_source_c(data)) self.tb.connect(signals[i], (add,i)) - head = gr.head(gr.sizeof_gr_complex, N) s2ss = gr.stream_to_streams(gr.sizeof_gr_complex, M) pfb = filter.pfb_channelizer_ccf(M, taps, 1) - self.tb.connect(add, head, s2ss) + self.tb.connect(add, s2ss) snks = list() for i in xrange(M): diff --git a/gr-filter/python/qa_pfb_decimator.py b/gr-filter/python/qa_pfb_decimator.py index 063845f638..c4448de4b5 100755 --- a/gr-filter/python/qa_pfb_decimator.py +++ b/gr-filter/python/qa_pfb_decimator.py @@ -24,6 +24,12 @@ from gnuradio import gr, gr_unittest import filter_swig as filter import math +def sig_source_c(samp_rate, freq, amp, N): + t = map(lambda x: float(x)/samp_rate, xrange(N)) + y = map(lambda x: math.cos(2.*math.pi*freq*x) + \ + 1j*math.sin(2.*math.pi*freq*x), t) + return y + class test_pfb_decimator(gr_unittest.TestCase): def setUp(self): @@ -48,7 +54,8 @@ class test_pfb_decimator(gr_unittest.TestCase): freqs = [-200, -100, 0, 100, 200] for i in xrange(len(freqs)): f = freqs[i] + (M/2-M+i+1)*fs - signals.append(gr.sig_source_c(ifs, gr.GR_SIN_WAVE, f, 1)) + data = sig_source_c(ifs, f, 1, N) + signals.append(gr.vector_source_c(data)) self.tb.connect(signals[i], (add,i)) head = gr.head(gr.sizeof_gr_complex, N) @@ -85,23 +92,23 @@ class test_pfb_decimator(gr_unittest.TestCase): channel = 1 # Extract channel 0 taps = filter.firdes.low_pass_2(1, ifs, fs/2, fs/10, - attenuation_dB=80, - window=filter.firdes.WIN_BLACKMAN_hARRIS) + attenuation_dB=80, + window=filter.firdes.WIN_BLACKMAN_hARRIS) signals = list() add = gr.add_cc() freqs = [-200, -100, 0, 100, 200] for i in xrange(len(freqs)): f = freqs[i] + (M/2-M+i+1)*fs - signals.append(gr.sig_source_c(ifs, gr.GR_SIN_WAVE, f, 1)) + data = sig_source_c(ifs, f, 1, N) + signals.append(gr.vector_source_c(data)) self.tb.connect(signals[i], (add,i)) - head = gr.head(gr.sizeof_gr_complex, N) s2ss = gr.stream_to_streams(gr.sizeof_gr_complex, M) pfb = filter.pfb_decimator_ccf(M, taps, channel) snk = gr.vector_sink_c() - self.tb.connect(add, head, s2ss) + self.tb.connect(add, s2ss) for i in xrange(M): self.tb.connect((s2ss,i), (pfb,i)) self.tb.connect(pfb, snk) @@ -114,9 +121,9 @@ class test_pfb_decimator(gr_unittest.TestCase): # Create known data as complex sinusoids for the baseband freq # of the extracted channel is due to decimator output order. - phase = 6.15746 + phase = 6.1575 expected_data = map(lambda x: math.cos(2.*math.pi*freqs[3]*x+phase) + \ - 1j*math.sin(2.*math.pi*freqs[3]*x+phase), t) + 1j*math.sin(2.*math.pi*freqs[3]*x+phase), t) dst_data = snk.data() self.assertComplexTuplesAlmostEqual(expected_data[-Ntest:], dst_data[-Ntest:], 4) diff --git a/gr-filter/python/qa_pfb_interpolator.py b/gr-filter/python/qa_pfb_interpolator.py index 5b84b7c642..ffaeee3f68 100755 --- a/gr-filter/python/qa_pfb_interpolator.py +++ b/gr-filter/python/qa_pfb_interpolator.py @@ -24,6 +24,12 @@ from gnuradio import gr, gr_unittest import filter_swig as filter import math +def sig_source_c(samp_rate, freq, amp, N): + t = map(lambda x: float(x)/samp_rate, xrange(N)) + y = map(lambda x: math.cos(2.*math.pi*freq*x) + \ + 1j*math.sin(2.*math.pi*freq*x), t) + return y + class test_pfb_interpolator(gr_unittest.TestCase): def setUp(self): @@ -43,12 +49,12 @@ class test_pfb_interpolator(gr_unittest.TestCase): window=filter.firdes.WIN_BLACKMAN_hARRIS) freq = 100 - signal = gr.sig_source_c(fs, gr.GR_COS_WAVE, freq, 1) - head = gr.head(gr.sizeof_gr_complex, N) + data = sig_source_c(fs, freq, 1, N) + signal = gr.vector_source_c(data) pfb = filter.pfb_interpolator_ccf(M, taps) snk = gr.vector_sink_c() - self.tb.connect(signal, head, pfb) + self.tb.connect(signal, pfb) self.tb.connect(pfb, snk) self.tb.run() diff --git a/gr-filter/python/qa_pfb_synthesizer.py b/gr-filter/python/qa_pfb_synthesizer.py index e8164d2683..2da02b58d3 100755 --- a/gr-filter/python/qa_pfb_synthesizer.py +++ b/gr-filter/python/qa_pfb_synthesizer.py @@ -24,6 +24,12 @@ from gnuradio import gr, gr_unittest import filter_swig as filter import math +def sig_source_c(samp_rate, freq, amp, N): + t = map(lambda x: float(x)/samp_rate, xrange(N)) + y = map(lambda x: math.cos(2.*math.pi*freq*x) + \ + 1j*math.sin(2.*math.pi*freq*x), t) + return y + class test_pfb_synthesizer(gr_unittest.TestCase): def setUp(self): @@ -45,16 +51,16 @@ class test_pfb_synthesizer(gr_unittest.TestCase): signals = list() freqs = [0, 100, 200, -200, -100] for i in xrange(len(freqs)): - signals.append(gr.sig_source_c(fs, gr.GR_SIN_WAVE, freqs[i], 1)) + data = sig_source_c(fs, freqs[i], 1, N) + signals.append(gr.vector_source_c(data)) - head = gr.head(gr.sizeof_gr_complex, N) pfb = filter.pfb_synthesizer_ccf(M, taps) snk = gr.vector_sink_c() for i in xrange(M): self.tb.connect(signals[i], (pfb,i)) - self.tb.connect(pfb, head, snk) + self.tb.connect(pfb, snk) self.tb.run() diff --git a/gr-filter/swig/filter_swig.i b/gr-filter/swig/filter_swig.i index 05b84d4d69..bb4eab381a 100644 --- a/gr-filter/swig/filter_swig.i +++ b/gr-filter/swig/filter_swig.i @@ -73,7 +73,6 @@ #include "filter/rational_resampler_base_scc.h" #include "filter/single_pole_iir_filter_cc.h" #include "filter/single_pole_iir_filter_ff.h" -#include "filter/channel_model.h" %} %include "filter/firdes.h" @@ -121,7 +120,6 @@ %include "filter/rational_resampler_base_scc.h" %include "filter/single_pole_iir_filter_cc.h" %include "filter/single_pole_iir_filter_ff.h" -%include "filter/channel_model.h" GR_SWIG_BLOCK_MAGIC2(filter, adaptive_fir_ccc); GR_SWIG_BLOCK_MAGIC2(filter, adaptive_fir_ccf); @@ -166,4 +164,3 @@ GR_SWIG_BLOCK_MAGIC2(filter, rational_resampler_base_fsf); GR_SWIG_BLOCK_MAGIC2(filter, rational_resampler_base_scc); GR_SWIG_BLOCK_MAGIC2(filter, single_pole_iir_filter_cc); GR_SWIG_BLOCK_MAGIC2(filter, single_pole_iir_filter_ff); -GR_SWIG_BLOCK_MAGIC2(filter, channel_model); diff --git a/gr-howto-write-a-block/apps/howto_square_qt.grc b/gr-howto-write-a-block/apps/howto_square_qt.grc index 7e963f92b5..6281c3a310 100644 --- a/gr-howto-write-a-block/apps/howto_square_qt.grc +++ b/gr-howto-write-a-block/apps/howto_square_qt.grc @@ -1,66 +1,59 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Sun Sep 30 13:32:48 2012</timestamp> + <timestamp>Sat Nov 10 15:23:43 2012</timestamp> <block> - <key>variable</key> + <key>options</key> <param> <key>id</key> - <value>samp_rate</value> + <value>howto_square_qt</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>32000</value> - </param> - <param> - <key>_coordinate</key> - <value>(183, 12)</value> + <key>title</key> + <value></value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>author</key> + <value></value> </param> - </block> - <block> - <key>gr_sig_source_x</key> <param> - <key>id</key> - <value>gr_sig_source_x_0</value> + <key>description</key> + <value></value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>window_size</key> + <value>1280, 1024</value> </param> <param> - <key>type</key> - <value>float</value> + <key>generate_options</key> + <value>qt_gui</value> </param> <param> - <key>samp_rate</key> - <value>samp_rate</value> + <key>category</key> + <value>Custom</value> </param> <param> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> + <key>run_options</key> + <value>prompt</value> </param> <param> - <key>freq</key> - <value>1000</value> + <key>run</key> + <value>True</value> </param> <param> - <key>amp</key> - <value>1</value> + <key>max_nouts</key> + <value>0</value> </param> <param> - <key>offset</key> - <value>0</value> + <key>realtime_scheduling</key> + <value></value> </param> <param> <key>_coordinate</key> - <value>(19, 98)</value> + <value>(10, 10)</value> </param> <param> <key>_rotation</key> @@ -68,30 +61,22 @@ </param> </block> <block> - <key>gr_throttle</key> + <key>variable</key> <param> <key>id</key> - <value>gr_throttle_0</value> + <value>samp_rate</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>samples_per_second</key> - <value>samp_rate</value> - </param> - <param> - <key>vlen</key> - <value>1</value> + <key>value</key> + <value>32000</value> </param> <param> <key>_coordinate</key> - <value>(212, 130)</value> + <value>(183, 12)</value> </param> <param> <key>_rotation</key> @@ -159,10 +144,18 @@ <value>1024</value> </param> <param> - <key>bw</key> + <key>srate</key> <value>samp_rate</value> </param> <param> + <key>ymin</key> + <value>-1</value> + </param> + <param> + <key>ymax</key> + <value>1</value> + </param> + <param> <key>nconnections</key> <value>3</value> </param> @@ -180,58 +173,73 @@ </param> </block> <block> - <key>options</key> + <key>gr_throttle</key> <param> <key>id</key> - <value>howto_square_qt</value> + <value>gr_throttle_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>title</key> - <value></value> + <key>type</key> + <value>float</value> </param> <param> - <key>author</key> - <value></value> + <key>samples_per_second</key> + <value>samp_rate</value> </param> <param> - <key>description</key> - <value></value> + <key>vlen</key> + <value>1</value> </param> <param> - <key>window_size</key> - <value>1280, 1024</value> + <key>_coordinate</key> + <value>(212, 130)</value> </param> <param> - <key>generate_options</key> - <value>qt_gui</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>analog_sig_source_x</key> <param> - <key>category</key> - <value>Custom</value> + <key>id</key> + <value>analog_sig_source_x_0</value> </param> <param> - <key>run_options</key> - <value>prompt</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>run</key> - <value>True</value> + <key>type</key> + <value>float</value> </param> <param> - <key>max_nouts</key> - <value>0</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>realtime_scheduling</key> - <value></value> + <key>waveform</key> + <value>analog.GR_COS_WAVE</value> + </param> + <param> + <key>freq</key> + <value>1000</value> + </param> + <param> + <key>amp</key> + <value>1</value> + </param> + <param> + <key>offset</key> + <value>0</value> </param> <param> <key>_coordinate</key> - <value>(10, 10)</value> + <value>(15, 98)</value> </param> <param> <key>_rotation</key> @@ -257,12 +265,6 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_sig_source_x_0</source_block_id> - <sink_block_id>gr_throttle_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>gr_throttle_0</source_block_id> <sink_block_id>qtgui_time_sink_x_0</sink_block_id> <source_key>0</source_key> @@ -274,4 +276,10 @@ <source_key>0</source_key> <sink_key>2</sink_key> </connection> + <connection> + <source_block_id>analog_sig_source_x_0</source_block_id> + <sink_block_id>gr_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> </flow_graph> diff --git a/gr-howto-write-a-block/apps/howto_square_qt.py b/gr-howto-write-a-block/apps/howto_square_qt.py index 1a3e6874c4..986f1c7585 100755 --- a/gr-howto-write-a-block/apps/howto_square_qt.py +++ b/gr-howto-write-a-block/apps/howto_square_qt.py @@ -2,10 +2,11 @@ ################################################## # Gnuradio Python Flow Graph # Title: Howto Square Qt -# Generated: Sun Sep 30 13:32:52 2012 +# Generated: Sat Nov 10 15:23:43 2012 ################################################## from PyQt4 import Qt +from gnuradio import analog from gnuradio import eng_notation from gnuradio import gr from gnuradio import qtgui @@ -49,16 +50,17 @@ class howto_square_qt(gr.top_block, Qt.QWidget): ################################################## self.qtgui_time_sink_x_0 = qtgui.time_sink_f( 1024, #size - samp_rate, #bw + samp_rate, #samp_rate "QT GUI Plot", #name 3 #number of inputs ) + self.qtgui_time_sink_x_0.set_y_axis(-1, 1) self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget) self.top_layout.addWidget(self._qtgui_time_sink_x_0_win) self.howto_square_ff_0 = howto.square_ff() self.howto_square2_ff_0 = howto.square2_ff() self.gr_throttle_0 = gr.throttle(gr.sizeof_float*1, samp_rate) - self.gr_sig_source_x_0 = gr.sig_source_f(samp_rate, gr.GR_COS_WAVE, 1000, 1, 0) + self.analog_sig_source_x_0 = analog.sig_source_f(samp_rate, analog.GR_COS_WAVE, 1000, 1, 0) ################################################## # Connections @@ -66,9 +68,9 @@ class howto_square_qt(gr.top_block, Qt.QWidget): self.connect((self.howto_square2_ff_0, 0), (self.qtgui_time_sink_x_0, 0)) self.connect((self.gr_throttle_0, 0), (self.howto_square2_ff_0, 0)) self.connect((self.gr_throttle_0, 0), (self.howto_square_ff_0, 0)) - self.connect((self.gr_sig_source_x_0, 0), (self.gr_throttle_0, 0)) self.connect((self.gr_throttle_0, 0), (self.qtgui_time_sink_x_0, 1)) self.connect((self.howto_square_ff_0, 0), (self.qtgui_time_sink_x_0, 2)) + self.connect((self.analog_sig_source_x_0, 0), (self.gr_throttle_0, 0)) # QT sink close method reimplementation def closeEvent(self, event): @@ -81,7 +83,8 @@ class howto_square_qt(gr.top_block, Qt.QWidget): def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate - self.gr_sig_source_x_0.set_sampling_freq(self.samp_rate) + self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate) + self.analog_sig_source_x_0.set_sampling_freq(self.samp_rate) if __name__ == '__main__': parser = OptionParser(option_class=eng_option, usage="%prog: [options]") diff --git a/gr-pager/CMakeLists.txt b/gr-pager/CMakeLists.txt index 8454448595..b11c2f4a28 100644 --- a/gr-pager/CMakeLists.txt +++ b/gr-pager/CMakeLists.txt @@ -29,6 +29,7 @@ include(GrComponent) GR_REGISTER_COMPONENT("gr-pager" ENABLE_GR_PAGER Boost_FOUND ENABLE_GR_CORE + ENABLE_GR_ANALOG ) GR_SET_GLOBAL(GR_PAGER_INCLUDE_DIRS diff --git a/gr-pager/python/flex_demod.py b/gr-pager/python/flex_demod.py index 4146695f87..853348e4b0 100644 --- a/gr-pager/python/flex_demod.py +++ b/gr-pager/python/flex_demod.py @@ -19,7 +19,8 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gru, optfir, blks2 +from gnuradio import gr, gru, blks2 +from gnuradio import analog from math import pi import pager_swig @@ -38,7 +39,7 @@ class flex_demod(gr.hier_block2): gr.io_signature(0,0,0)) k = 25000/(2*pi*1600) # 4800 Hz max deviation - quad = gr.quadrature_demod_cf(k) + quad = analog.quadrature_demod_cf(k) self.connect(self, quad) rsamp = blks2.rational_resampler_fff(16, 25) diff --git a/gr-qtgui/apps/grc_qt_example.grc b/gr-qtgui/apps/grc_qt_example.grc index 170cd546ad..a0c9a0b6ae 100644 --- a/gr-qtgui/apps/grc_qt_example.grc +++ b/gr-qtgui/apps/grc_qt_example.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Sun Apr 10 16:49:13 2011</timestamp> + <timestamp>Sat Nov 10 14:58:46 2012</timestamp> <block> <key>options</key> <param> @@ -44,6 +44,10 @@ <value>True</value> </param> <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> <key>realtime_scheduling</key> <value></value> </param> @@ -80,37 +84,6 @@ </param> </block> <block> - <key>gr_throttle</key> - <param> - <key>id</key> - <value>gr_throttle_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>samples_per_second</key> - <value>samp_rate</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(511, 96)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>variable_qtgui_range</key> <param> <key>id</key> @@ -166,49 +139,6 @@ </param> </block> <block> - <key>gr_sig_source_x</key> - <param> - <key>id</key> - <value>gr_sig_source_x_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>samp_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> - </param> - <param> - <key>freq</key> - <value>freq</value> - </param> - <param> - <key>amp</key> - <value>amp</value> - </param> - <param> - <key>offset</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(295, 64)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>variable_qtgui_range</key> <param> <key>id</key> @@ -319,10 +249,41 @@ </param> </block> <block> - <key>gr_channel_model</key> + <key>gr_throttle</key> <param> <key>id</key> - <value>gr_channel_model_0</value> + <value>gr_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(511, 96)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>channels_channel_model</key> + <param> + <key>id</key> + <value>channels_channel_model_0</value> </param> <param> <key>_enabled</key> @@ -346,11 +307,11 @@ </param> <param> <key>seed</key> - <value>42</value> + <value>-42</value> </param> <param> <key>_coordinate</key> - <value>(727, 64)</value> + <value>(724, 64)</value> </param> <param> <key>_rotation</key> @@ -392,6 +353,10 @@ <value>samp_rate</value> </param> <param> + <key>rate</key> + <value>10</value> + </param> + <param> <key>plotfreq</key> <value>True</value> </param> @@ -412,8 +377,55 @@ <value></value> </param> <param> + <key>freqchangevar</key> + <value>None</value> + </param> + <param> <key>_coordinate</key> - <value>(958, 72)</value> + <value>(958, 64)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_sig_source_x</key> + <param> + <key>id</key> + <value>analog_sig_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>samp_rate</key> + <value>samp_rate</value> + </param> + <param> + <key>waveform</key> + <value>analog.GR_COS_WAVE</value> + </param> + <param> + <key>freq</key> + <value>freq</value> + </param> + <param> + <key>amp</key> + <value>amp</value> + </param> + <param> + <key>offset</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(297, 64)</value> </param> <param> <key>_rotation</key> @@ -421,20 +433,20 @@ </param> </block> <connection> - <source_block_id>gr_sig_source_x_0</source_block_id> + <source_block_id>analog_sig_source_x_0</source_block_id> <sink_block_id>gr_throttle_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_throttle_0</source_block_id> - <sink_block_id>gr_channel_model_0</sink_block_id> + <source_block_id>channels_channel_model_0</source_block_id> + <sink_block_id>qtgui_sink_x_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_channel_model_0</source_block_id> - <sink_block_id>qtgui_sink_x_0</sink_block_id> + <source_block_id>gr_throttle_0</source_block_id> + <sink_block_id>channels_channel_model_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gr-qtgui/examples/pyqt_const_c.py b/gr-qtgui/examples/pyqt_const_c.py index 125124ebc5..cf81aa120f 100755 --- a/gr-qtgui/examples/pyqt_const_c.py +++ b/gr-qtgui/examples/pyqt_const_c.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -28,7 +28,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.exit(1) + +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit(1) class dialog_box(QtGui.QWidget): @@ -139,8 +145,8 @@ class my_top_block(gr.top_block): self.qapp = QtGui.QApplication(sys.argv) - src1 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f1, 0.5, 0) - src2 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f2, 0.5, 0) + src1 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f1, 0.5, 0) + src2 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f2, 0.5, 0) src = gr.add_cc() channel = filter.channel_model(0.001) thr = gr.throttle(gr.sizeof_gr_complex, 100*npts) diff --git a/gr-qtgui/examples/pyqt_example_c.py b/gr-qtgui/examples/pyqt_example_c.py index d5dc86ab56..618b539b75 100755 --- a/gr-qtgui/examples/pyqt_example_c.py +++ b/gr-qtgui/examples/pyqt_example_c.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -28,7 +28,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.exit(1) + +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit(1) class dialog_box(QtGui.QWidget): @@ -139,12 +145,12 @@ class my_top_block(gr.top_block): self.qapp = QtGui.QApplication(sys.argv) - src1 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f1, 0.1, 0) - src2 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f2, 0.1, 0) + src1 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0) + src2 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0) src = gr.add_cc() channel = filter.channel_model(0.001) thr = gr.throttle(gr.sizeof_gr_complex, 100*fftsize) - self.snk1 = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, + self.snk1 = qtgui.sink_c(fftsize, filter.firdes.WIN_BLACKMAN_hARRIS, 0, Rs, "Complex Signal Example", True, True, True, False) diff --git a/gr-qtgui/examples/pyqt_example_f.py b/gr-qtgui/examples/pyqt_example_f.py index d00011f403..d2b3d0eb26 100755 --- a/gr-qtgui/examples/pyqt_example_f.py +++ b/gr-qtgui/examples/pyqt_example_f.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -28,7 +28,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.exit(1) + +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit(1) class dialog_box(QtGui.QWidget): @@ -139,11 +145,11 @@ class my_top_block(gr.top_block): self.qapp = QtGui.QApplication(sys.argv) - src1 = gr.sig_source_f(Rs, gr.GR_SIN_WAVE, f1, 0.1, 0) - src2 = gr.sig_source_f(Rs, gr.GR_SIN_WAVE, f2, 0.1, 0) + src1 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0) + src2 = analg.sig_source_f(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0) src = gr.add_ff() thr = gr.throttle(gr.sizeof_float, 100*fftsize) - noise = gr.noise_source_f(gr.GR_GAUSSIAN, 0.001) + noise = analog.noise_source_f(analog.GR_GAUSSIAN, 0.001) add = gr.add_ff() self.snk1 = qtgui.sink_f(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, 0, Rs, diff --git a/gr-qtgui/examples/pyqt_freq_c.py b/gr-qtgui/examples/pyqt_freq_c.py index 984cd4a9ae..a645e08698 100755 --- a/gr-qtgui/examples/pyqt_freq_c.py +++ b/gr-qtgui/examples/pyqt_freq_c.py @@ -28,7 +28,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.exit(1) + +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit(1) class dialog_box(QtGui.QWidget): @@ -139,12 +145,12 @@ class my_top_block(gr.top_block): self.qapp = QtGui.QApplication(sys.argv) - src1 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f1, 0.1, 0) - src2 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f2, 0.1, 0) + src1 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0) + src2 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0) src = gr.add_cc() channel = filter.channel_model(0.01) thr = gr.throttle(gr.sizeof_gr_complex, 100*npts) - self.snk1 = qtgui.freq_sink_c(npts, gr.firdes.WIN_BLACKMAN_hARRIS, + self.snk1 = qtgui.freq_sink_c(npts, analog.firdes.WIN_BLACKMAN_hARRIS, 0, Rs, "Complex Freq Example", 3) diff --git a/gr-qtgui/examples/pyqt_freq_f.py b/gr-qtgui/examples/pyqt_freq_f.py index fb7a9f93c6..d276d11106 100755 --- a/gr-qtgui/examples/pyqt_freq_f.py +++ b/gr-qtgui/examples/pyqt_freq_f.py @@ -28,9 +28,16 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") sys.exit(1) +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + + class dialog_box(QtGui.QWidget): def __init__(self, display, control): QtGui.QWidget.__init__(self, None) @@ -139,11 +146,11 @@ class my_top_block(gr.top_block): self.qapp = QtGui.QApplication(sys.argv) - src1 = gr.sig_source_f(Rs, gr.GR_SIN_WAVE, f1, 0.1, 0) - src2 = gr.sig_source_f(Rs, gr.GR_SIN_WAVE, f2, 0.1, 0) + src1 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0) + src2 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0) src = gr.add_ff() thr = gr.throttle(gr.sizeof_float, 100*npts) - self.snk1 = qtgui.freq_sink_f(npts, gr.firdes.WIN_BLACKMAN_hARRIS, + self.snk1 = qtgui.freq_sink_f(npts, filter.firdes.WIN_BLACKMAN_hARRIS, 0, Rs, "Real freq Example", 3) diff --git a/gr-qtgui/examples/pyqt_time_c.py b/gr-qtgui/examples/pyqt_time_c.py index 80730de8c8..a9e73b52c5 100755 --- a/gr-qtgui/examples/pyqt_time_c.py +++ b/gr-qtgui/examples/pyqt_time_c.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -28,7 +28,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.exit(1) + +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit(1) class dialog_box(QtGui.QWidget): @@ -139,8 +145,8 @@ class my_top_block(gr.top_block): self.qapp = QtGui.QApplication(sys.argv) - src1 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f1, 0.1, 0) - src2 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f2, 0.1, 0) + src1 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0) + src2 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0) src = gr.add_cc() channel = filter.channel_model(0.01) thr = gr.throttle(gr.sizeof_gr_complex, 100*npts) diff --git a/gr-qtgui/examples/pyqt_time_f.py b/gr-qtgui/examples/pyqt_time_f.py index 2afb5a119b..d7119dcb93 100755 --- a/gr-qtgui/examples/pyqt_time_f.py +++ b/gr-qtgui/examples/pyqt_time_f.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -28,7 +28,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.exit(1) + +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit(1) class dialog_box(QtGui.QWidget): @@ -139,11 +145,11 @@ class my_top_block(gr.top_block): self.qapp = QtGui.QApplication(sys.argv) - src1 = gr.sig_source_f(Rs, gr.GR_SIN_WAVE, f1, 0.1, 0) - src2 = gr.sig_source_f(Rs, gr.GR_SIN_WAVE, f2, 0.1, 0) + src1 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0) + src2 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0) src = gr.add_ff() thr = gr.throttle(gr.sizeof_float, 100*npts) - noise = gr.noise_source_f(gr.GR_GAUSSIAN, 0.001) + noise = analog.noise_source_f(analog.GR_GAUSSIAN, 0.001) add = gr.add_ff() self.snk1 = qtgui.time_sink_f(npts, Rs, "Complex Time Example", 3) diff --git a/gr-qtgui/examples/pyqt_waterfall_c.py b/gr-qtgui/examples/pyqt_waterfall_c.py index 1399879c0e..c1c5f1f88d 100755 --- a/gr-qtgui/examples/pyqt_waterfall_c.py +++ b/gr-qtgui/examples/pyqt_waterfall_c.py @@ -28,7 +28,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.exit(1) + +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit(1) class dialog_box(QtGui.QWidget): @@ -139,12 +145,12 @@ class my_top_block(gr.top_block): self.qapp = QtGui.QApplication(sys.argv) - src1 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f1, 0.1, 0) - src2 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f2, 0.1, 0) + src1 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0) + src2 = analog.sig_source_c(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0) src = gr.add_cc() channel = filter.channel_model(0.01) thr = gr.throttle(gr.sizeof_gr_complex, 100*npts) - self.snk1 = qtgui.waterfall_sink_c(npts, gr.firdes.WIN_BLACKMAN_hARRIS, + self.snk1 = qtgui.waterfall_sink_c(npts, filter.firdes.WIN_BLACKMAN_hARRIS, 0, Rs, "Complex Waterfall Example") diff --git a/gr-qtgui/examples/pyqt_waterfall_f.py b/gr-qtgui/examples/pyqt_waterfall_f.py index 29ae259e5f..ff79924843 100755 --- a/gr-qtgui/examples/pyqt_waterfall_f.py +++ b/gr-qtgui/examples/pyqt_waterfall_f.py @@ -28,7 +28,13 @@ try: from PyQt4 import QtGui, QtCore import sip except ImportError: - print "Error: Program requires PyQt4 and gr-qtgui." + sys.stderr.write("Error: Program requires PyQt4 and gr-qtgui.\n") + sys.exit(1) + +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit(1) class dialog_box(QtGui.QWidget): @@ -139,11 +145,11 @@ class my_top_block(gr.top_block): self.qapp = QtGui.QApplication(sys.argv) - src1 = gr.sig_source_f(Rs, gr.GR_SIN_WAVE, f1, 0.1, 0) - src2 = gr.sig_source_f(Rs, gr.GR_SIN_WAVE, f2, 0.1, 0) + src1 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f1, 0.1, 0) + src2 = analog.sig_source_f(Rs, analog.GR_SIN_WAVE, f2, 0.1, 0) src = gr.add_ff() thr = gr.throttle(gr.sizeof_float, 100*npts) - self.snk1 = qtgui.waterfall_sink_f(npts, gr.firdes.WIN_BLACKMAN_hARRIS, + self.snk1 = qtgui.waterfall_sink_f(npts, filter.firdes.WIN_BLACKMAN_hARRIS, 0, Rs, "Real Waterfall Example") diff --git a/gr-shd/CMakeLists.txt b/gr-shd/CMakeLists.txt index 7dad30cd80..0269abdec0 100644 --- a/gr-shd/CMakeLists.txt +++ b/gr-shd/CMakeLists.txt @@ -53,6 +53,7 @@ GR_REGISTER_COMPONENT("gr-shd" ENABLE_GR_SHD Boost_FOUND SHD_FOUND ENABLE_GR_CORE + ENABLE_GR_ANALOG ) GR_SET_GLOBAL(GR_SHD_INCLUDE_DIRS diff --git a/gr-shd/apps/shd_siggen b/gr-shd/apps/shd_siggen index 9629d80d29..ad44ef4a93 100755 --- a/gr-shd/apps/shd_siggen +++ b/gr-shd/apps/shd_siggen @@ -27,6 +27,7 @@ outputs single precision complex float values or complex short values """ from gnuradio import gr, eng_notation +from gnuradio import analog from gnuradio import shd from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -39,8 +40,9 @@ class shd_siggen(gr.top_block): def __init__(self, options): gr.top_block.__init__(self) - self._src = gr.sig_source_c(options.samp_rate, gr.GR_SIN_WAVE, - 200, 1) + self._src = analog.sig_source_c(options.samp_rate, + analog.GR_SIN_WAVE, + 200, 1) self._snk = shd.smini_sink(device_addr=options.address, io_type=shd.io_type.COMPLEX_FLOAT32, diff --git a/gr-trellis/doc/gr-trellis.xml b/gr-trellis/doc/gr-trellis.xml index 58aa74d409..314fb2e05f 100644 --- a/gr-trellis/doc/gr-trellis.xml +++ b/gr-trellis/doc/gr-trellis.xml @@ -598,7 +598,7 @@ r_k=(rk1,rk2,...,rkD). <programlisting> 22 # CHANNEL 23 add = gr.add_ff() - 24 noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + 24 noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) </programlisting> @@ -815,7 +815,7 @@ The modulated symbols are filtered by the ISI channel and AWGN with appropriate 28 # CHANNEL 29 isi = gr.fir_filter_fff(1,channel) 30 add = gr.add_ff() - 31 noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + 31 noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) </programlisting> diff --git a/gr-trellis/doc/test_tcm.py b/gr-trellis/doc/test_tcm.py index 3a285e27a2..181ba643d6 100644 --- a/gr-trellis/doc/test_tcm.py +++ b/gr-trellis/doc/test_tcm.py @@ -9,6 +9,12 @@ import sys import random import fsm_utils +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): tb = gr.top_block () @@ -21,7 +27,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): # CHANNEL add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX metrics = trellis.metrics_f(f.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi diff --git a/gr-trellis/doc/test_tcm.py.xml b/gr-trellis/doc/test_tcm.py.xml index a4c541e38a..4122fafff8 100644 --- a/gr-trellis/doc/test_tcm.py.xml +++ b/gr-trellis/doc/test_tcm.py.xml @@ -4,7 +4,7 @@ 2 3 from gnuradio import gr 4 from gnuradio import audio - 5 from gnuradio import trellis + 5 from gnuradio import trellis, digital, analog 6 from gnuradio import eng_notation 7 import math 8 import sys @@ -23,7 +23,7 @@ 21 22 # CHANNEL 23 add = gr.add_ff() - 24 noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + 24 noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) 25 26 # RX 27 metrics = trellis.metrics_f(f.O(),dimensionality,constellation,trellis.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi diff --git a/gr-trellis/doc/test_viterbi_equalization1.py b/gr-trellis/doc/test_viterbi_equalization1.py index c9c897fe2e..cac96df117 100755 --- a/gr-trellis/doc/test_viterbi_equalization1.py +++ b/gr-trellis/doc/test_viterbi_equalization1.py @@ -9,6 +9,12 @@ import sys import random import fsm_utils +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + def run_test (f,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constellation,N0,seed): tb = gr.top_block () L = len(channel) @@ -28,7 +34,7 @@ def run_test (f,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constel # CHANNEL isi = gr.fir_filter_fff(1,channel) add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX skip = gr.skiphead(gr.sizeof_float, L) # skip the first L samples since you know they are coming from the L zero symbols diff --git a/gr-trellis/doc/test_viterbi_equalization1.py.xml b/gr-trellis/doc/test_viterbi_equalization1.py.xml index 751633a618..e1f2aeefcb 100644 --- a/gr-trellis/doc/test_viterbi_equalization1.py.xml +++ b/gr-trellis/doc/test_viterbi_equalization1.py.xml @@ -4,7 +4,7 @@ 2 3 from gnuradio import gr 4 from gnuradio import audio - 5 from gnuradio import trellis + 5 from gnuradio import trellis, digital, analog 6 from gnuradio import eng_notation 7 import math 8 import sys @@ -30,7 +30,7 @@ 28 # CHANNEL 29 isi = gr.fir_filter_fff(1,channel) 30 add = gr.add_ff() - 31 noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + 31 noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) 32 33 # RX 34 skip = gr.skiphead(gr.sizeof_float, L) # skip the first L samples since you know they are coming from the L zero symbols diff --git a/gr-trellis/src/examples/grc/interference_cancellation.grc b/gr-trellis/src/examples/grc/interference_cancellation.grc index 7674b4bf16..129ee87905 100644 --- a/gr-trellis/src/examples/grc/interference_cancellation.grc +++ b/gr-trellis/src/examples/grc/interference_cancellation.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Wed Aug 31 17:40:25 2011</timestamp> + <timestamp>Sat Nov 10 15:39:57 2012</timestamp> <block> <key>options</key> <param> @@ -44,6 +44,10 @@ <value>True</value> </param> <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> <key>realtime_scheduling</key> <value></value> </param> @@ -229,37 +233,6 @@ </param> </block> <block> - <key>gr_multiply_const_vxx</key> - <param> - <key>id</key> - <value>gr_multiply_const_vxx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>const</key> - <value>alpha**0.5</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(988, 196)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>random_source_x</key> <param> <key>id</key> @@ -299,142 +272,6 @@ </param> </block> <block> - <key>gr_chunks_to_symbols_xx</key> - <param> - <key>id</key> - <value>gr_chunks_to_symbols_xx_1</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>in_type</key> - <value>short</value> - </param> - <param> - <key>out_type</key> - <value>complex</value> - </param> - <param> - <key>symbol_table</key> - <value>1,1j,-1j,-1</value> - </param> - <param> - <key>dimension</key> - <value>1</value> - </param> - <param> - <key>num_ports</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(660, 311)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_multiply_const_vxx</key> - <param> - <key>id</key> - <value>gr_multiply_const_vxx_1</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>const</key> - <value>(1-alpha)**0.5</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(994, 319)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_add_xx</key> - <param> - <key>id</key> - <value>gr_add_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>num_inputs</key> - <value>2</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(1224, 244)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_noise_source_x</key> - <param> - <key>id</key> - <value>gr_noise_source_x_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>noise_type</key> - <value>gr.GR_GAUSSIAN</value> - </param> - <param> - <key>amp</key> - <value>noisevar</value> - </param> - <param> - <key>seed</key> - <value>42</value> - </param> - <param> - <key>_coordinate</key> - <value>(1146, 369)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>gr_sub_xx</key> <param> <key>id</key> @@ -507,6 +344,14 @@ <value>True</value> </param> <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> <key>_coordinate</key> <value>(994, 545)</value> </param> @@ -588,78 +433,16 @@ <value>True</value> </param> <param> - <key>_coordinate</key> - <value>(1005, 798)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_chunks_to_symbols_xx</key> - <param> - <key>id</key> - <value>gr_chunks_to_symbols_xx_2</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>in_type</key> - <value>short</value> - </param> - <param> - <key>out_type</key> - <value>complex</value> - </param> - <param> - <key>symbol_table</key> - <value>1,1j,-1j,-1</value> - </param> - <param> - <key>dimension</key> - <value>1</value> - </param> - <param> - <key>num_ports</key> + <key>vlen</key> <value>1</value> </param> <param> - <key>_coordinate</key> - <value>(405, 998)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_multiply_const_vxx</key> - <param> - <key>id</key> - <value>gr_multiply_const_vxx_2</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>const</key> - <value>alpha**0.5</value> - </param> - <param> - <key>vlen</key> + <key>scale</key> <value>1</value> </param> <param> <key>_coordinate</key> - <value>(710, 1008)</value> + <value>(1005, 798)</value> </param> <param> <key>_rotation</key> @@ -770,78 +553,16 @@ <value>True</value> </param> <param> - <key>_coordinate</key> - <value>(1009, 1156)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_chunks_to_symbols_xx</key> - <param> - <key>id</key> - <value>gr_chunks_to_symbols_xx_2_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>in_type</key> - <value>short</value> - </param> - <param> - <key>out_type</key> - <value>complex</value> - </param> - <param> - <key>symbol_table</key> - <value>1,1j,-1j,-1</value> - </param> - <param> - <key>dimension</key> + <key>vlen</key> <value>1</value> </param> <param> - <key>num_ports</key> + <key>scale</key> <value>1</value> </param> <param> <key>_coordinate</key> - <value>(420, 1368)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_multiply_const_vxx</key> - <param> - <key>id</key> - <value>gr_multiply_const_vxx_2_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>const</key> - <value>(1-alpha)**0.5</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(733, 1374)</value> + <value>(1009, 1156)</value> </param> <param> <key>_rotation</key> @@ -952,39 +673,16 @@ <value>True</value> </param> <param> - <key>_coordinate</key> - <value>(1010, 1551)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>trellis_encoder_xx</key> - <param> - <key>id</key> - <value>trellis_encoder_xx_1</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>ss</value> - </param> - <param> - <key>fsm_args</key> - <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> + <key>vlen</key> + <value>1</value> </param> <param> - <key>init_state</key> - <value>0</value> + <key>scale</key> + <value>1</value> </param> <param> <key>_coordinate</key> - <value>(336, 311)</value> + <value>(1010, 1551)</value> </param> <param> <key>_rotation</key> @@ -1035,7 +733,7 @@ </param> <param> <key>metric_type</key> - <value>trellis.TRELLIS_EUCLIDEAN</value> + <value>digital.TRELLIS_EUCLIDEAN</value> </param> <param> <key>_coordinate</key> @@ -1090,7 +788,7 @@ </param> <param> <key>metric_type</key> - <value>trellis.TRELLIS_EUCLIDEAN</value> + <value>digital.TRELLIS_EUCLIDEAN</value> </param> <param> <key>_coordinate</key> @@ -1102,37 +800,6 @@ </param> </block> <block> - <key>trellis_encoder_xx</key> - <param> - <key>id</key> - <value>trellis_encoder_xx_2</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>ss</value> - </param> - <param> - <key>fsm_args</key> - <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> - </param> - <param> - <key>init_state</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(89, 998)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>trellis_viterbi_combined_xx</key> <param> <key>id</key> @@ -1176,7 +843,7 @@ </param> <param> <key>metric_type</key> - <value>trellis.TRELLIS_EUCLIDEAN</value> + <value>digital.TRELLIS_EUCLIDEAN</value> </param> <param> <key>_coordinate</key> @@ -1188,37 +855,6 @@ </param> </block> <block> - <key>trellis_encoder_xx</key> - <param> - <key>id</key> - <value>trellis_encoder_xx_2_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>ss</value> - </param> - <param> - <key>fsm_args</key> - <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> - </param> - <param> - <key>init_state</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(105, 1367)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>trellis_viterbi_combined_xx</key> <param> <key>id</key> @@ -1262,7 +898,7 @@ </param> <param> <key>metric_type</key> - <value>trellis.TRELLIS_EUCLIDEAN</value> + <value>digital.TRELLIS_EUCLIDEAN</value> </param> <param> <key>_coordinate</key> @@ -1274,37 +910,6 @@ </param> </block> <block> - <key>gr_add_xx</key> - <param> - <key>id</key> - <value>gr_add_xx_1</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>num_inputs</key> - <value>2</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(1400, 262)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>wxgui_scopesink2</key> <param> <key>id</key> @@ -1434,76 +1039,6 @@ </param> </block> <block> - <key>gr_throttle</key> - <param> - <key>id</key> - <value>gr_throttle_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>short</value> - </param> - <param> - <key>samples_per_second</key> - <value>R</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(534, 149)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_chunks_to_symbols_xx</key> - <param> - <key>id</key> - <value>gr_chunks_to_symbols_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>in_type</key> - <value>short</value> - </param> - <param> - <key>out_type</key> - <value>complex</value> - </param> - <param> - <key>symbol_table</key> - <value>1,1j,-1j,-1</value> - </param> - <param> - <key>dimension</key> - <value>1</value> - </param> - <param> - <key>num_ports</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(682, 186)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>variable</key> <param> <key>id</key> @@ -1874,6 +1409,507 @@ <value>0</value> </param> </block> + <block> + <key>gr_add_xx</key> + <param> + <key>id</key> + <value>gr_add_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(1400, 262)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_add_xx</key> + <param> + <key>id</key> + <value>gr_add_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(1224, 245)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_noise_source_x</key> + <param> + <key>id</key> + <value>analog_noise_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>noise_type</key> + <value>analog.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noisevar</value> + </param> + <param> + <key>seed</key> + <value>-42</value> + </param> + <param> + <key>_coordinate</key> + <value>(1178, 321)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>samples_per_second</key> + <value>R</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(579, 143)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_const_vxx</key> + <param> + <key>id</key> + <value>gr_multiply_const_vxx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>const</key> + <value>alpha**0.5</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(988, 196)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>digital_chunks_to_symbols_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>complex</value> + </param> + <param> + <key>symbol_table</key> + <value>1,1j,-1j,-1</value> + </param> + <param> + <key>dimension</key> + <value>1</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(703, 211)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_const_vxx</key> + <param> + <key>id</key> + <value>gr_multiply_const_vxx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>const</key> + <value>(1-alpha)**0.5</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(994, 319)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_encoder_xx</key> + <param> + <key>id</key> + <value>trellis_encoder_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>ss</value> + </param> + <param> + <key>fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> + </param> + <param> + <key>init_state</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(336, 311)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>digital_chunks_to_symbols_xx_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>complex</value> + </param> + <param> + <key>symbol_table</key> + <value>1,1j,-1j,-1</value> + </param> + <param> + <key>dimension</key> + <value>1</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(703, 311)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>digital_chunks_to_symbols_xx_0_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>complex</value> + </param> + <param> + <key>symbol_table</key> + <value>1,1j,-1j,-1</value> + </param> + <param> + <key>dimension</key> + <value>1</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(418, 1000)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_const_vxx</key> + <param> + <key>id</key> + <value>gr_multiply_const_vxx_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>const</key> + <value>alpha**0.5</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(710, 1008)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_encoder_xx</key> + <param> + <key>id</key> + <value>trellis_encoder_xx_2</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>ss</value> + </param> + <param> + <key>fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> + </param> + <param> + <key>init_state</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(89, 1000)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_multiply_const_vxx</key> + <param> + <key>id</key> + <value>gr_multiply_const_vxx_2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>const</key> + <value>(1-alpha)**0.5</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(733, 1374)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>trellis_encoder_xx</key> + <param> + <key>id</key> + <value>trellis_encoder_xx_2_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>ss</value> + </param> + <param> + <key>fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm"</value> + </param> + <param> + <key>init_state</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(103, 1366)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>digital_chunks_to_symbols_xx_0_0_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>complex</value> + </param> + <param> + <key>symbol_table</key> + <value>1,1j,-1j,-1</value> + </param> + <param> + <key>dimension</key> + <value>1</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(420, 1366)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> <connection> <source_block_id>random_source_x_1</source_block_id> <sink_block_id>trellis_encoder_xx_1</sink_block_id> @@ -1881,18 +1917,6 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>trellis_encoder_xx_1</source_block_id> - <sink_block_id>gr_chunks_to_symbols_xx_1</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_chunks_to_symbols_xx_0</source_block_id> - <sink_block_id>gr_multiply_const_vxx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>gr_multiply_const_vxx_0</source_block_id> <sink_block_id>gr_add_xx_0</sink_block_id> <source_key>0</source_key> @@ -1905,18 +1929,6 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_noise_source_x_0</source_block_id> - <sink_block_id>gr_add_xx_1</sink_block_id> - <source_key>0</source_key> - <sink_key>1</sink_key> - </connection> - <connection> - <source_block_id>gr_chunks_to_symbols_xx_1</source_block_id> - <sink_block_id>gr_multiply_const_vxx_1</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>gr_multiply_const_vxx_1</source_block_id> <sink_block_id>gr_add_xx_0</sink_block_id> <source_key>0</source_key> @@ -2013,18 +2025,6 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>trellis_encoder_xx_2</source_block_id> - <sink_block_id>gr_chunks_to_symbols_xx_2</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_chunks_to_symbols_xx_2</source_block_id> - <sink_block_id>gr_multiply_const_vxx_2</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>gr_multiply_const_vxx_2</source_block_id> <sink_block_id>gr_sub_xx_2</sink_block_id> <source_key>0</source_key> @@ -2085,18 +2085,6 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>trellis_encoder_xx_2_0</source_block_id> - <sink_block_id>gr_chunks_to_symbols_xx_2_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> - <source_block_id>gr_chunks_to_symbols_xx_2_0</source_block_id> - <sink_block_id>gr_multiply_const_vxx_2_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>trellis_viterbi_combined_xx_2</source_block_id> <sink_block_id>trellis_encoder_xx_2_0</sink_block_id> <source_key>0</source_key> @@ -2169,8 +2157,56 @@ <sink_key>0</sink_key> </connection> <connection> + <source_block_id>analog_noise_source_x_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> <source_block_id>gr_throttle_0</source_block_id> - <sink_block_id>gr_chunks_to_symbols_xx_0</sink_block_id> + <sink_block_id>digital_chunks_to_symbols_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_chunks_to_symbols_xx_0</source_block_id> + <sink_block_id>gr_multiply_const_vxx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_chunks_to_symbols_xx_0_0</source_block_id> + <sink_block_id>gr_multiply_const_vxx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_encoder_xx_1</source_block_id> + <sink_block_id>digital_chunks_to_symbols_xx_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_encoder_xx_2</source_block_id> + <sink_block_id>digital_chunks_to_symbols_xx_0_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_chunks_to_symbols_xx_0_0_0</source_block_id> + <sink_block_id>gr_multiply_const_vxx_2</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>trellis_encoder_xx_2_0</source_block_id> + <sink_block_id>digital_chunks_to_symbols_xx_0_0_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_chunks_to_symbols_xx_0_0_1</source_block_id> + <sink_block_id>gr_multiply_const_vxx_2_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/gr-trellis/src/examples/grc/pccc.grc b/gr-trellis/src/examples/grc/pccc.grc index c3111c3211..06fa9cd69f 100644 --- a/gr-trellis/src/examples/grc/pccc.grc +++ b/gr-trellis/src/examples/grc/pccc.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Thu Sep 1 12:53:13 2011</timestamp> + <timestamp>Sat Nov 10 15:37:00 2012</timestamp> <block> <key>options</key> <param> @@ -44,6 +44,10 @@ <value>True</value> </param> <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> <key>realtime_scheduling</key> <value></value> </param> @@ -222,6 +226,14 @@ <value>True</value> </param> <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> <key>_coordinate</key> <value>(535, 609)</value> </param> @@ -318,41 +330,6 @@ </param> </block> <block> - <key>gr_noise_source_x</key> - <param> - <key>id</key> - <value>gr_noise_source_x_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>noise_type</key> - <value>gr.GR_GAUSSIAN</value> - </param> - <param> - <key>amp</key> - <value>noisevar</value> - </param> - <param> - <key>seed</key> - <value>42</value> - </param> - <param> - <key>_coordinate</key> - <value>(672, 290)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>wxgui_scopesink2</key> <param> <key>id</key> @@ -467,10 +444,10 @@ </param> </block> <block> - <key>gr_throttle</key> + <key>trellis_pccc_encoder_xx</key> <param> <key>id</key> - <value>gr_throttle_0</value> + <value>trellis_pccc_encoder_xx_0</value> </param> <param> <key>_enabled</key> @@ -478,58 +455,58 @@ </param> <param> <key>type</key> - <value>short</value> + <value>ss</value> </param> <param> - <key>samples_per_second</key> - <value>R</value> + <key>o_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>o_init_state</key> + <value>0</value> </param> <param> - <key>_coordinate</key> - <value>(517, 103)</value> + <key>i_fsm_args</key> + <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> </param> <param> - <key>_rotation</key> + <key>i_init_state</key> <value>0</value> </param> - </block> - <block> - <key>gr_chunks_to_symbols_xx</key> <param> - <key>id</key> - <value>gr_chunks_to_symbols_xx_0</value> + <key>interleaver_args</key> + <value>trellis.interleaver(block,666)</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>bl</key> + <value>block</value> </param> <param> - <key>in_type</key> - <value>short</value> + <key>_coordinate</key> + <value>(236, 147)</value> </param> <param> - <key>out_type</key> - <value>float</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>variable</key> <param> - <key>symbol_table</key> - <value>-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7,0, 0,-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7</value> + <key>id</key> + <value>R</value> </param> <param> - <key>dimension</key> - <value>2</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>num_ports</key> - <value>1</value> + <key>value</key> + <value>100e3</value> </param> <param> <key>_coordinate</key> - <value>(551, 184)</value> + <value>(482, 17)</value> </param> <param> <key>_rotation</key> @@ -537,10 +514,10 @@ </param> </block> <block> - <key>trellis_pccc_encoder_xx</key> + <key>trellis_pccc_decoder_combined_xx</key> <param> <key>id</key> - <value>trellis_pccc_encoder_xx_0</value> + <value>trellis_pccc_decoder_combined_xx_0</value> </param> <param> <key>_enabled</key> @@ -548,7 +525,11 @@ </param> <param> <key>type</key> - <value>ss</value> + <value>f</value> + </param> + <param> + <key>out_type</key> + <value>s</value> </param> <param> <key>o_fsm_args</key> @@ -559,6 +540,10 @@ <value>0</value> </param> <param> + <key>o_final_state</key> + <value>-1</value> + </param> + <param> <key>i_fsm_args</key> <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> </param> @@ -567,16 +552,44 @@ <value>0</value> </param> <param> - <key>interleaver_args</key> + <key>i_final_state</key> + <value>-1</value> + </param> + <param> + <key>interleaver</key> <value>trellis.interleaver(block,666)</value> </param> <param> - <key>bl</key> + <key>block_size</key> <value>block</value> </param> <param> + <key>iterations</key> + <value>10</value> + </param> + <param> + <key>dim</key> + <value>2</value> + </param> + <param> + <key>table</key> + <value>-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7,0, 0,-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7</value> + </param> + <param> + <key>metric_type</key> + <value>digital.TRELLIS_EUCLIDEAN</value> + </param> + <param> + <key>siso_type</key> + <value>trellis.TRELLIS_MIN_SUM</value> + </param> + <param> + <key>scaling</key> + <value>1.0</value> + </param> + <param> <key>_coordinate</key> - <value>(236, 147)</value> + <value>(196, 274)</value> </param> <param> <key>_rotation</key> @@ -584,22 +597,30 @@ </param> </block> <block> - <key>variable</key> + <key>gr_sub_xx</key> <param> <key>id</key> - <value>R</value> + <value>gr_sub_xx_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>value</key> - <value>100e3</value> + <key>type</key> + <value>short</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> </param> <param> <key>_coordinate</key> - <value>(482, 17)</value> + <value>(217, 597)</value> </param> <param> <key>_rotation</key> @@ -607,10 +628,10 @@ </param> </block> <block> - <key>gr_add_xx</key> + <key>analog_noise_source_x</key> <param> <key>id</key> - <value>gr_add_xx_1</value> + <value>analog_noise_source_x_0</value> </param> <param> <key>_enabled</key> @@ -621,16 +642,20 @@ <value>float</value> </param> <param> - <key>num_inputs</key> - <value>2</value> + <key>noise_type</key> + <value>analog.GR_GAUSSIAN</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>amp</key> + <value>noisevar</value> + </param> + <param> + <key>seed</key> + <value>-42</value> </param> <param> <key>_coordinate</key> - <value>(951, 256)</value> + <value>(584, 259)</value> </param> <param> <key>_rotation</key> @@ -638,10 +663,10 @@ </param> </block> <block> - <key>trellis_pccc_decoder_combined_xx</key> + <key>gr_throttle</key> <param> <key>id</key> - <value>trellis_pccc_decoder_combined_xx_0</value> + <value>gr_throttle_0</value> </param> <param> <key>_enabled</key> @@ -649,71 +674,58 @@ </param> <param> <key>type</key> - <value>f</value> - </param> - <param> - <key>out_type</key> - <value>s</value> - </param> - <param> - <key>o_fsm_args</key> - <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + <value>short</value> </param> <param> - <key>o_init_state</key> - <value>0</value> + <key>samples_per_second</key> + <value>R</value> </param> <param> - <key>o_final_state</key> - <value>-1</value> + <key>vlen</key> + <value>1</value> </param> <param> - <key>i_fsm_args</key> - <value>prefix+"gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm"</value> + <key>_coordinate</key> + <value>(517, 103)</value> </param> <param> - <key>i_init_state</key> + <key>_rotation</key> <value>0</value> </param> + </block> + <block> + <key>digital_chunks_to_symbols_xx</key> <param> - <key>i_final_state</key> - <value>-1</value> - </param> - <param> - <key>interleaver</key> - <value>trellis.interleaver(block,666)</value> - </param> - <param> - <key>block_size</key> - <value>block</value> + <key>id</key> + <value>digital_chunks_to_symbols_xx_0</value> </param> <param> - <key>iterations</key> - <value>10</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>dim</key> - <value>2</value> + <key>in_type</key> + <value>short</value> </param> <param> - <key>table</key> - <value>-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7,0, 0,-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7</value> + <key>out_type</key> + <value>float</value> </param> <param> - <key>metric_type</key> - <value>trellis.TRELLIS_EUCLIDEAN</value> + <key>symbol_table</key> + <value>-7,0,-5,0,-3,0,-1,0,1,0,3,0,5,0,7,0,-7,0,-5,0,-3,0,-1,0,1,0,3,0,5,0,7</value> </param> <param> - <key>siso_type</key> - <value>trellis.TRELLIS_MIN_SUM</value> + <key>dimension</key> + <value>2</value> </param> <param> - <key>scaling</key> - <value>1.0</value> + <key>num_ports</key> + <value>1</value> </param> <param> <key>_coordinate</key> - <value>(196, 274)</value> + <value>(559, 180)</value> </param> <param> <key>_rotation</key> @@ -721,10 +733,10 @@ </param> </block> <block> - <key>gr_sub_xx</key> + <key>gr_add_xx</key> <param> <key>id</key> - <value>gr_sub_xx_0</value> + <value>gr_add_xx_1</value> </param> <param> <key>_enabled</key> @@ -732,19 +744,19 @@ </param> <param> <key>type</key> - <value>short</value> - </param> - <param> - <key>vlen</key> - <value>1</value> + <value>float</value> </param> <param> <key>num_inputs</key> <value>2</value> </param> <param> + <key>vlen</key> + <value>1</value> + </param> + <param> <key>_coordinate</key> - <value>(217, 597)</value> + <value>(951, 256)</value> </param> <param> <key>_rotation</key> @@ -758,30 +770,12 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_throttle_0</source_block_id> - <sink_block_id>gr_chunks_to_symbols_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>gr_add_xx_1</source_block_id> <sink_block_id>wxgui_scopesink2_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_noise_source_x_0</source_block_id> - <sink_block_id>gr_add_xx_1</sink_block_id> - <source_key>0</source_key> - <sink_key>1</sink_key> - </connection> - <connection> - <source_block_id>gr_chunks_to_symbols_xx_0</source_block_id> - <sink_block_id>gr_add_xx_1</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>gr_multiply_xx_2_0</source_block_id> <sink_block_id>gr_short_to_float_1_0</sink_block_id> <source_key>0</source_key> @@ -829,4 +823,22 @@ <source_key>0</source_key> <sink_key>1</sink_key> </connection> + <connection> + <source_block_id>analog_noise_source_x_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>gr_throttle_0</source_block_id> + <sink_block_id>digital_chunks_to_symbols_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_chunks_to_symbols_xx_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> </flow_graph> diff --git a/gr-trellis/src/examples/grc/pccc1.grc b/gr-trellis/src/examples/grc/pccc1.grc index 15a63707ee..c111ebd3ec 100644 --- a/gr-trellis/src/examples/grc/pccc1.grc +++ b/gr-trellis/src/examples/grc/pccc1.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Wed Aug 31 20:34:39 2011</timestamp> + <timestamp>Sat Nov 10 15:36:08 2012</timestamp> <block> <key>options</key> <param> @@ -44,6 +44,10 @@ <value>True</value> </param> <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> <key>realtime_scheduling</key> <value></value> </param> @@ -222,6 +226,14 @@ <value>True</value> </param> <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> <key>_coordinate</key> <value>(535, 609)</value> </param> @@ -318,72 +330,6 @@ </param> </block> <block> - <key>gr_noise_source_x</key> - <param> - <key>id</key> - <value>gr_noise_source_x_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>noise_type</key> - <value>gr.GR_GAUSSIAN</value> - </param> - <param> - <key>amp</key> - <value>noisevar</value> - </param> - <param> - <key>seed</key> - <value>42</value> - </param> - <param> - <key>_coordinate</key> - <value>(672, 290)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_add_xx</key> - <param> - <key>id</key> - <value>gr_add_xx_1</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>num_inputs</key> - <value>2</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(951, 256)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>wxgui_scopesink2</key> <param> <key>id</key> @@ -498,37 +444,6 @@ </param> </block> <block> - <key>gr_throttle</key> - <param> - <key>id</key> - <value>gr_throttle_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>short</value> - </param> - <param> - <key>samples_per_second</key> - <value>R</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(517, 103)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>gr_sub_xx</key> <param> <key>id</key> @@ -560,45 +475,6 @@ </param> </block> <block> - <key>gr_chunks_to_symbols_xx</key> - <param> - <key>id</key> - <value>gr_chunks_to_symbols_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>in_type</key> - <value>short</value> - </param> - <param> - <key>out_type</key> - <value>float</value> - </param> - <param> - <key>symbol_table</key> - <value>-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7,0, 0,-7,0, -5,0, -3,0, -1,0, 1,0, 3,0, 5,0, 7</value> - </param> - <param> - <key>dimension</key> - <value>2</value> - </param> - <param> - <key>num_ports</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(551, 184)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>trellis_pccc_encoder_xx</key> <param> <key>id</key> @@ -736,7 +612,7 @@ </param> <param> <key>metric_type</key> - <value>trellis.TRELLIS_EUCLIDEAN</value> + <value>digital.TRELLIS_EUCLIDEAN</value> </param> <param> <key>_coordinate</key> @@ -770,6 +646,142 @@ <value>0</value> </param> </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>samples_per_second</key> + <value>R</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(517, 103)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_add_xx</key> + <param> + <key>id</key> + <value>gr_add_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(951, 256)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>digital_chunks_to_symbols_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>float</value> + </param> + <param> + <key>symbol_table</key> + <value>-7,0,-5,0,-3,0,-1,0,1,0,3,0,5,0,7,0,-7,0,-5,0,-3,0,-1,0,1,0,3,0,5,0,7</value> + </param> + <param> + <key>dimension</key> + <value>2</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(552, 178)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_noise_source_x</key> + <param> + <key>id</key> + <value>analog_noise_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>noise_type</key> + <value>analog.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noisevar</value> + </param> + <param> + <key>seed</key> + <value>-42</value> + </param> + <param> + <key>_coordinate</key> + <value>(622, 257)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> <connection> <source_block_id>random_source_x_0</source_block_id> <sink_block_id>gr_sub_xx_0</sink_block_id> @@ -777,30 +789,12 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_throttle_0</source_block_id> - <sink_block_id>gr_chunks_to_symbols_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>gr_add_xx_1</source_block_id> <sink_block_id>wxgui_scopesink2_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_noise_source_x_0</source_block_id> - <sink_block_id>gr_add_xx_1</sink_block_id> - <source_key>0</source_key> - <sink_key>1</sink_key> - </connection> - <connection> - <source_block_id>gr_chunks_to_symbols_xx_0</source_block_id> - <sink_block_id>gr_add_xx_1</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>gr_multiply_xx_2_0</source_block_id> <sink_block_id>gr_short_to_float_1_0</sink_block_id> <source_key>0</source_key> @@ -854,4 +848,22 @@ <source_key>0</source_key> <sink_key>1</sink_key> </connection> + <connection> + <source_block_id>gr_throttle_0</source_block_id> + <sink_block_id>digital_chunks_to_symbols_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_chunks_to_symbols_xx_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_noise_source_x_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> </flow_graph> diff --git a/gr-trellis/src/examples/grc/sccc.grc b/gr-trellis/src/examples/grc/sccc.grc index e8f656f637..36657f5441 100644 --- a/gr-trellis/src/examples/grc/sccc.grc +++ b/gr-trellis/src/examples/grc/sccc.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Wed Aug 31 19:57:09 2011</timestamp> + <timestamp>Sat Nov 10 15:34:26 2012</timestamp> <block> <key>options</key> <param> @@ -44,6 +44,10 @@ <value>True</value> </param> <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> <key>realtime_scheduling</key> <value></value> </param> @@ -165,37 +169,6 @@ </param> </block> <block> - <key>gr_add_xx</key> - <param> - <key>id</key> - <value>gr_add_xx_1</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>num_inputs</key> - <value>2</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(951, 256)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>gr_sub_xx</key> <param> <key>id</key> @@ -268,6 +241,14 @@ <value>True</value> </param> <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> <key>_coordinate</key> <value>(416, 815)</value> </param> @@ -430,111 +411,6 @@ </param> </block> <block> - <key>gr_throttle</key> - <param> - <key>id</key> - <value>gr_throttle_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>short</value> - </param> - <param> - <key>samples_per_second</key> - <value>R</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(514, 105)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_chunks_to_symbols_xx</key> - <param> - <key>id</key> - <value>gr_chunks_to_symbols_xx_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>in_type</key> - <value>short</value> - </param> - <param> - <key>out_type</key> - <value>complex</value> - </param> - <param> - <key>symbol_table</key> - <value>1,0,1j,0,-1j,0,-1,0, 0,1,0,1j,0,-1j,0,-1</value> - </param> - <param> - <key>dimension</key> - <value>2</value> - </param> - <param> - <key>num_ports</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(551, 184)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_noise_source_x</key> - <param> - <key>id</key> - <value>gr_noise_source_x_0</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>noise_type</key> - <value>gr.GR_GAUSSIAN</value> - </param> - <param> - <key>amp</key> - <value>noisevar</value> - </param> - <param> - <key>seed</key> - <value>42</value> - </param> - <param> - <key>_coordinate</key> - <value>(672, 290)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>trellis_sccc_encoder_xx</key> <param> <key>id</key> @@ -732,7 +608,7 @@ </param> <param> <key>metric_type</key> - <value>trellis.TRELLIS_EUCLIDEAN</value> + <value>digital.TRELLIS_EUCLIDEAN</value> </param> <param> <key>siso_type</key> @@ -751,6 +627,142 @@ <value>0</value> </param> </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>short</value> + </param> + <param> + <key>samples_per_second</key> + <value>R</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(514, 105)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>gr_add_xx</key> + <param> + <key>id</key> + <value>gr_add_xx_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>num_inputs</key> + <value>2</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(951, 256)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_chunks_to_symbols_xx</key> + <param> + <key>id</key> + <value>digital_chunks_to_symbols_xx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>in_type</key> + <value>short</value> + </param> + <param> + <key>out_type</key> + <value>complex</value> + </param> + <param> + <key>symbol_table</key> + <value>1,0,1j,0,-1j,0,-1,0,0,1,0,1j,0,-1j,0,01</value> + </param> + <param> + <key>dimension</key> + <value>2</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(551, 181)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_noise_source_x</key> + <param> + <key>id</key> + <value>analog_noise_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>noise_type</key> + <value>analog.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noisevar</value> + </param> + <param> + <key>seed</key> + <value>-42</value> + </param> + <param> + <key>_coordinate</key> + <value>(651, 270)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> <connection> <source_block_id>random_source_x_0</source_block_id> <sink_block_id>gr_sub_xx_0</sink_block_id> @@ -758,30 +770,12 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_throttle_0</source_block_id> - <sink_block_id>gr_chunks_to_symbols_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>gr_add_xx_1</source_block_id> <sink_block_id>wxgui_scopesink2_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_noise_source_x_0</source_block_id> - <sink_block_id>gr_add_xx_1</sink_block_id> - <source_key>0</source_key> - <sink_key>1</sink_key> - </connection> - <connection> - <source_block_id>gr_chunks_to_symbols_xx_0</source_block_id> - <sink_block_id>gr_add_xx_1</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>random_source_x_0</source_block_id> <sink_block_id>trellis_sccc_encoder_xx_0</sink_block_id> <source_key>0</source_key> @@ -829,4 +823,22 @@ <source_key>0</source_key> <sink_key>1</sink_key> </connection> + <connection> + <source_block_id>gr_throttle_0</source_block_id> + <sink_block_id>digital_chunks_to_symbols_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_noise_source_x_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>digital_chunks_to_symbols_xx_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> </flow_graph> diff --git a/gr-trellis/src/examples/grc/sccc1.grc b/gr-trellis/src/examples/grc/sccc1.grc index 0be59d0c47..17626e3dce 100644 --- a/gr-trellis/src/examples/grc/sccc1.grc +++ b/gr-trellis/src/examples/grc/sccc1.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Wed Aug 31 20:09:23 2011</timestamp> + <timestamp>Sat Nov 10 15:41:10 2012</timestamp> <block> <key>options</key> <param> @@ -44,6 +44,10 @@ <value>True</value> </param> <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> <key>realtime_scheduling</key> <value></value> </param> @@ -425,6 +429,14 @@ <value>True</value> </param> <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> <key>_coordinate</key> <value>(535, 609)</value> </param> @@ -521,10 +533,10 @@ </param> </block> <block> - <key>gr_noise_source_x</key> + <key>trellis_metrics_x</key> <param> <key>id</key> - <value>gr_noise_source_x_0</value> + <value>trellis_metrics_x_0</value> </param> <param> <key>_enabled</key> @@ -532,23 +544,27 @@ </param> <param> <key>type</key> - <value>float</value> + <value>f</value> </param> <param> - <key>noise_type</key> - <value>gr.GR_GAUSSIAN</value> + <key>card</key> + <value>8</value> </param> <param> - <key>amp</key> - <value>noisevar</value> + <key>dim</key> + <value>1</value> </param> <param> - <key>seed</key> - <value>42</value> + <key>table</key> + <value>-7, -5, -3, -1, 1, 3, 5, 7</value> + </param> + <param> + <key>metric_type</key> + <value>digital.TRELLIS_EUCLIDEAN</value> </param> <param> <key>_coordinate</key> - <value>(672, 290)</value> + <value>(58, 354)</value> </param> <param> <key>_rotation</key> @@ -556,69 +572,74 @@ </param> </block> <block> - <key>gr_add_xx</key> + <key>wxgui_scopesink2</key> <param> <key>id</key> - <value>gr_add_xx_1</value> + <value>wxgui_scopesink2_0</value> </param> <param> <key>_enabled</key> - <value>True</value> + <value>False</value> </param> <param> <key>type</key> <value>float</value> </param> <param> - <key>num_inputs</key> - <value>2</value> + <key>title</key> + <value>Scope Plot</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>samp_rate</key> + <value>R</value> </param> <param> - <key>_coordinate</key> - <value>(951, 256)</value> + <key>v_scale</key> + <value>0</value> </param> <param> - <key>_rotation</key> + <key>v_offset</key> <value>0</value> </param> - </block> - <block> - <key>trellis_metrics_x</key> <param> - <key>id</key> - <value>trellis_metrics_x_0</value> + <key>t_scale</key> + <value>0</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>ac_couple</key> + <value>False</value> </param> <param> - <key>type</key> - <value>f</value> + <key>xy_mode</key> + <value>False</value> </param> <param> - <key>card</key> - <value>8</value> + <key>num_inputs</key> + <value>1</value> </param> <param> - <key>dim</key> - <value>1</value> + <key>win_size</key> + <value></value> </param> <param> - <key>table</key> - <value>-7, -5, -3, -1, 1, 3, 5, 7</value> + <key>grid_pos</key> + <value></value> </param> <param> - <key>metric_type</key> - <value>trellis.TRELLIS_EUCLIDEAN</value> + <key>notebook</key> + <value></value> + </param> + <param> + <key>trig_mode</key> + <value>gr.gr_TRIG_MODE_AUTO</value> + </param> + <param> + <key>y_axis_label</key> + <value>Counts</value> </param> <param> <key>_coordinate</key> - <value>(58, 354)</value> + <value>(952, 73)</value> </param> <param> <key>_rotation</key> @@ -657,74 +678,69 @@ </param> </block> <block> - <key>wxgui_scopesink2</key> + <key>digital_chunks_to_symbols_xx</key> <param> <key>id</key> - <value>wxgui_scopesink2_0</value> + <value>digital_chunks_to_symbols_xx_0</value> </param> <param> <key>_enabled</key> - <value>False</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>title</key> - <value>Scope Plot</value> + <value>True</value> </param> <param> - <key>samp_rate</key> - <value>R</value> + <key>in_type</key> + <value>short</value> </param> <param> - <key>v_scale</key> - <value>0</value> + <key>out_type</key> + <value>float</value> </param> <param> - <key>v_offset</key> - <value>0</value> + <key>symbol_table</key> + <value>-7,-5,-3,-1,1,3,5,7</value> </param> <param> - <key>t_scale</key> - <value>0</value> + <key>dimension</key> + <value>1</value> </param> <param> - <key>ac_couple</key> - <value>False</value> + <key>num_ports</key> + <value>1</value> </param> <param> - <key>xy_mode</key> - <value>False</value> + <key>_coordinate</key> + <value>(607, 175)</value> </param> <param> - <key>num_inputs</key> - <value>1</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>gr_add_xx</key> <param> - <key>win_size</key> - <value></value> + <key>id</key> + <value>gr_add_xx_1</value> </param> <param> - <key>grid_pos</key> - <value></value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>notebook</key> - <value></value> + <key>type</key> + <value>float</value> </param> <param> - <key>trig_mode</key> - <value>gr.gr_TRIG_MODE_AUTO</value> + <key>num_inputs</key> + <value>2</value> </param> <param> - <key>y_axis_label</key> - <value>Counts</value> + <key>vlen</key> + <value>1</value> </param> <param> <key>_coordinate</key> - <value>(952, 73)</value> + <value>(951, 256)</value> </param> <param> <key>_rotation</key> @@ -732,38 +748,34 @@ </param> </block> <block> - <key>gr_chunks_to_symbols_xx</key> + <key>analog_noise_source_x</key> <param> <key>id</key> - <value>gr_chunks_to_symbols_xx_0</value> + <value>analog_noise_source_x_0</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>in_type</key> - <value>short</value> - </param> - <param> - <key>out_type</key> + <key>type</key> <value>float</value> </param> <param> - <key>symbol_table</key> - <value>-7, -5, -3, -1, 1, 3, 5, 7</value> + <key>noise_type</key> + <value>analog.GR_GAUSSIAN</value> </param> <param> - <key>dimension</key> - <value>1</value> + <key>amp</key> + <value>noisevar</value> </param> <param> - <key>num_ports</key> - <value>1</value> + <key>seed</key> + <value>-42</value> </param> <param> <key>_coordinate</key> - <value>(551, 184)</value> + <value>(632, 254)</value> </param> <param> <key>_rotation</key> @@ -777,30 +789,12 @@ <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_throttle_0</source_block_id> - <sink_block_id>gr_chunks_to_symbols_xx_0</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>gr_add_xx_1</source_block_id> <sink_block_id>wxgui_scopesink2_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_noise_source_x_0</source_block_id> - <sink_block_id>gr_add_xx_1</sink_block_id> - <source_key>0</source_key> - <sink_key>1</sink_key> - </connection> - <connection> - <source_block_id>gr_chunks_to_symbols_xx_0</source_block_id> - <sink_block_id>gr_add_xx_1</sink_block_id> - <source_key>0</source_key> - <sink_key>0</sink_key> - </connection> - <connection> <source_block_id>random_source_x_0</source_block_id> <sink_block_id>trellis_sccc_encoder_xx_0</sink_block_id> <source_key>0</source_key> @@ -854,4 +848,22 @@ <source_key>0</source_key> <sink_key>1</sink_key> </connection> + <connection> + <source_block_id>gr_throttle_0</source_block_id> + <sink_block_id>digital_chunks_to_symbols_xx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_chunks_to_symbols_xx_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_noise_source_x_0</source_block_id> + <sink_block_id>gr_add_xx_1</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> </flow_graph> diff --git a/gr-trellis/src/examples/python/test_cpm.py b/gr-trellis/src/examples/python/test_cpm.py index 7e80d400be..6b9b9a4f52 100755 --- a/gr-trellis/src/examples/python/test_cpm.py +++ b/gr-trellis/src/examples/python/test_cpm.py @@ -9,7 +9,6 @@ from gnuradio import gr from gnuradio import trellis, digital, filter -from gnuradio.gr import firdes from grc_gnuradio import blks2 as grc_blks2 import math import numpy @@ -17,6 +16,12 @@ import fsm_utils from gnuradio import trellis try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + +try: import scipy.stats except ImportError: print "Error: Program requires scipy (see: www.scipy.org)." @@ -91,13 +96,13 @@ def run_test(seed,blocksize): random_source_x_0 = gr.vector_source_b(data.tolist(), False) digital_chunks_to_symbols_xx_0 = digital.chunks_to_symbols_bf((-1, 1), 1) gr_interp_fir_filter_xxx_0 = filter.interp_fir_filter_fff(Q, p) - gr_frequency_modulator_fc_0 = gr.frequency_modulator_fc(2*math.pi*h*(1.0/Q)) + gr_frequency_modulator_fc_0 = analog.frequency_modulator_fc(2*math.pi*h*(1.0/Q)) gr_add_vxx_0 = gr.add_vcc(1) - gr_noise_source_x_0 = gr.noise_source_c(gr.GR_GAUSSIAN, (N0/2.0)**0.5, -long(seed)) + gr_noise_source_x_0 = analog.noise_source_c(analog.GR_GAUSSIAN, (N0/2.0)**0.5, -long(seed)) gr_multiply_vxx_0 = gr.multiply_vcc(1) - gr_sig_source_x_0 = gr.sig_source_c(Q, gr.GR_COS_WAVE, -f0T, 1, 0) + gr_sig_source_x_0 = analog.sig_source_c(Q, analog.GR_COS_WAVE, -f0T, 1, 0) # only works for N=2, do it manually for N>2... gr_fir_filter_xxx_0_0 = filter.fir_filter_ccc(Q, MF[0].conjugate()) gr_fir_filter_xxx_0_0_0 = filter.fir_filter_ccc(Q, MF[1].conjugate()) diff --git a/gr-trellis/src/examples/python/test_pccc_turbo1.py b/gr-trellis/src/examples/python/test_pccc_turbo1.py index abc0e1d01f..bbcce106fb 100755 --- a/gr-trellis/src/examples/python/test_pccc_turbo1.py +++ b/gr-trellis/src/examples/python/test_pccc_turbo1.py @@ -8,6 +8,11 @@ import sys import random import fsm_utils +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,Es,N0,IT,seed): tb = gr.top_block () @@ -24,7 +29,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # CHANNEL add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX metrics_in = trellis.metrics_f(fi.O()*fo.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner SISO diff --git a/gr-trellis/src/examples/python/test_sccc_hard.py b/gr-trellis/src/examples/python/test_sccc_hard.py index 397ebf0871..b75a07b8b0 100755 --- a/gr-trellis/src/examples/python/test_sccc_hard.py +++ b/gr-trellis/src/examples/python/test_sccc_hard.py @@ -8,6 +8,12 @@ import sys import random import fsm_utils +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): tb = gr.top_block () @@ -23,7 +29,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # CHANNEL add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX metrics_in = trellis.metrics_f(fi.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner Viterbi diff --git a/gr-trellis/src/examples/python/test_sccc_soft.py b/gr-trellis/src/examples/python/test_sccc_soft.py index b1ffaae748..0b10c07bbc 100755 --- a/gr-trellis/src/examples/python/test_sccc_soft.py +++ b/gr-trellis/src/examples/python/test_sccc_soft.py @@ -8,8 +8,11 @@ import sys import random import fsm_utils - - +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): tb = gr.top_block () @@ -26,7 +29,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # CHANNEL add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX metrics_in = trellis.metrics_f(fi.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner Viterbi diff --git a/gr-trellis/src/examples/python/test_sccc_turbo.py b/gr-trellis/src/examples/python/test_sccc_turbo.py index e8054a08b2..979dfeca59 100755 --- a/gr-trellis/src/examples/python/test_sccc_turbo.py +++ b/gr-trellis/src/examples/python/test_sccc_turbo.py @@ -8,7 +8,11 @@ import sys import random import fsm_utils - +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) def make_rx(tb,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,type): metrics_in = trellis.metrics_f(fi.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner Viterbi @@ -65,7 +69,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # CHANNEL add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX (head,tail) = make_rx(tb,fo,fi,dimensionality,constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) diff --git a/gr-trellis/src/examples/python/test_sccc_turbo1.py b/gr-trellis/src/examples/python/test_sccc_turbo1.py index ef5d32f588..60188e4d3b 100755 --- a/gr-trellis/src/examples/python/test_sccc_turbo1.py +++ b/gr-trellis/src/examples/python/test_sccc_turbo1.py @@ -8,6 +8,11 @@ import sys import random import fsm_utils +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,Es,N0,IT,seed): tb = gr.top_block () @@ -21,7 +26,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # CHANNEL add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX dec = trellis.sccc_decoder_combined_fs(fo,0,-1,fi,0,-1,interleaver,K,IT,trellis.TRELLIS_MIN_SUM,dimensionality,constellation,digital.TRELLIS_EUCLIDEAN,1.0) diff --git a/gr-trellis/src/examples/python/test_sccc_turbo2.py b/gr-trellis/src/examples/python/test_sccc_turbo2.py index 942572676d..e9f4841e3e 100755 --- a/gr-trellis/src/examples/python/test_sccc_turbo2.py +++ b/gr-trellis/src/examples/python/test_sccc_turbo2.py @@ -8,6 +8,11 @@ import sys import random import fsm_utils +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,Es,N0,IT,seed): tb = gr.top_block () @@ -21,7 +26,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation, # CHANNEL add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX metrics_in = trellis.metrics_f(fi.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner SISO diff --git a/gr-trellis/src/examples/python/test_tcm.py b/gr-trellis/src/examples/python/test_tcm.py index eff93f5b4e..fced315260 100755 --- a/gr-trellis/src/examples/python/test_tcm.py +++ b/gr-trellis/src/examples/python/test_tcm.py @@ -10,6 +10,12 @@ import fsm_utils from gnuradio.eng_option import eng_option from optparse import OptionParser +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): tb = gr.top_block () @@ -28,7 +34,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): # CHANNEL add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX metrics = trellis.metrics_f(f.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi diff --git a/gr-trellis/src/examples/python/test_tcm_bit.py b/gr-trellis/src/examples/python/test_tcm_bit.py index 1a89d06a89..873d58684b 100755 --- a/gr-trellis/src/examples/python/test_tcm_bit.py +++ b/gr-trellis/src/examples/python/test_tcm_bit.py @@ -10,6 +10,11 @@ import fsm_utils from gnuradio.eng_option import eng_option from optparse import OptionParser +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): tb = gr.top_block () @@ -30,7 +35,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): # CHANNEL add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX diff --git a/gr-trellis/src/examples/python/test_tcm_combined.py b/gr-trellis/src/examples/python/test_tcm_combined.py index a46444e32b..8bea1ac86a 100755 --- a/gr-trellis/src/examples/python/test_tcm_combined.py +++ b/gr-trellis/src/examples/python/test_tcm_combined.py @@ -9,6 +9,11 @@ import fsm_utils from gnuradio.eng_option import eng_option from optparse import OptionParser +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): tb = gr.top_block () @@ -23,7 +28,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed): # CHANNEL add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX diff --git a/gr-trellis/src/examples/python/test_tcm_parallel.py b/gr-trellis/src/examples/python/test_tcm_parallel.py index 72fb8cf3bf..1767cc730f 100755 --- a/gr-trellis/src/examples/python/test_tcm_parallel.py +++ b/gr-trellis/src/examples/python/test_tcm_parallel.py @@ -9,6 +9,11 @@ import fsm_utils from gnuradio.eng_option import eng_option from optparse import OptionParser +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P): tb = gr.top_block () @@ -26,7 +31,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P): noise=[] for i in range(P): add.append(gr.add_ff()) - noise.append(gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed)) + noise.append(analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed)) # RX metrics = trellis.metrics_f(f.O(),dimensionality,constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi diff --git a/gr-trellis/src/examples/python/test_turbo_equalization.py b/gr-trellis/src/examples/python/test_turbo_equalization.py index d97f3f2c29..baddd7cb50 100755 --- a/gr-trellis/src/examples/python/test_turbo_equalization.py +++ b/gr-trellis/src/examples/python/test_turbo_equalization.py @@ -7,6 +7,11 @@ import math import sys import fsm_utils +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) def make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,type): metrics_in = trellis.metrics_f(fi.O(),dimensionality,tot_constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner SISO @@ -63,7 +68,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,tot_constellat # CHANNEL add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX (head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) diff --git a/gr-trellis/src/examples/python/test_turbo_equalization1.py b/gr-trellis/src/examples/python/test_turbo_equalization1.py index e8b946458c..dfe1a2d82e 100755 --- a/gr-trellis/src/examples/python/test_turbo_equalization1.py +++ b/gr-trellis/src/examples/python/test_turbo_equalization1.py @@ -8,6 +8,12 @@ import sys import random import fsm_utils +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + def make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,type): metrics_in = trellis.metrics_f(fi.O(),dimensionality,tot_constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for innner SISO scale = gr.multiply_const_ff(1.0/N0) @@ -66,7 +72,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona # CHANNEL isi = filter.fir_filter_fff(1,channel) add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX (head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) diff --git a/gr-trellis/src/examples/python/test_turbo_equalization2.py b/gr-trellis/src/examples/python/test_turbo_equalization2.py index 6b37ee9b59..fb0a899eba 100755 --- a/gr-trellis/src/examples/python/test_turbo_equalization2.py +++ b/gr-trellis/src/examples/python/test_turbo_equalization2.py @@ -8,6 +8,12 @@ import sys import random import fsm_utils +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + def make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,type): scale = gr.multiply_const_ff(math.sqrt(1.0/N0)) gnd = gr.vector_source_f([0],True); @@ -64,7 +70,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona # CHANNEL isi = filter.fir_filter_fff(1,channel) add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX (head,tail) = make_rx(tb,fo,fi,dimensionality,tot_constellation,K,interleaver,IT,Es,N0,trellis.TRELLIS_MIN_SUM) diff --git a/gr-trellis/src/examples/python/test_viterbi_equalization.py b/gr-trellis/src/examples/python/test_viterbi_equalization.py index 00d54620b2..91dc7e36da 100755 --- a/gr-trellis/src/examples/python/test_viterbi_equalization.py +++ b/gr-trellis/src/examples/python/test_viterbi_equalization.py @@ -7,6 +7,12 @@ import math import sys import fsm_utils +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + def run_test (f,Kb,bitspersymbol,K,dimensionality,tot_constellation,N0,seed): tb = gr.top_block () @@ -20,7 +26,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,tot_constellation,N0,seed): # CHANNEL add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX metrics = trellis.metrics_f(f.O(),dimensionality,tot_constellation,digital.TRELLIS_EUCLIDEAN) # data preprocessing to generate metrics for Viterbi diff --git a/gr-trellis/src/examples/python/test_viterbi_equalization1.py b/gr-trellis/src/examples/python/test_viterbi_equalization1.py index cb000d6852..4421e370a4 100755 --- a/gr-trellis/src/examples/python/test_viterbi_equalization1.py +++ b/gr-trellis/src/examples/python/test_viterbi_equalization1.py @@ -8,6 +8,12 @@ import sys import random import fsm_utils +try: + from gnuradio import analog +except ImportError: + sys.stderr.write("Error: Program requires gr-analog.\n") + sys.exit(1) + def run_test (f,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constellation,N0,seed): tb = gr.top_block () L = len(channel) @@ -27,7 +33,7 @@ def run_test (f,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constel # CHANNEL isi = filter.fir_filter_fff(1,channel) add = gr.add_ff() - noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_f(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX skip = gr.skiphead(gr.sizeof_float, L) # skip the first L samples since you know they are coming from the L zero symbols diff --git a/gr-trellis/src/lib/CMakeLists.txt b/gr-trellis/src/lib/CMakeLists.txt index 315ef3a93c..dfb5d8ef19 100644 --- a/gr-trellis/src/lib/CMakeLists.txt +++ b/gr-trellis/src/lib/CMakeLists.txt @@ -214,7 +214,7 @@ set(GR_SWIG_INCLUDE_DIRS set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/trellis_swig_doc.i) set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -set(GR_SWIG_LIBRARIES gnuradio-trellis) +set(GR_SWIG_LIBRARIES gnuradio-trellis gnuradio-digital gnuradio-analog) GR_SWIG_MAKE(trellis trellis.i) GR_SWIG_INSTALL( diff --git a/gr-trellis/src/python/CMakeLists.txt b/gr-trellis/src/python/CMakeLists.txt index d75a242c82..5b5a35bcfc 100644 --- a/gr-trellis/src/python/CMakeLists.txt +++ b/gr-trellis/src/python/CMakeLists.txt @@ -30,9 +30,11 @@ foreach(py_qa_test_file ${py_qa_test_files}) ${CMAKE_BINARY_DIR}/gnuradio-core/src/python ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig ${CMAKE_BINARY_DIR}/gr-digital/swig + ${CMAKE_BINARY_DIR}/gr-analog/swig ${CMAKE_BINARY_DIR}/gr-trellis/src/lib ) - set(GR_TEST_TARGET_DEPS volk gruel gnuradio-core gnuradio-digital gnuradio-trellis) + set(GR_TEST_TARGET_DEPS volk gruel gnuradio-core + gnuradio-digital gnuradio-analog gnuradio-trellis) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) endforeach(py_qa_test_file) endif(ENABLE_TESTING) diff --git a/gr-trellis/src/python/qa_trellis.py b/gr-trellis/src/python/qa_trellis.py index c6ba40d11f..53dcf0d8f6 100755 --- a/gr-trellis/src/python/qa_trellis.py +++ b/gr-trellis/src/python/qa_trellis.py @@ -30,6 +30,7 @@ import trellis import os import digital_swig as digital +import analog_swig as analog fsm_args = {"awgn1o2_4": (2, 4, 4, (0, 2, 0, 2, 1, 3, 1, 3), @@ -118,7 +119,7 @@ class trellis_tb(gr.top_block): # CHANNEL add = gr.add_cc() - noise = gr.noise_source_c(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed) + noise = analog.noise_source_c(analog.GR_GAUSSIAN,math.sqrt(N0/2),seed) # RX # data preprocessing to generate metrics for Viterbi diff --git a/gr-uhd/CMakeLists.txt b/gr-uhd/CMakeLists.txt index 8d5c3a8849..23fef3a485 100644 --- a/gr-uhd/CMakeLists.txt +++ b/gr-uhd/CMakeLists.txt @@ -32,6 +32,8 @@ GR_REGISTER_COMPONENT("gr-uhd" ENABLE_GR_UHD Boost_FOUND UHD_FOUND ENABLE_GR_CORE + ENABLE_GR_FILTER + ENABLE_GR_ANALOG ) GR_SET_GLOBAL(GR_UHD_INCLUDE_DIRS diff --git a/gr-uhd/apps/hf_explorer/hfx.py b/gr-uhd/apps/hf_explorer/hfx.py index 1f08bd8ba6..8033273d06 100755 --- a/gr-uhd/apps/hf_explorer/hfx.py +++ b/gr-uhd/apps/hf_explorer/hfx.py @@ -81,6 +81,8 @@ import os, wx, sys, math import wx.lib.evtmgr as em from gnuradio.wxgui import powermate, fftsink2 from gnuradio import gr, audio, eng_notation +from gnuradio import analog +from gnuradio import filter from gnuradio.eng_option import eng_option from gnuradio import uhd from optparse import OptionParser @@ -272,23 +274,23 @@ class MyFrame(wx.Frame): self.tb.connect (self.src, radio_file) # 2nd DDC - xlate_taps = gr.firdes.low_pass ( \ - 1.0, input_rate, 16e3, 4e3, gr.firdes.WIN_HAMMING ) - self.xlate = gr.freq_xlating_fir_filter_ccf ( \ + xlate_taps = filter.firdes.low_pass ( \ + 1.0, input_rate, 16e3, 4e3, filter.firdes.WIN_HAMMING ) + self.xlate = filter.freq_xlating_fir_filter_ccf ( \ fir_decim, xlate_taps, self.tune_offset, input_rate ) # Complex Audio filter - audio_coeffs = gr.firdes.complex_band_pass ( + audio_coeffs = filter.firdes.complex_band_pass ( 1.0, # gain self.af_sample_rate, # sample rate -3000, # low cutoff 0, # high cutoff 100, # transition - gr.firdes.WIN_HAMMING) # window + filter.firdes.WIN_HAMMING) # window self.slider_fcutoff_hi.SetValue(0) self.slider_fcutoff_lo.SetValue(-3000) - self.audio_filter = gr.fir_filter_ccc(1, audio_coeffs) + self.audio_filter = filter.fir_filter_ccc(1, audio_coeffs) # Main +/- 16Khz spectrum display self.fft = fftsink2.fft_sink_c(self.panel_2, fft_size=512, @@ -307,10 +309,10 @@ class MyFrame(wx.Frame): # AM branch self.sel_am = gr.multiply_const_cc(0) # the following frequencies turn out to be in radians/sample - # gr.pll_refout_cc(alpha,beta,min_freq,max_freq) + # analog.pll_refout_cc(alpha,beta,min_freq,max_freq) # suggested alpha = X, beta = .25 * X * X - pll = gr.pll_refout_cc(.5,.0625,(2.*math.pi*7.5e3/self.af_sample_rate), - (2.*math.pi*6.5e3/self.af_sample_rate)) + pll = analog.pll_refout_cc(.5,.0625,(2.*math.pi*7.5e3/self.af_sample_rate), + (2.*math.pi*6.5e3/self.af_sample_rate)) self.pll_carrier_scale = gr.multiply_const_cc(complex(10,0)) am_det = gr.multiply_cc() # these are for converting +7.5kHz to -7.5kHz @@ -322,15 +324,15 @@ class MyFrame(wx.Frame): phaser2 = gr.multiply_const_ff(-1) # filter for pll generated carrier - pll_carrier_coeffs = gr.firdes.complex_band_pass ( + pll_carrier_coeffs = filter.firdes.complex_band_pass ( 2.0, # gain self.af_sample_rate, # sample rate 7400, # low cutoff 7600, # high cutoff 100, # transition - gr.firdes.WIN_HAMMING) # window + filter.firdes.WIN_HAMMING) # window - self.pll_carrier_filter = gr.fir_filter_ccc (1, pll_carrier_coeffs) + self.pll_carrier_filter = filter.fir_filter_ccc (1, pll_carrier_coeffs) self.sel_sb = gr.multiply_const_ff(1) combine = gr.add_ff() @@ -610,13 +612,13 @@ class MyFrame(wx.Frame): # Calculate taps and apply def filter(self): - audio_coeffs = gr.firdes.complex_band_pass ( + audio_coeffs = filter.firdes.complex_band_pass ( 1.0, # gain self.af_sample_rate, # sample rate self.slider_fcutoff_lo.GetValue(), # low cutoff self.slider_fcutoff_hi.GetValue(), # high cutoff 100, # transition - gr.firdes.WIN_HAMMING) # window + filter.firdes.WIN_HAMMING) # window self.audio_filter.set_taps(audio_coeffs) def set_lsb(self, event): diff --git a/gr-uhd/apps/uhd_rx_nogui b/gr-uhd/apps/uhd_rx_nogui index 9977f55a3c..c348ba23f5 100755 --- a/gr-uhd/apps/uhd_rx_nogui +++ b/gr-uhd/apps/uhd_rx_nogui @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gru, uhd, optfir, audio, blks2 +from gnuradio import gr, gru, uhd, audio, blks2 +from gnuradio import filter +from gnuradio import analog from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -69,9 +71,9 @@ blocks. # (device_rate, channel_rate, audio_rate, channel_pass, channel_stop, demod) demod_params = { - 'AM' : (256e3, 16e3, 16e3, 5000, 8000, blks2.demod_10k0a3e_cf), - 'FM' : (256e3, 32e3, 8e3, 8000, 9000, blks2.demod_20k0f3e_cf), - 'WFM' : (320e3, 320e3, 32e3, 80000, 115000, blks2.demod_200kf3e_cf) + 'AM' : (256e3, 16e3, 16e3, 5000, 8000, analog.demod_10k0a3e_cf), + 'FM' : (256e3, 32e3, 8e3, 8000, 9000, analog.demod_20k0f3e_cf), + 'WFM' : (320e3, 320e3, 32e3, 80000, 115000, analog.demod_200kf3e_cf) } class uhd_src(gr.hier_block2): @@ -104,7 +106,7 @@ class uhd_src(gr.hier_block2): # Resampler to get to exactly samp_rate no matter what dev_rate is self._rrate = samp_rate / dev_rate - self._resamp = blks2.pfb_arb_resampler_ccf(self._rrate) + self._resamp = filter.pfb.arb_resampler_ccf(self._rrate) # If no gain specified, set to midrange gain_range = self._src.get_gain_range() @@ -142,27 +144,27 @@ class app_top_block(gr.top_block): channel_decim = int(if_rate // channel_rate) audio_decim = int(channel_rate // audio_rate) - CHAN_taps = optfir.low_pass(1.0, # Filter gain - if_rate, # Sample rate - channel_pass, # One sided modulation bandwidth - channel_stop, # One sided channel bandwidth - 0.1, # Passband ripple - 60) # Stopband attenuation + CHAN_taps = filter.optfir.low_pass(1.0, # Filter gain + if_rate, # Sample rate + channel_pass, # One sided modulation bandwidth + channel_stop, # One sided channel bandwidth + 0.1, # Passband ripple + 60) # Stopband attenuation - CHAN = gr.freq_xlating_fir_filter_ccf(channel_decim, # Decimation rate - CHAN_taps, # Filter taps - 0.0, # Offset frequency - if_rate) # Sample rate + CHAN = filter.freq_xlating_fir_filter_ccf(channel_decim, # Decimation rate + CHAN_taps, # Filter taps + 0.0, # Offset frequency + if_rate) # Sample rate - RFSQL = gr.pwr_squelch_cc(options.rf_squelch, # Power threshold - 125.0/channel_rate, # Time constant - int(channel_rate/20), # 50ms rise/fall - False) # Zero, not gate output + RFSQL = analog.pwr_squelch_cc(options.rf_squelch, # Power threshold + 125.0/channel_rate, # Time constant + int(channel_rate/20), # 50ms rise/fall + False) # Zero, not gate output - AGC = gr.agc_cc(1.0/channel_rate, # Time constant - 1.0, # Reference power - 1.0, # Initial gain - 1.0) # Maximum gain + AGC = analog.agc_cc(1.0/channel_rate, # Time constant + 1.0, # Reference power + 1.0, # Initial gain + 1.0) # Maximum gain DEMOD = demod(channel_rate, audio_decim) @@ -173,8 +175,8 @@ class app_top_block(gr.top_block): # Optionally add CTCSS and RSAMP if needed tail = DEMOD if options.ctcss != None and options.ctcss > 60.0: - CTCSS = gr.ctcss_squelch_ff(audio_rate, # Sample rate - options.ctcss) # Squelch tone + CTCSS = analog.ctcss_squelch_ff(audio_rate, # Sample rate + options.ctcss) # Squelch tone self.connect(DEMOD, CTCSS) tail = CTCSS diff --git a/gr-uhd/apps/uhd_siggen_base.py b/gr-uhd/apps/uhd_siggen_base.py index 9eecddb756..3dcebab29c 100644 --- a/gr-uhd/apps/uhd_siggen_base.py +++ b/gr-uhd/apps/uhd_siggen_base.py @@ -39,6 +39,7 @@ TYPE_KEY = 'type' def setter(ps, key, val): ps[key] = val from gnuradio import gr, gru, uhd, eng_notation +from gnuradio import analog from gnuradio.gr.pubsub import pubsub from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -239,28 +240,28 @@ class top_block(gr.top_block, pubsub): def set_waveform(self, type): self.lock() self.disconnect_all() - if type == gr.GR_SIN_WAVE or type == gr.GR_CONST_WAVE: - self._src = gr.sig_source_c(self[SAMP_RATE_KEY], # Sample rate - type, # Waveform type - self[WAVEFORM_FREQ_KEY], # Waveform frequency - self[AMPLITUDE_KEY], # Waveform amplitude - self[WAVEFORM_OFFSET_KEY]) # Waveform offset - elif type == gr.GR_GAUSSIAN or type == gr.GR_UNIFORM: - self._src = gr.noise_source_c(type, self[AMPLITUDE_KEY]) + if type == analog.GR_SIN_WAVE or type == analog.GR_CONST_WAVE: + self._src = analog.sig_source_c(self[SAMP_RATE_KEY], # Sample rate + type, # Waveform type + self[WAVEFORM_FREQ_KEY], # Waveform frequency + self[AMPLITUDE_KEY], # Waveform amplitude + self[WAVEFORM_OFFSET_KEY]) # Waveform offset + elif type == analog.GR_GAUSSIAN or type == analog.GR_UNIFORM: + self._src = analog.noise_source_c(type, self[AMPLITUDE_KEY]) elif type == "2tone": - self._src1 = gr.sig_source_c(self[SAMP_RATE_KEY], - gr.GR_SIN_WAVE, - self[WAVEFORM_FREQ_KEY], - self[AMPLITUDE_KEY]/2.0, - 0) + self._src1 = analog.sig_source_c(self[SAMP_RATE_KEY], + analog.GR_SIN_WAVE, + self[WAVEFORM_FREQ_KEY], + self[AMPLITUDE_KEY]/2.0, + 0) if(self[WAVEFORM2_FREQ_KEY] is None): self[WAVEFORM2_FREQ_KEY] = -self[WAVEFORM_FREQ_KEY] - self._src2 = gr.sig_source_c(self[SAMP_RATE_KEY], - gr.GR_SIN_WAVE, - self[WAVEFORM2_FREQ_KEY], - self[AMPLITUDE_KEY]/2.0, - 0) + self._src2 = analog.sig_source_c(self[SAMP_RATE_KEY], + analog.GR_SIN_WAVE, + self[WAVEFORM2_FREQ_KEY], + self[AMPLITUDE_KEY]/2.0, + 0) self._src = gr.add_cc() self.connect(self._src1,(self._src,0)) self.connect(self._src2,(self._src,1)) @@ -272,12 +273,12 @@ class top_block(gr.top_block, pubsub): if self[WAVEFORM2_FREQ_KEY] is None: self[WAVEFORM2_FREQ_KEY] = 0.1 - self._src1 = gr.sig_source_f(self[SAMP_RATE_KEY], - gr.GR_TRI_WAVE, - self[WAVEFORM2_FREQ_KEY], - 1.0, - -0.5) - self._src2 = gr.frequency_modulator_fc(self[WAVEFORM_FREQ_KEY]*2*math.pi/self[SAMP_RATE_KEY]) + self._src1 = analog.sig_source_f(self[SAMP_RATE_KEY], + analog.GR_TRI_WAVE, + self[WAVEFORM2_FREQ_KEY], + 1.0, + -0.5) + self._src2 = analog.frequency_modulator_fc(self[WAVEFORM_FREQ_KEY]*2*math.pi/self[SAMP_RATE_KEY]) self._src = gr.multiply_const_cc(self[AMPLITUDE_KEY]) self.connect(self._src1,self._src2,self._src) else: @@ -288,7 +289,7 @@ class top_block(gr.top_block, pubsub): if self._verbose: print "Set baseband modulation to:", waveforms[type] - if type == gr.GR_SIN_WAVE: + if type == analog.GR_SIN_WAVE: print "Modulation frequency: %sHz" % (n2s(self[WAVEFORM_FREQ_KEY]),) print "Initial phase:", self[WAVEFORM_OFFSET_KEY] elif type == "2tone": @@ -306,7 +307,7 @@ class top_block(gr.top_block, pubsub): print "Amplitude out of range:", amplitude return False - if self[TYPE_KEY] in (gr.GR_SIN_WAVE, gr.GR_CONST_WAVE, gr.GR_GAUSSIAN, gr.GR_UNIFORM): + if self[TYPE_KEY] in (analog.GR_SIN_WAVE, analog.GR_CONST_WAVE, analog.GR_GAUSSIAN, analog.GR_UNIFORM): self._src.set_amplitude(amplitude) elif self[TYPE_KEY] == "2tone": self._src1.set_amplitude(amplitude/2.0) @@ -341,16 +342,16 @@ def get_options(): help="Set baseband waveform frequency to FREQ [default=%default]") parser.add_option("-y", "--waveform2-freq", type="eng_float", default=None, help="Set 2nd waveform frequency to FREQ [default=%default]") - parser.add_option("--sine", dest="type", action="store_const", const=gr.GR_SIN_WAVE, + parser.add_option("--sine", dest="type", action="store_const", const=analog.GR_SIN_WAVE, help="Generate a carrier modulated by a complex sine wave", - default=gr.GR_SIN_WAVE) - parser.add_option("--const", dest="type", action="store_const", const=gr.GR_CONST_WAVE, + default=analog.GR_SIN_WAVE) + parser.add_option("--const", dest="type", action="store_const", const=analog.GR_CONST_WAVE, help="Generate a constant carrier") parser.add_option("--offset", type="eng_float", default=0, help="Set waveform phase offset to OFFSET [default=%default]") - parser.add_option("--gaussian", dest="type", action="store_const", const=gr.GR_GAUSSIAN, + parser.add_option("--gaussian", dest="type", action="store_const", const=analog.GR_GAUSSIAN, help="Generate Gaussian random output") - parser.add_option("--uniform", dest="type", action="store_const", const=gr.GR_UNIFORM, + parser.add_option("--uniform", dest="type", action="store_const", const=analog.GR_UNIFORM, help="Generate Uniform random output") parser.add_option("--2tone", dest="type", action="store_const", const="2tone", help="Generate Two Tone signal for IMD testing") diff --git a/gr-uhd/doc/uhd.dox b/gr-uhd/doc/uhd.dox index f03705fe18..4cd30a86b6 100644 --- a/gr-uhd/doc/uhd.dox +++ b/gr-uhd/doc/uhd.dox @@ -92,10 +92,10 @@ resampler to take care of the difference. actual_rate = self.u.get_samp_rate() resample = desired_rate / actual_rate - # Use the blks2 version and pass only the resample factor. + # Use the filter.pfb version and pass only the resample factor. # This block builds a half-band filter for you - self.resampler = blks2.pfb_arb_resampler_ccf(resample) + self.resampler = filter.pfb.arb_resampler_ccf(resample) \endcode */ diff --git a/gr-uhd/examples/grc/uhd_two_tone_loopback.grc b/gr-uhd/examples/grc/uhd_two_tone_loopback.grc index 8bcbc07927..b186c2f2bc 100644 --- a/gr-uhd/examples/grc/uhd_two_tone_loopback.grc +++ b/gr-uhd/examples/grc/uhd_two_tone_loopback.grc @@ -1,6 +1,65 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Sat Oct 8 15:27:04 2011</timestamp> + <timestamp>Sat Nov 10 14:55:26 2012</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>uhd_two_tone_loopback</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>UHD Loopback - 2 Tone</value> + </param> + <param> + <key>author</key> + <value>Example</value> + </param> + <param> + <key>description</key> + <value>Loopback test</value> + </param> + <param> + <key>window_size</key> + <value>1280, 1024</value> + </param> + <param> + <key>generate_options</key> + <value>wx_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> <block> <key>parameter</key> <param> @@ -177,53 +236,10 @@ </param> </block> <block> - <key>gr_sig_source_x</key> - <param> - <key>id</key> - <value>gr_sig_source_x</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>complex</value> - </param> - <param> - <key>samp_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> - </param> - <param> - <key>freq</key> - <value>tone1</value> - </param> - <param> - <key>amp</key> - <value>tone_ampl</value> - </param> - <param> - <key>offset</key> - <value>0</value> - </param> - <param> - <key>_coordinate</key> - <value>(258, 136)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_sig_source_x</key> + <key>uhd_usrp_sink</key> <param> <key>id</key> - <value>gr_sig_source_x0</value> + <value>uhd_usrp_sink_0</value> </param> <param> <key>_enabled</key> @@ -231,160 +247,122 @@ </param> <param> <key>type</key> - <value>complex</value> - </param> - <param> - <key>samp_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> - </param> - <param> - <key>freq</key> - <value>tone2</value> - </param> - <param> - <key>amp</key> - <value>tone_ampl</value> - </param> - <param> - <key>offset</key> - <value>0</value> + <value>fc32</value> </param> <param> - <key>_coordinate</key> - <value>(259, 248)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_noise_source_x</key> - <param> - <key>id</key> - <value>gr_noise_source_x</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> + <key>otw</key> + <value></value> </param> <param> - <key>type</key> - <value>complex</value> + <key>stream_args</key> + <value></value> </param> <param> - <key>noise_type</key> - <value>gr.GR_GAUSSIAN</value> + <key>dev_addr</key> + <value>address0</value> </param> <param> - <key>amp</key> - <value>noise_ampl</value> + <key>sync</key> + <value></value> </param> <param> - <key>seed</key> - <value>42</value> + <key>clock_rate</key> + <value>0.0</value> </param> <param> - <key>_coordinate</key> - <value>(279, 364)</value> + <key>num_mboards</key> + <value>1</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>clock_source0</key> + <value></value> </param> - </block> - <block> - <key>uhd_usrp_sink</key> <param> - <key>id</key> - <value>uhd_usrp_sink_0</value> + <key>time_source0</key> + <value></value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>sd_spec0</key> + <value></value> </param> <param> - <key>type</key> - <value>complex</value> + <key>clock_source1</key> + <value></value> </param> <param> - <key>dev_addr</key> - <value>address0</value> + <key>time_source1</key> + <value></value> </param> <param> - <key>sync</key> + <key>sd_spec1</key> <value></value> </param> <param> - <key>clock_rate</key> - <value>0.0</value> + <key>clock_source2</key> + <value></value> </param> <param> - <key>num_mboards</key> - <value>1</value> + <key>time_source2</key> + <value></value> </param> <param> - <key>ref_source0</key> + <key>sd_spec2</key> <value></value> </param> <param> - <key>sd_spec0</key> + <key>clock_source3</key> <value></value> </param> <param> - <key>ref_source1</key> + <key>time_source3</key> <value></value> </param> <param> - <key>sd_spec1</key> + <key>sd_spec3</key> <value></value> </param> <param> - <key>ref_source2</key> + <key>clock_source4</key> <value></value> </param> <param> - <key>sd_spec2</key> + <key>time_source4</key> <value></value> </param> <param> - <key>ref_source3</key> + <key>sd_spec4</key> <value></value> </param> <param> - <key>sd_spec3</key> + <key>clock_source5</key> <value></value> </param> <param> - <key>ref_source4</key> + <key>time_source5</key> <value></value> </param> <param> - <key>sd_spec4</key> + <key>sd_spec5</key> <value></value> </param> <param> - <key>ref_source5</key> + <key>clock_source6</key> <value></value> </param> <param> - <key>sd_spec5</key> + <key>time_source6</key> <value></value> </param> <param> - <key>ref_source6</key> + <key>sd_spec6</key> <value></value> </param> <param> - <key>sd_spec6</key> + <key>clock_source7</key> <value></value> </param> <param> - <key>ref_source7</key> + <key>time_source7</key> <value></value> </param> <param> @@ -1242,7 +1220,15 @@ </param> <param> <key>type</key> - <value>complex</value> + <value>fc32</value> + </param> + <param> + <key>otw</key> + <value></value> + </param> + <param> + <key>stream_args</key> + <value></value> </param> <param> <key>dev_addr</key> @@ -1261,7 +1247,11 @@ <value>1</value> </param> <param> - <key>ref_source0</key> + <key>clock_source0</key> + <value></value> + </param> + <param> + <key>time_source0</key> <value></value> </param> <param> @@ -1269,7 +1259,11 @@ <value></value> </param> <param> - <key>ref_source1</key> + <key>clock_source1</key> + <value></value> + </param> + <param> + <key>time_source1</key> <value></value> </param> <param> @@ -1277,7 +1271,11 @@ <value></value> </param> <param> - <key>ref_source2</key> + <key>clock_source2</key> + <value></value> + </param> + <param> + <key>time_source2</key> <value></value> </param> <param> @@ -1285,7 +1283,11 @@ <value></value> </param> <param> - <key>ref_source3</key> + <key>clock_source3</key> + <value></value> + </param> + <param> + <key>time_source3</key> <value></value> </param> <param> @@ -1293,7 +1295,11 @@ <value></value> </param> <param> - <key>ref_source4</key> + <key>clock_source4</key> + <value></value> + </param> + <param> + <key>time_source4</key> <value></value> </param> <param> @@ -1301,7 +1307,11 @@ <value></value> </param> <param> - <key>ref_source5</key> + <key>clock_source5</key> + <value></value> + </param> + <param> + <key>time_source5</key> <value></value> </param> <param> @@ -1309,7 +1319,11 @@ <value></value> </param> <param> - <key>ref_source6</key> + <key>clock_source6</key> + <value></value> + </param> + <param> + <key>time_source6</key> <value></value> </param> <param> @@ -1317,7 +1331,11 @@ <value></value> </param> <param> - <key>ref_source7</key> + <key>clock_source7</key> + <value></value> + </param> + <param> + <key>time_source7</key> <value></value> </param> <param> @@ -1964,10 +1982,10 @@ </param> </block> <block> - <key>gr_add_xx</key> + <key>wxgui_fftsink2</key> <param> <key>id</key> - <value>gr_add_xx</value> + <value>wxgui_fftsink2</value> </param> <param> <key>_enabled</key> @@ -1978,71 +1996,76 @@ <value>complex</value> </param> <param> - <key>num_inputs</key> - <value>3</value> + <key>title</key> + <value>FFT Plot</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>_coordinate</key> - <value>(529, 172)</value> + <key>baseband_freq</key> + <value>0</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>y_per_div</key> + <value>10</value> </param> - </block> - <block> - <key>options</key> <param> - <key>id</key> - <value>uhd_two_tone_loopback</value> + <key>y_divs</key> + <value>10</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>ref_level</key> + <value>0</value> </param> <param> - <key>title</key> - <value>UHD Loopback - 2 Tone</value> + <key>ref_scale</key> + <value>2.0</value> </param> <param> - <key>author</key> - <value>Example</value> + <key>fft_size</key> + <value>512*2</value> </param> <param> - <key>description</key> - <value>Loopback test</value> + <key>fft_rate</key> + <value>15</value> </param> <param> - <key>window_size</key> - <value>1280, 1024</value> + <key>peak_hold</key> + <value>False</value> </param> <param> - <key>generate_options</key> - <value>wx_gui</value> + <key>average</key> + <value>False</value> </param> <param> - <key>category</key> - <value>Custom</value> + <key>avg_alpha</key> + <value>0</value> </param> <param> - <key>run_options</key> - <value>prompt</value> + <key>win</key> + <value>window.blackmanharris</value> </param> <param> - <key>run</key> - <value>True</value> + <key>win_size</key> + <value></value> </param> <param> - <key>realtime_scheduling</key> + <key>grid_pos</key> + <value>1, 2, 2, 4</value> + </param> + <param> + <key>notebook</key> <value></value> </param> <param> + <key>freqvar</key> + <value>None</value> + </param> + <param> <key>_coordinate</key> - <value>(10, 10)</value> + <value>(1114, 264)</value> </param> <param> <key>_rotation</key> @@ -2050,86 +2073,120 @@ </param> </block> <block> - <key>wxgui_fftsink2</key> + <key>parameter</key> <param> <key>id</key> - <value>wxgui_fftsink2</value> + <value>samp_rate</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> + <key>label</key> + <value>Sample Rate</value> + </param> + <param> + <key>value</key> + <value>500e3</value> + </param> + <param> <key>type</key> - <value>complex</value> + <value>eng_float</value> </param> <param> - <key>title</key> - <value>FFT Plot</value> + <key>short_id</key> + <value>s</value> + </param> + <param> + <key>_coordinate</key> + <value>(539, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_sig_source_x</key> + <param> + <key>id</key> + <value>analog_sig_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> </param> <param> <key>samp_rate</key> <value>samp_rate</value> </param> <param> - <key>baseband_freq</key> - <value>0</value> + <key>waveform</key> + <value>analog.GR_COS_WAVE</value> </param> <param> - <key>y_per_div</key> - <value>10</value> + <key>freq</key> + <value>tone1</value> </param> <param> - <key>y_divs</key> - <value>10</value> + <key>amp</key> + <value>tone_ampl</value> </param> <param> - <key>ref_level</key> + <key>offset</key> <value>0</value> </param> <param> - <key>ref_scale</key> - <value>2.0</value> + <key>_coordinate</key> + <value>(264, 136)</value> </param> <param> - <key>fft_size</key> - <value>512*2</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>analog_sig_source_x</key> <param> - <key>fft_rate</key> - <value>15</value> + <key>id</key> + <value>analog_sig_source_x_1</value> </param> <param> - <key>peak_hold</key> - <value>False</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>average</key> - <value>False</value> + <key>type</key> + <value>complex</value> </param> <param> - <key>avg_alpha</key> - <value>0</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>win</key> - <value>window.blackmanharris</value> + <key>waveform</key> + <value>analog.GR_COS_WAVE</value> </param> <param> - <key>win_size</key> - <value></value> + <key>freq</key> + <value>tone2</value> </param> <param> - <key>grid_pos</key> - <value>1, 2, 2, 4</value> + <key>amp</key> + <value>tone_ampl</value> </param> <param> - <key>notebook</key> - <value></value> + <key>offset</key> + <value>0</value> </param> <param> <key>_coordinate</key> - <value>(1114, 264)</value> + <value>(265, 247)</value> </param> <param> <key>_rotation</key> @@ -2137,34 +2194,65 @@ </param> </block> <block> - <key>parameter</key> + <key>gr_add_xx</key> <param> <key>id</key> - <value>samp_rate</value> + <value>gr_add_xx</value> </param> <param> <key>_enabled</key> <value>True</value> </param> <param> - <key>label</key> - <value>Sample Rate</value> + <key>type</key> + <value>complex</value> </param> <param> - <key>value</key> - <value>500e3</value> + <key>num_inputs</key> + <value>3</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(529, 172)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_noise_source_x</key> + <param> + <key>id</key> + <value>analog_noise_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> </param> <param> <key>type</key> - <value>eng_float</value> + <value>complex</value> </param> <param> - <key>short_id</key> - <value>s</value> + <key>noise_type</key> + <value>analog.GR_GAUSSIAN</value> + </param> + <param> + <key>amp</key> + <value>noise_ampl</value> + </param> + <param> + <key>seed</key> + <value>-42</value> </param> <param> <key>_coordinate</key> - <value>(539, 11)</value> + <value>(288, 359)</value> </param> <param> <key>_rotation</key> @@ -2172,33 +2260,33 @@ </param> </block> <connection> - <source_block_id>gr_noise_source_x</source_block_id> - <sink_block_id>gr_add_xx</sink_block_id> + <source_block_id>gr_add_xx</source_block_id> + <sink_block_id>uhd_usrp_sink_0</sink_block_id> <source_key>0</source_key> - <sink_key>2</sink_key> + <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_sig_source_x0</source_block_id> - <sink_block_id>gr_add_xx</sink_block_id> + <source_block_id>uhd_usrp_source_0</source_block_id> + <sink_block_id>wxgui_fftsink2</sink_block_id> <source_key>0</source_key> - <sink_key>1</sink_key> + <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_sig_source_x</source_block_id> + <source_block_id>analog_sig_source_x_0</source_block_id> <sink_block_id>gr_add_xx</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_add_xx</source_block_id> - <sink_block_id>uhd_usrp_sink_0</sink_block_id> + <source_block_id>analog_sig_source_x_1</source_block_id> + <sink_block_id>gr_add_xx</sink_block_id> <source_key>0</source_key> - <sink_key>0</sink_key> + <sink_key>1</sink_key> </connection> <connection> - <source_block_id>uhd_usrp_source_0</source_block_id> - <sink_block_id>wxgui_fftsink2</sink_block_id> + <source_block_id>analog_noise_source_x_0</source_block_id> + <sink_block_id>gr_add_xx</sink_block_id> <source_key>0</source_key> - <sink_key>0</sink_key> + <sink_key>2</sink_key> </connection> </flow_graph> diff --git a/gr-uhd/examples/python/fm_tx4.py b/gr-uhd/examples/python/fm_tx4.py index 255b436f56..ae3e1b94f3 100755 --- a/gr-uhd/examples/python/fm_tx4.py +++ b/gr-uhd/examples/python/fm_tx4.py @@ -34,7 +34,7 @@ audio_to_file.py from gnuradio import gr, eng_notation from gnuradio import uhd -from gnuradio import blks2 +from gnuradio import analog from gnuradio.eng_option import eng_option from optparse import OptionParser import math @@ -62,19 +62,19 @@ class pipeline(gr.hier_block2): sys.exit(1) print audio_rate, if_rate - fmtx = blks2.nbfm_tx (audio_rate, if_rate, max_dev=5e3, tau=75e-6) + fmtx = analog.nbfm_tx(audio_rate, if_rate, max_dev=5e3, tau=75e-6) # Local oscillator - lo = gr.sig_source_c (if_rate, # sample rate - gr.GR_SIN_WAVE, # waveform type - lo_freq, #frequency - 1.0, # amplitude - 0) # DC Offset - mixer = gr.multiply_cc () - - self.connect (src, fmtx, (mixer, 0)) - self.connect (lo, (mixer, 1)) - self.connect (mixer, self) + lo = analog.sig_source_c(if_rate, # sample rate + analog.GR_SIN_WAVE, # waveform type + lo_freq, # frequency + 1.0, # amplitude + 0) # DC Offset + mixer = gr.multiply_cc() + + self.connect(src, fmtx, (mixer, 0)) + self.connect(lo, (mixer, 1)) + self.connect(mixer, self) class fm_tx_block(stdgui2.std_top_block): def __init__(self, frame, panel, vbox, argv): diff --git a/gr-uhd/examples/python/fm_tx_2_daughterboards.py b/gr-uhd/examples/python/fm_tx_2_daughterboards.py index d98d655ab1..f896be6d04 100755 --- a/gr-uhd/examples/python/fm_tx_2_daughterboards.py +++ b/gr-uhd/examples/python/fm_tx_2_daughterboards.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -30,7 +30,9 @@ Side A is 600 Hz tone. Side B is 350 + 440 Hz tones. """ -from gnuradio import gr, uhd, blks2 +from gnuradio import gr, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_notation import num_to_str, str_to_num from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -47,11 +49,11 @@ class example_signal_0(gr.hier_block2): gr.io_signature(0, 0, 0), # Input signature gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature - src = gr.sig_source_c (sample_rate, # sample rate - gr.GR_SIN_WAVE, # waveform type - 600, # frequency - 1.0, # amplitude - 0) # DC Offset + src = analog.sig_source_c(sample_rate, # sample rate + analog.GR_SIN_WAVE, # waveform type + 600, # frequency + 1.0, # amplitude + 0) # DC Offset self.connect(src, self) @@ -65,17 +67,17 @@ class example_signal_1(gr.hier_block2): gr.io_signature(0, 0, 0), # Input signature gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature - src0 = gr.sig_source_c (sample_rate, # sample rate - gr.GR_SIN_WAVE, # waveform type - 350, # frequency - 1.0, # amplitude - 0) # DC Offset - - src1 = gr.sig_source_c (sample_rate, # sample rate - gr.GR_SIN_WAVE, # waveform type - 440, # frequency - 1.0, # amplitude - 0) # DC Offset + src0 = analog.sig_source_c(sample_rate, # sample rate + analog.GR_SIN_WAVE, # waveform type + 350, # frequency + 1.0, # amplitude + 0) # DC Offset + + src1 = analog.sig_source_c(sample_rate, # sample rate + analog.GR_SIN_WAVE, # waveform type + 440, # frequency + 1.0, # amplitude + 0) # DC Offset sum = gr.add_cc() self.connect(src0, (sum, 0)) self.connect(src1, (sum, 1)) @@ -86,7 +88,7 @@ class my_top_block(gr.top_block): def __init__(self): gr.top_block.__init__(self) - usage="%prog: [options] tx-freq0 tx-freq1" + usage = "%prog: [options] tx-freq0 tx-freq1" parser = OptionParser (option_class=eng_option, usage=usage) parser.add_option("-a", "--args", type="string", default="", help="UHD device address args [default=%default]") @@ -158,7 +160,7 @@ class my_top_block(gr.top_block): # Correct for any difference in requested and actual rates rrate = self.usrp_rate / dev_rate - resamp = blks2.pfb_arb_resampler_ccf(rrate) + resamp = filter.pfb.arb_resampler_ccf(rrate) # and wire them up self.connect(intl, resamp, self.u) diff --git a/gr-uhd/examples/python/max_power.py b/gr-uhd/examples/python/max_power.py index 5d23f16afc..79fe120641 100755 --- a/gr-uhd/examples/python/max_power.py +++ b/gr-uhd/examples/python/max_power.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2007,2011 Free Software Foundation, Inc. +# Copyright 2004,2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,6 +26,7 @@ Setup USRP for maximum power consumption. from gnuradio import gr +from gnuradio import analog from gnuradio import uhd from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -63,9 +64,9 @@ class build_block(gr.top_block): self.u_tx = uhd.usrp_sink(device_addr=args, stream_args=stream_args) self.u_tx.set_samp_rate(MAX_RATE) - self.tx_src0 = gr.sig_source_c(self.u_tx.get_samp_rate(), - gr.GR_CONST_WAVE, - 0, 1.0, 0) + self.tx_src0 = analog.sig_source_c(self.u_tx.get_samp_rate(), + analog.GR_CONST_WAVE, + 0, 1.0, 0) # Get dboard gain range and select maximum tx_gain_range = self.u_tx.get_gain_range() @@ -94,7 +95,7 @@ class build_block(gr.top_block): self.u_rx = uhd.usrp_source(device_addr=args, io_type=uhd.io_type.COMPLEX_FLOAT32, num_channels=rx_nchan) - self.rx_dst0 = gr.null_sink (gr.sizeof_gr_complex) + self.rx_dst0 = gr.null_sink(gr.sizeof_gr_complex) self.u_rx.set_samp_rate(MAX_RATE) diff --git a/gr-uhd/examples/python/usrp_am_mw_rcv.py b/gr-uhd/examples/python/usrp_am_mw_rcv.py index 40a7fee68d..a389e173f8 100755 --- a/gr-uhd/examples/python/usrp_am_mw_rcv.py +++ b/gr-uhd/examples/python/usrp_am_mw_rcv.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,10 +20,11 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, eng_notation, optfir +from gnuradio import gr, eng_notation +from gnuradio import filter +from gnuradio import analog from gnuradio import audio from gnuradio import uhd -from gnuradio import blks2 from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form @@ -96,36 +97,36 @@ class wfm_rx_block (stdgui2.std_top_block): # Resample signal to exactly self.usrp_rate # FIXME: make one of the follow-on filters an arb resampler rrate = usrp_rate / dev_rate - self.resamp = blks2.pfb_arb_resampler_ccf(rrate) + self.resamp = filter.pfb.arb_resampler_ccf(rrate) - chan_filt_coeffs = gr.firdes.low_pass_2 (1, # gain - usrp_rate, # sampling rate - 8e3, # passband cutoff - 4e3, # transition bw - 60) # stopband attenuation + chan_filt_coeffs = filter.firdes.low_pass_2(1, # gain + usrp_rate, # sampling rate + 8e3, # passband cutoff + 4e3, # transition bw + 60) # stopband attenuation if self.use_IF: # Turn If to baseband and filter. - self.chan_filt = gr.freq_xlating_fir_filter_ccf (chanfilt_decim, - chan_filt_coeffs, - self.IF_freq, - usrp_rate) + self.chan_filt = filter.freq_xlating_fir_filter_ccf(chanfilt_decim, + chan_filt_coeffs, + self.IF_freq, + usrp_rate) else: - self.chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs) + self.chan_filt = filter.fir_filter_ccf(chanfilt_decim, chan_filt_coeffs) - self.agc = gr.agc_cc(0.1, 1, 1, 100000) + self.agc = analog.agc_cc(0.1, 1, 1, 100000) self.am_demod = gr.complex_to_mag() self.volume_control = gr.multiply_const_ff(self.vol) - audio_filt_coeffs = gr.firdes.low_pass_2 (1, # gain - demod_rate, # sampling rate - 8e3, # passband cutoff - 2e3, # transition bw - 60) # stopband attenuation - self.audio_filt=gr.fir_filter_fff(audio_decim, audio_filt_coeffs) + audio_filt_coeffs = filter.firdes.low_pass_2(1, # gain + demod_rate, # sampling rate + 8e3, # passband cutoff + 2e3, # transition bw + 60) # stopband attenuation + self.audio_filt = filter.fir_filter_fff(audio_decim, audio_filt_coeffs) # sound card as final sink - self.audio_sink = audio.sink (int (audio_rate), + self.audio_sink = audio.sink(int (audio_rate), options.audio_output, False) # ok_to_block diff --git a/gr-uhd/examples/python/usrp_nbfm_ptt.py b/gr-uhd/examples/python/usrp_nbfm_ptt.py index af4c214795..d377e3a0a2 100755 --- a/gr-uhd/examples/python/usrp_nbfm_ptt.py +++ b/gr-uhd/examples/python/usrp_nbfm_ptt.py @@ -25,7 +25,8 @@ import sys import wx from optparse import OptionParser -from gnuradio import gr, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import stdgui2, fftsink2, scopesink2, slider, form @@ -317,15 +318,15 @@ class transmit_path(gr.hier_block2): audio_taps = convolve(array(lpf),array(hpf)) self.audio_filt = gr.fir_filter_fff(1,audio_taps) - self.pl = blks2.ctcss_gen_f(self.audio_rate,123.0) + self.pl = analog.ctcss_gen_f(self.audio_rate,123.0) self.add_pl = gr.add_ff() self.connect(self.pl,(self.add_pl,1)) - self.fmtx = blks2.nbfm_tx(self.audio_rate, self.if_rate) + self.fmtx = analog.nbfm_tx(self.audio_rate, self.if_rate) self.amp = gr.multiply_const_cc (self.normal_gain) rrate = dev_rate / self.if_rate - self.resamp = blks2.pfb_arb_resampler_ccf(rrate) + self.resamp = filter.pfb.arb_resampler_ccf(rrate) self.connect(self.audio, self.audio_amp, self.audio_filt, (self.add_pl,0), self.fmtx, self.amp, @@ -395,23 +396,23 @@ class receive_path(gr.hier_block2): gr.firdes.WIN_HANN) # filter type rrate = self.quad_rate / dev_rate - self.resamp = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.resamp = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) # instantiate the guts of the single channel receiver - self.fmrx = blks2.nbfm_rx(self.audio_rate, self.quad_rate) + self.fmrx = analog.nbfm_rx(self.audio_rate, self.quad_rate) # standard squelch block - self.squelch = blks2.standard_squelch(self.audio_rate) + self.squelch = analog.standard_squelch(self.audio_rate) # audio gain / mute block self._audio_gain = gr.multiply_const_ff(1.0) # sound card as final sink - audio_sink = audio.sink (int(self.audio_rate), audio_output) + audio_sink = audio.sink(int(self.audio_rate), audio_output) # now wire it all together - self.connect (self.u, self.resamp, self.fmrx, self.squelch, - self._audio_gain, audio_sink) + self.connect(self.u, self.resamp, self.fmrx, self.squelch, + self._audio_gain, audio_sink) if gain is None: # if no gain was specified, use the mid-point in dB diff --git a/gr-uhd/examples/python/usrp_nbfm_rcv.py b/gr-uhd/examples/python/usrp_nbfm_rcv.py index 4a8340ec7b..1a06e7d06d 100755 --- a/gr-uhd/examples/python/usrp_nbfm_rcv.py +++ b/gr-uhd/examples/python/usrp_nbfm_rcv.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005,2007,2011 Free Software Foundation, Inc. +# Copyright 2005,2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form @@ -285,21 +287,21 @@ class receive_path(gr.hier_block2): # Create filter to get actual channel we want nfilts = 32 - chan_coeffs = gr.firdes.low_pass (nfilts, # gain - nfilts*dev_rate, # sampling rate - 8e3, # low pass cutoff freq - 2e3, # width of trans. band - gr.firdes.WIN_HANN) # filter type + chan_coeffs = filter.firdes.low_pass(nfilts, # gain + nfilts*dev_rate, # sampling rate + 8e3, # low pass cutoff freq + 2e3, # width of trans. band + filter.firdes.WIN_HANN) # filter type rrate = self.quad_rate / dev_rate - self.resamp = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.resamp = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) if USE_SIMPLE_SQUELCH: - self.squelch = gr.simple_squelch_cc(20) + self.squelch = analog.simple_squelch_cc(20) else: - self.squelch = blks2.standard_squelch(self.audio_rate) + self.squelch = analog.standard_squelch(self.audio_rate) # instantiate the guts of the single channel receiver - self.fmrx = blks2.nbfm_rx(self.audio_rate, self.quad_rate) + self.fmrx = analog.nbfm_rx(self.audio_rate, self.quad_rate) # audio gain / mute block self._audio_gain = gr.multiply_const_ff(1.0) diff --git a/gr-uhd/examples/python/usrp_tv_rcv.py b/gr-uhd/examples/python/usrp_tv_rcv.py index b42cf57992..0d0ddf531f 100755 --- a/gr-uhd/examples/python/usrp_tv_rcv.py +++ b/gr-uhd/examples/python/usrp_tv_rcv.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -47,6 +47,7 @@ except: print "FYI: gr-video-sdl is not installed" print "realtime SDL video output window will not be available" from gnuradio import uhd +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form @@ -194,7 +195,7 @@ class tv_rx_block (stdgui2.std_top_block): file_sink=gr.file_sink(gr.sizeof_char, options.out_filename) self.dst =file_sink - self.agc=gr.agc_cc(1e-7,1.0,1.0) #1e-7 + self.agc = analog.agc_cc(1e-7,1.0,1.0) #1e-7 self.am_demod = gr.complex_to_mag () self.set_blacklevel=gr.add_const_ff(0.0) self.invert_and_scale = gr.multiply_const_ff (0.0) #-self.contrast *128.0*255.0/(200.0) @@ -243,8 +244,8 @@ class tv_rx_block (stdgui2.std_top_block): self.invert_and_scale, self.set_blacklevel, f2uc, self.dst) else: # process_type=='do_test_image': - src_vertical_bars = gr.sig_source_f (usrp_rate, gr.GR_SIN_WAVE, - 10.0 *usrp_rate/320, 255,128) + src_vertical_bars = analog.sig_source_f(usrp_rate, analog.GR_SIN_WAVE, + 10.0 *usrp_rate/320, 255,128) self.connect(src_vertical_bars, f2uc, self.dst) self._build_gui(vbox, usrp_rate, usrp_rate, usrp_rate) diff --git a/gr-uhd/examples/python/usrp_tv_rcv_nogui.py b/gr-uhd/examples/python/usrp_tv_rcv_nogui.py index cfb36222cb..54275bb037 100755 --- a/gr-uhd/examples/python/usrp_tv_rcv_nogui.py +++ b/gr-uhd/examples/python/usrp_tv_rcv_nogui.py @@ -35,6 +35,7 @@ development but not yet in cvs. """ from gnuradio import gr, eng_notation +from gnuradio import analog from gnuradio import audio from gnuradio import uhd from gnuradio.eng_option import eng_option @@ -158,7 +159,7 @@ class my_top_block(gr.top_block): raise SystemExit, 1 - self.agc = gr.agc_cc(1e-7,1.0,1.0) #1e-7 + self.agc = analog.agc_cc(1e-7,1.0,1.0) #1e-7 self.am_demod = gr.complex_to_mag () self.set_blacklevel = gr.add_const_ff(options.brightness +255.0) self.invert_and_scale = gr.multiply_const_ff (-options.contrast *128.0*255.0/(200.0)) diff --git a/gr-uhd/examples/python/usrp_wfm_rcv.py b/gr-uhd/examples/python/usrp_wfm_rcv.py index a7d114d8cc..824af8975c 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2009,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2009,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, optfir, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form @@ -88,27 +90,27 @@ class wfm_rx_block (stdgui2.std_top_block): dev_rate = self.u.get_samp_rate() nfilts = 32 - chan_coeffs = optfir.low_pass (nfilts, # gain - nfilts*usrp_rate, # sampling rate - 80e3, # passband cutoff - 115e3, # stopband cutoff - 0.1, # passband ripple - 60) # stopband attenuation + chan_coeffs = filter.optfir.low_pass(nfilts, # gain + nfilts*usrp_rate, # sampling rate + 80e3, # passband cutoff + 115e3, # stopband cutoff + 0.1, # passband ripple + 60) # stopband attenuation rrate = usrp_rate / dev_rate - self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) - self.guts = blks2.wfm_rcv (demod_rate, audio_decim) + self.guts = analog.wfm_rcv(demod_rate, audio_decim) self.volume_control = gr.multiply_const_ff(self.vol) # sound card as final sink - self.audio_sink = audio.sink (int (audio_rate), - options.audio_output, - False) # ok_to_block + self.audio_sink = audio.sink(int (audio_rate), + options.audio_output, + False) # ok_to_block # now wire it all together - self.connect (self.u, self.chan_filt, self.guts, - self.volume_control, self.audio_sink) + self.connect(self.u, self.chan_filt, self.guts, + self.volume_control, self.audio_sink) self._build_gui(vbox, usrp_rate, demod_rate, audio_rate) diff --git a/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py b/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py index f7e72ae6f9..e76c78e017 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_option import eng_option from optparse import OptionParser import sys @@ -94,12 +96,12 @@ class wfm_rx_block (gr.top_block): # taps for channel filter nfilts = 32 - chan_coeffs = optfir.low_pass (nfilts, # gain - nfilts*usrp_rate, # sampling rate - 80e3, # passband cutoff - 115e3, # stopband cutoff - 0.1, # passband ripple - 60) # stopband attenuation + chan_coeffs = filter.optfir.low_pass(nfilts, # gain + nfilts*usrp_rate, # sampling rate + 80e3, # passband cutoff + 115e3, # stopband cutoff + 0.1, # passband ripple + 60) # stopband attenuation rrate = usrp_rate / dev_rate # set front end PLL to middle frequency @@ -111,8 +113,8 @@ class wfm_rx_block (gr.top_block): options.gain = float(g.start()+g.stop())/2.0 for n in range(2): - chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) - guts = blks2.wfm_rcv (demod_rate, audio_decim) + chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) + guts = analog.wfm_rcv(demod_rate, audio_decim) volume_control = gr.multiply_const_ff(self.vol) #self.connect((self.di, n), chan_filt) diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py b/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py index b794825727..97bd2b2d32 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form, scopesink2 @@ -90,31 +92,31 @@ class wfm_rx_block (stdgui2.std_top_block): dev_rate = self.u.get_samp_rate() nfilts = 32 - chan_coeffs = gr.firdes.low_pass_2(10*nfilts, # gain - nfilts*usrp_rate, # sampling rate - 90e3, # passband cutoff - 30e3, # transition bw - 70) # stopband attenuation + chan_coeffs = filter.firdes.low_pass_2(10*nfilts, # gain + nfilts*usrp_rate, # sampling rate + 90e3, # passband cutoff + 30e3, # transition bw + 70) # stopband attenuation rrate = usrp_rate / dev_rate - self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) - self.guts = blks2.wfm_rcv_fmdet (demod_rate, audio_decim) + self.guts = analog.wfm_rcv_fmdet (demod_rate, audio_decim) chan_rate = audio_rate / (demod_rate/audio_decim) - self.rchan_filt = blks2.pfb_arb_resampler_fff(chan_rate) - self.lchan_filt = blks2.pfb_arb_resampler_fff(chan_rate) + self.rchan_filt = filter.pfb.arb_resampler_fff(chan_rate) + self.lchan_filt = filter.pfb.arb_resampler_fff(chan_rate) # FIXME rework {add,multiply}_const_* to handle multiple streams self.volume_control_l = gr.multiply_const_ff(self.vol) self.volume_control_r = gr.multiply_const_ff(self.vol) # sound card as final sink - self.audio_sink = audio.sink (int (audio_rate), - options.audio_output, - False) # ok_to_block + self.audio_sink = audio.sink(int (audio_rate), + options.audio_output, + False) # ok_to_block # now wire it all together - self.connect (self.u, self.chan_filt, self.guts) + self.connect(self.u, self.chan_filt, self.guts) self.connect((self.guts, 0), self.lchan_filt, self.volume_control_l, (self.audio_sink,0)) self.connect((self.guts, 1), self.rchan_filt, diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py b/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py index 6e9c830c61..f2271fb6db 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, optfir, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -82,16 +84,16 @@ class wfm_rx_block (gr.top_block): dev_rate = self.u.get_samp_rate() nfilts = 32 - chan_coeffs = optfir.low_pass (nfilts, # gain - nfilts*usrp_rate, # sampling rate - 80e3, # passband cutoff - 115e3, # stopband cutoff - 0.1, # passband ripple - 60) # stopband attenuation + chan_coeffs = filter.optfir.low_pass(nfilts, # gain + nfilts*usrp_rate, # sampling rate + 80e3, # passband cutoff + 115e3, # stopband cutoff + 0.1, # passband ripple + 60) # stopband attenuation rrate = usrp_rate / dev_rate - self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) - self.guts = blks2.wfm_rcv (demod_rate, audio_decim) + self.guts = analog.wfm_rcv(demod_rate, audio_decim) self.volume_control = gr.multiply_const_ff(1) @@ -101,8 +103,8 @@ class wfm_rx_block (gr.top_block): False) # ok_to_block # now wire it all together - self.connect (self.u, self.chan_filt, self.guts, - self.volume_control, self.audio_sink) + self.connect(self.u, self.chan_filt, self.guts, + self.volume_control, self.audio_sink) if options.gain is None: # if no gain was specified, use the mid-point in dB diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_pll.py b/gr-uhd/examples/python/usrp_wfm_rcv_pll.py index a5c78cb24b..8cd3d5ab13 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv_pll.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_pll.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio import eng_notation from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate @@ -90,20 +92,20 @@ class wfm_rx_block (stdgui2.std_top_block): dev_rate = self.u.get_samp_rate() nfilts = 32 - chan_coeffs = gr.firdes.low_pass_2 (nfilts, # gain - nfilts*usrp_rate, # sampling rate - 90e3, # passband cutoff - 30e3, # stopband cutoff - 70) # stopband attenuation + chan_coeffs = filter.firdes.low_pass_2(nfilts, # gain + nfilts*usrp_rate, # sampling rate + 90e3, # passband cutoff + 30e3, # stopband cutoff + 70) # stopband attenuation rrate = usrp_rate / dev_rate - self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) - self.guts = blks2.wfm_rcv_pll (demod_rate, audio_decim) + self.guts = analog.wfm_rcv_pll(demod_rate, audio_decim) chan_rate = audio_rate / (demod_rate/audio_decim) - self.rchan_filt = blks2.pfb_arb_resampler_fff(chan_rate) - self.lchan_filt = blks2.pfb_arb_resampler_fff(chan_rate) + self.rchan_filt = filter.pfb.arb_resampler_fff(chan_rate) + self.lchan_filt = filter.pfb.arb_resampler_fff(chan_rate) # FIXME rework {add,multiply}_const_* to handle multiple streams self.volume_control_l = gr.multiply_const_ff(self.vol) diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_sca.py b/gr-uhd/examples/python/usrp_wfm_rcv_sca.py index 0e93e22fcd..68ff27ff30 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv_sca.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_sca.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2006,2007,2011 Free Software Foundation, Inc. +# Copyright 2006,2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -50,7 +50,9 @@ OFDM. """ -from gnuradio import gr, optfir, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form @@ -121,19 +123,19 @@ class wfm_rx_sca_block (stdgui2.std_top_block): dev_rate = self.u.get_samp_rate() nfilts = 32 - chan_coeffs = optfir.low_pass (nfilts, # gain - nfilts*usrp_rate, # sampling rate - 100e3, # passband cutoff - 140e3, # stopband cutoff - 0.1, # passband ripple - 60) # stopband attenuation + chan_coeffs = filter.optfir.low_pass(nfilts, # gain + nfilts*usrp_rate, # sampling rate + 100e3, # passband cutoff + 140e3, # stopband cutoff + 0.1, # passband ripple + 60) # stopband attenuation rrate = usrp_rate / dev_rate - self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) - + self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) + #Create demodulator block for Main FM Channel max_dev = 75e3 fm_demod_gain = demod_rate/(2*math.pi*max_dev) - self.fm_demod = gr.quadrature_demod_cf (fm_demod_gain) + self.fm_demod = analog.quadrature_demod_cf(fm_demod_gain) # Note - deemphasis is not applied to the Main FM Channel as # main audio is not decoded @@ -143,20 +145,20 @@ class wfm_rx_sca_block (stdgui2.std_top_block): max_sca_dev = 6e3 # Create filter to get SCA channel we want - sca_chan_coeffs = gr.firdes.low_pass (1.0, # gain - demod_rate, # sampling rate - max_sca_dev, # cutoff freq - max_sca_dev/3, # trans. band - gr.firdes.WIN_HANN) # filter type + sca_chan_coeffs = filter.firdes.low_pass(1.0, # gain + demod_rate, # sampling rate + max_sca_dev, # cutoff freq + max_sca_dev/3, # trans. band + analog.firdes.WIN_HANN) # filter type - self.ddc = gr.freq_xlating_fir_filter_fcf(sca_chanfilt_decim, # decim rate - sca_chan_coeffs, # taps - 0, # freq translation amount (Gets set by the UI) - demod_rate) # input sample rate + self.ddc = filter.freq_xlating_fir_filter_fcf(sca_chanfilt_decim, # decim rate + sca_chan_coeffs, # taps + 0, # freq translation amount (Gets set by the UI) + demod_rate) # input sample rate #Create demodulator block for SCA Channel sca_demod_gain = sca_demod_rate/(2*math.pi*max_sca_dev) - self.fm_demod_sca = gr.quadrature_demod_cf (sca_demod_gain) + self.fm_demod_sca = analog.quadrature_demod_cf(sca_demod_gain) # SCA analog audio is bandwidth limited to 5 KHz @@ -166,31 +168,31 @@ class wfm_rx_sca_block (stdgui2.std_top_block): sca_tau = 150e-6 # compute FIR filter taps for SCA audio filter - audio_coeffs = gr.firdes.low_pass (1.0, # gain - sca_demod_rate, # sampling rate - max_sca_audio_freq, # cutoff freq - max_sca_audio_freq/2.5, # trans. band - gr.firdes.WIN_HAMMING) + audio_coeffs = filter.firdes.low_pass(1.0, # gain + sca_demod_rate, # sampling rate + max_sca_audio_freq, # cutoff freq + max_sca_audio_freq/2.5, # trans. band + filter.firdes.WIN_HAMMING) # input: float; output: float - self.audio_filter = gr.fir_filter_fff (audio_decim, audio_coeffs) + self.audio_filter = filter.fir_filter_fff(audio_decim, audio_coeffs) # Create deemphasis block that is applied after SCA demodulation - self.deemph = blks2.fm_deemph (audio_rate, sca_tau) + self.deemph = analog.fm_deemph(audio_rate, sca_tau) self.volume_control = gr.multiply_const_ff(self.vol) # sound card as final sink - self.audio_sink = audio.sink (int (audio_rate), - options.audio_output, - False) # ok_to_block + self.audio_sink = audio.sink(int (audio_rate), + options.audio_output, + False) # ok_to_block # now wire it all together - self.connect (self.u, self.chan_filt, self.fm_demod, - self.ddc, self.fm_demod_sca) - self.connect (self.fm_demod_sca, self.audio_filter, - self.deemph, self.volume_control, - self.audio_sink) + self.connect(self.u, self.chan_filt, self.fm_demod, + self.ddc, self.fm_demod_sca) + self.connect(self.fm_demod_sca, self.audio_filter, + self.deemph, self.volume_control, + self.audio_sink) self._build_gui(vbox, usrp_rate, demod_rate, sca_demod_rate, audio_rate) diff --git a/gr-uhd/examples/python/usrp_wxapt_rcv.py b/gr-uhd/examples/python/usrp_wxapt_rcv.py index 5cceca1e98..ef774e2a07 100755 --- a/gr-uhd/examples/python/usrp_wxapt_rcv.py +++ b/gr-uhd/examples/python/usrp_wxapt_rcv.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005-2007,2011 Free Software Foundation, Inc. +# Copyright 2005-2007,2011,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,9 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, audio, blks2, uhd +from gnuradio import gr, audio, uhd +from gnuradio import filter +from gnuradio import analog from gnuradio.eng_option import eng_option from gnuradio.wxgui import slider, powermate from gnuradio.wxgui import stdgui2, fftsink2, form @@ -88,24 +90,24 @@ class wxapt_rx_block (stdgui2.std_top_block): dev_rate = self.u.get_samp_rate() nfilts = 32 - chan_coeffs = gr.firdes.low_pass_2 (nfilts, # gain - nfilts*usrp_rate, # sampling rate - 40e3, # passband cutoff - 20e3, # transition bw - 60) # stopband attenuation + chan_coeffs = filter.firdes.low_pass_2(nfilts, # gain + nfilts*usrp_rate, # sampling rate + 40e3, # passband cutoff + 20e3, # transition bw + 60) # stopband attenuation rrate = usrp_rate / dev_rate - self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts) + self.chan_filt = filter.pfb.arb_resampler_ccf(rrate, chan_coeffs, nfilts) - self.guts = blks2.wfm_rcv (demod_rate, audio_decim) + self.guts = analog.wfm_rcv(demod_rate, audio_decim) self.volume_control = gr.multiply_const_ff(self.vol) # sound card as final sink - self.audio_sink = audio.sink (int (audio_rate), options.audio_output) + self.audio_sink = audio.sink(int (audio_rate), options.audio_output) # now wire it all together - self.connect (self.u, self.chan_filt, self.guts, - self.volume_control, self.audio_sink) + self.connect(self.u, self.chan_filt, self.guts, + self.volume_control, self.audio_sink) self._build_gui(vbox, usrp_rate, demod_rate, audio_rate) diff --git a/gr-vocoder/python/CMakeLists.txt b/gr-vocoder/python/CMakeLists.txt index 32f69f2b69..7599aea53f 100644 --- a/gr-vocoder/python/CMakeLists.txt +++ b/gr-vocoder/python/CMakeLists.txt @@ -45,6 +45,8 @@ foreach(py_qa_test_file ${py_qa_test_files}) ${CMAKE_BINARY_DIR}/gr-vocoder/swig ${CMAKE_BINARY_DIR}/gr-filter/python ${CMAKE_BINARY_DIR}/gr-filter/swig + ${CMAKE_BINARY_DIR}/gr-analog/python + ${CMAKE_BINARY_DIR}/gr-analog/swig ) set(GR_TEST_TARGET_DEPS volk gruel gnuradio-core gnuradio-vocoder) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) diff --git a/gr-vocoder/python/qa_cvsd_vocoder.py b/gr-vocoder/python/qa_cvsd_vocoder.py index 573e6a1302..fc7ba35249 100755 --- a/gr-vocoder/python/qa_cvsd_vocoder.py +++ b/gr-vocoder/python/qa_cvsd_vocoder.py @@ -95,7 +95,9 @@ class test_cvsd_vocoder (gr_unittest.TestCase): -0.16035343706607819, 0.014823081903159618, 0.16282452642917633, 0.33802291750907898) - src = gr.sig_source_f(sample_rate, gr.GR_SIN_WAVE, 200, 1, 0) + # WARNING: not importing analog in this QA code. + # If we enable this, we can probably just create a sin with numpy. + src = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 200, 1, 0) head = gr.head(gr.sizeof_float, 100) src_scale = gr.multiply_const_ff(scale_factor) diff --git a/gr-wavelet/CMakeLists.txt b/gr-wavelet/CMakeLists.txt index a488c47e91..8d7ac65f7b 100644 --- a/gr-wavelet/CMakeLists.txt +++ b/gr-wavelet/CMakeLists.txt @@ -32,6 +32,7 @@ include(GrComponent) GR_REGISTER_COMPONENT("gr-wavelet" ENABLE_GR_WAVELET Boost_FOUND ENABLE_GR_CORE + ENABLE_GR_ANALOG GSL_FOUND ) diff --git a/gr-wavelet/python/CMakeLists.txt b/gr-wavelet/python/CMakeLists.txt index f118683954..a884c58052 100644 --- a/gr-wavelet/python/CMakeLists.txt +++ b/gr-wavelet/python/CMakeLists.txt @@ -40,6 +40,8 @@ foreach(py_qa_test_file ${py_qa_test_files}) ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig ${CMAKE_BINARY_DIR}/gr-wavelet/python ${CMAKE_BINARY_DIR}/gr-wavelet/swig + ${CMAKE_BINARY_DIR}/gr-analog/python + ${CMAKE_BINARY_DIR}/gr-analog/swig ) set(GR_TEST_TARGET_DEPS volk gruel gnuradio-core gnuradio-wavelet) GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) diff --git a/gr-wavelet/python/qa_classify.py b/gr-wavelet/python/qa_classify.py index 5701bce8c1..0906761aca 100755 --- a/gr-wavelet/python/qa_classify.py +++ b/gr-wavelet/python/qa_classify.py @@ -26,6 +26,7 @@ import copy #import pygsl.wavelet as wavelet # FIXME: pygsl not checked for in config import math import wavelet_swig +import analog_swig as analog def sqr(x): return x*x @@ -66,7 +67,7 @@ class test_classify(gr_unittest.TestCase): trg_data = src_data * 0.5 src = gr.vector_source_f(src_data) dst = gr.vector_sink_f() - rail = gr.rail_ff(-0.5, 0.5) + rail = analog.rail_ff(-0.5, 0.5) self.tb.connect(src, rail) self.tb.connect(rail, dst) self.tb.run() diff --git a/gr-wxgui/CMakeLists.txt b/gr-wxgui/CMakeLists.txt index ab00489065..ff8752667a 100644 --- a/gr-wxgui/CMakeLists.txt +++ b/gr-wxgui/CMakeLists.txt @@ -40,6 +40,7 @@ GR_REGISTER_COMPONENT("gr-wxgui" ENABLE_GR_WXGUI ENABLE_GR_CORE ENABLE_GR_FFT ENABLE_GR_FILTER + ENABLE_GR_ANALOG ENABLE_PYTHON ${wxgui_python_deps} ) diff --git a/gr-wxgui/src/python/fftsink_gl.py b/gr-wxgui/src/python/fftsink_gl.py index 72659b8fa4..931cf5c725 100644 --- a/gr-wxgui/src/python/fftsink_gl.py +++ b/gr-wxgui/src/python/fftsink_gl.py @@ -1,5 +1,5 @@ # -# Copyright 2008,2009,2010 Free Software Foundation, Inc. +# Copyright 2008-2010,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -27,6 +27,7 @@ from __future__ import division import fft_window import common from gnuradio import gr, fft +from gnuradio import analog from pubsub import pubsub from constants import * import math @@ -150,7 +151,7 @@ from gnuradio.wxgui import stdgui2 class test_app_block (stdgui2.std_top_block): def __init__(self, frame, panel, vbox, argv): - stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv) + stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) fft_size = 256 @@ -158,44 +159,44 @@ class test_app_block (stdgui2.std_top_block): input_rate = 2048.0e3 #Generate some noise - noise =gr.noise_source_c(gr.GR_UNIFORM, 1.0/10) + noise = analog.noise_source_c(analog.GR_UNIFORM, 1.0/10) # Generate a complex sinusoid - #src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 2e3, 1) - src1 = gr.sig_source_c (input_rate, gr.GR_CONST_WAVE, 57.50e3, 1) + #src1 = analog.sig_source_c(input_rate, analog.GR_SIN_WAVE, 2e3, 1) + src1 = analog.sig_source_c(input_rate, analog.GR_CONST_WAVE, 57.50e3, 1) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate) - sink1 = fft_sink_c (panel, title="Complex Data", fft_size=fft_size, - sample_rate=input_rate, baseband_freq=100e3, - ref_level=0, y_per_div=20, y_divs=10) - vbox.Add (sink1.win, 1, wx.EXPAND) + sink1 = fft_sink_c(panel, title="Complex Data", fft_size=fft_size, + sample_rate=input_rate, baseband_freq=100e3, + ref_level=0, y_per_div=20, y_divs=10) + vbox.Add(sink1.win, 1, wx.EXPAND) - combine1=gr.add_cc() + combine1 = gr.add_cc() self.connect(src1, (combine1,0)) self.connect(noise,(combine1,1)) self.connect(combine1,thr1, sink1) - #src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 2e3, 1) - src2 = gr.sig_source_f (input_rate, gr.GR_CONST_WAVE, 57.50e3, 1) + #src2 = analog.sig_source_f(input_rate, analog.GR_SIN_WAVE, 2e3, 1) + src2 = analog.sig_source_f (input_rate, analog.GR_CONST_WAVE, 57.50e3, 1) thr2 = gr.throttle(gr.sizeof_float, input_rate) - sink2 = fft_sink_f (panel, title="Real Data", fft_size=fft_size*2, - sample_rate=input_rate, baseband_freq=100e3, - ref_level=0, y_per_div=20, y_divs=10) - vbox.Add (sink2.win, 1, wx.EXPAND) + sink2 = fft_sink_f(panel, title="Real Data", fft_size=fft_size*2, + sample_rate=input_rate, baseband_freq=100e3, + ref_level=0, y_per_div=20, y_divs=10) + vbox.Add(sink2.win, 1, wx.EXPAND) - combine2=gr.add_ff() - c2f2=gr.complex_to_float() + combine2 = gr.add_ff() + c2f2 = gr.complex_to_float() self.connect(src2, (combine2,0)) self.connect(noise,c2f2,(combine2,1)) self.connect(combine2, thr2,sink2) def main (): - app = stdgui2.stdapp (test_app_block, "FFT Sink Test App") - app.MainLoop () + app = stdgui2.stdapp(test_app_block, "FFT Sink Test App") + app.MainLoop() if __name__ == '__main__': - main () + main() diff --git a/gr-wxgui/src/python/fftsink_nongl.py b/gr-wxgui/src/python/fftsink_nongl.py index 1f91a976aa..bc634b5cc7 100644 --- a/gr-wxgui/src/python/fftsink_nongl.py +++ b/gr-wxgui/src/python/fftsink_nongl.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2003,2004,2005,2006,2007,2009,2010 Free Software Foundation, Inc. +# Copyright 2003-2007,2009,2010,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,6 +21,7 @@ # from gnuradio import gr, gru, window, fft, filter +from gnuradio import analog from gnuradio.wxgui import stdgui2 import wx import plot @@ -604,33 +605,33 @@ class test_app_block (stdgui2.std_top_block): input_rate = 100*20.48e3 # Generate a complex sinusoid - #src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 100*2e3, 1) - src1 = gr.sig_source_c (input_rate, gr.GR_CONST_WAVE, 100*5.75e3, 1) + #src1 = analog.sig_source_c(input_rate, analog.GR_SIN_WAVE, 100*2e3, 1) + src1 = analog.sig_source_c(input_rate, analog.GR_CONST_WAVE, 100*5.75e3, 1) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate) - sink1 = fft_sink_c (panel, title="Complex Data", fft_size=fft_size, - sample_rate=input_rate, baseband_freq=100e3, - ref_level=0, y_per_div=20, y_divs=10) - vbox.Add (sink1.win, 1, wx.EXPAND) + sink1 = fft_sink_c(panel, title="Complex Data", fft_size=fft_size, + sample_rate=input_rate, baseband_freq=100e3, + ref_level=0, y_per_div=20, y_divs=10) + vbox.Add(sink1.win, 1, wx.EXPAND) self.connect(src1, thr1, sink1) - #src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 100*2e3, 1) - src2 = gr.sig_source_f (input_rate, gr.GR_CONST_WAVE, 100*5.75e3, 1) + #src2 = analog.sig_source_f(input_rate, analog.GR_SIN_WAVE, 100*2e3, 1) + src2 = analog.sig_source_f(input_rate, analog.GR_CONST_WAVE, 100*5.75e3, 1) thr2 = gr.throttle(gr.sizeof_float, input_rate) - sink2 = fft_sink_f (panel, title="Real Data", fft_size=fft_size*2, - sample_rate=input_rate, baseband_freq=100e3, - ref_level=0, y_per_div=20, y_divs=10) - vbox.Add (sink2.win, 1, wx.EXPAND) + sink2 = fft_sink_f(panel, title="Real Data", fft_size=fft_size*2, + sample_rate=input_rate, baseband_freq=100e3, + ref_level=0, y_per_div=20, y_divs=10) + vbox.Add(sink2.win, 1, wx.EXPAND) self.connect(src2, thr2, sink2) def main (): - app = stdgui2.stdapp (test_app_block, "FFT Sink Test App") - app.MainLoop () + app = stdgui2.stdapp(test_app_block, "FFT Sink Test App") + app.MainLoop() if __name__ == '__main__': main () diff --git a/gr-wxgui/src/python/histosink_gl.py b/gr-wxgui/src/python/histosink_gl.py index 509f746be6..8d90204046 100644 --- a/gr-wxgui/src/python/histosink_gl.py +++ b/gr-wxgui/src/python/histosink_gl.py @@ -1,5 +1,5 @@ # -# Copyright 2009 Free Software Foundation, Inc. +# Copyright 2009,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -24,7 +24,8 @@ ################################################## import histo_window import common -from gnuradio import gr, blks2 +from gnuradio import gr +from gnuradio import analog from pubsub import pubsub from constants import * @@ -94,17 +95,17 @@ class test_app_block (stdgui2.std_top_block): # build our flow graph input_rate = 20.48e3 - src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 2e3, 1) - #src2 = gr.sig_source_f (input_rate, gr.GR_CONST_WAVE, 5.75e3, 1) + src2 = analog.sig_source_f(input_rate, analog.GR_SIN_WAVE, 2e3, 1) + #src2 = analog.sig_source_f(input_rate, analog.GR_CONST_WAVE, 5.75e3, 1) thr2 = gr.throttle(gr.sizeof_float, input_rate) - sink2 = histo_sink_f (panel, title="Data", num_bins=31, frame_size=1000) - vbox.Add (sink2.win, 1, wx.EXPAND) + sink2 = histo_sink_f(panel, title="Data", num_bins=31, frame_size=1000) + vbox.Add(sink2.win, 1, wx.EXPAND) self.connect(src2, thr2, sink2) def main (): - app = stdgui2.stdapp (test_app_block, "Histo Sink Test App") - app.MainLoop () + app = stdgui2.stdapp(test_app_block, "Histo Sink Test App") + app.MainLoop() if __name__ == '__main__': - main () + main() diff --git a/gr-wxgui/src/python/numbersink2.py b/gr-wxgui/src/python/numbersink2.py index 85e8927e36..f85d9c3ee1 100644 --- a/gr-wxgui/src/python/numbersink2.py +++ b/gr-wxgui/src/python/numbersink2.py @@ -1,5 +1,5 @@ # -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,6 +25,7 @@ import number_window import common from gnuradio import gr, blks2, filter +from gnuradio import analog from pubsub import pubsub from constants import * @@ -134,38 +135,38 @@ class number_sink_c(_number_sink_base): import wx from gnuradio.wxgui import stdgui2 -class test_app_flow_graph (stdgui2.std_top_block): +class test_app_flow_graph(stdgui2.std_top_block): def __init__(self, frame, panel, vbox, argv): - stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv) + stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) # build our flow graph input_rate = 20.48e3 # Generate a real and complex sinusoids - src1 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 2.21e3, 1) - src2 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 2.21e3, 1) + src1 = analog.sig_source_f(input_rate, analog.GR_SIN_WAVE, 2.21e3, 1) + src2 = analog.sig_source_c(input_rate, analog.GR_SIN_WAVE, 2.21e3, 1) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. thr1 = gr.throttle(gr.sizeof_float, input_rate) thr2 = gr.throttle(gr.sizeof_gr_complex, input_rate) - sink1 = number_sink_f (panel, unit='V',label="Real Data", avg_alpha=0.001, - sample_rate=input_rate, minval=-1, maxval=1, - ref_level=0, decimal_places=3) - vbox.Add (sink1.win, 1, wx.EXPAND) - sink2 = number_sink_c (panel, unit='V',label="Complex Data", avg_alpha=0.001, - sample_rate=input_rate, minval=-1, maxval=1, - ref_level=0, decimal_places=3) - vbox.Add (sink2.win, 1, wx.EXPAND) + sink1 = number_sink_f(panel, unit='V',label="Real Data", avg_alpha=0.001, + sample_rate=input_rate, minval=-1, maxval=1, + ref_level=0, decimal_places=3) + vbox.Add(sink1.win, 1, wx.EXPAND) + sink2 = number_sink_c(panel, unit='V',label="Complex Data", avg_alpha=0.001, + sample_rate=input_rate, minval=-1, maxval=1, + ref_level=0, decimal_places=3) + vbox.Add(sink2.win, 1, wx.EXPAND) - self.connect (src1, thr1, sink1) - self.connect (src2, thr2, sink2) + self.connect(src1, thr1, sink1) + self.connect(src2, thr2, sink2) def main (): - app = stdgui2.stdapp (test_app_flow_graph, "Number Sink Test App") - app.MainLoop () + app = stdgui2.stdapp(test_app_flow_graph, "Number Sink Test App") + app.MainLoop() if __name__ == '__main__': - main () + main() diff --git a/gr-wxgui/src/python/scopesink_gl.py b/gr-wxgui/src/python/scopesink_gl.py index ab07550397..51bc454f09 100644 --- a/gr-wxgui/src/python/scopesink_gl.py +++ b/gr-wxgui/src/python/scopesink_gl.py @@ -1,5 +1,5 @@ # -# Copyright 2008,2010 Free Software Foundation, Inc. +# Copyright 2008,2010,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -206,18 +206,20 @@ class test_top_block (stdgui2.std_top_block): # Generate a complex sinusoid ampl=1.0e3 - self.src0 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 25.1e3*input_rate/default_input_rate, ampl) - self.noise =gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 11.1*25.1e3*input_rate/default_input_rate, ampl/10) - #self.noise =gr.noise_source_c(gr.GR_GAUSSIAN, ampl/10) - self.combine=gr.add_cc() + self.src0 = analog.sig_source_c(input_rate, gr.GR_SIN_WAVE, + 25.1e3*input_rate/default_input_rate, ampl) + self.noise = analog.sig_source_c (input_rate, analog.GR_SIN_WAVE, + 11.1*25.1e3*input_rate/default_input_rate, ampl/10) + #self.noise = analog.noise_source_c(analog.GR_GAUSSIAN, ampl/10) + self.combine = analog.add_cc() # We add this throttle block so that this demo doesn't suck down # all the CPU available. You normally wouldn't use it... self.thr = gr.throttle(gr.sizeof_gr_complex, input_rate) - scope = scope_sink_c (panel,"Secret Data",sample_rate=input_rate, - v_scale=v_scale, t_scale=t_scale) - vbox.Add (scope.win, 1, wx.EXPAND) + scope = scope_sink_c(panel,"Secret Data",sample_rate=input_rate, + v_scale=v_scale, t_scale=t_scale) + vbox.Add(scope.win, 1, wx.EXPAND) # Ultimately this will be # self.connect("src0 throttle scope") @@ -226,8 +228,8 @@ class test_top_block (stdgui2.std_top_block): self.connect(self.combine, self.thr, scope) def main (): - app = stdgui2.stdapp (test_top_block, "O'Scope Test App") - app.MainLoop () + app = stdgui2.stdapp(test_top_block, "O'Scope Test App") + app.MainLoop() if __name__ == '__main__': - main () + main() diff --git a/gr-wxgui/src/python/scopesink_nongl.py b/gr-wxgui/src/python/scopesink_nongl.py index d45e799060..6351daa723 100644 --- a/gr-wxgui/src/python/scopesink_nongl.py +++ b/gr-wxgui/src/python/scopesink_nongl.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2003,2004,2006,2007 Free Software Foundation, Inc. +# Copyright 2003,2004,2006,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,6 +21,7 @@ # from gnuradio import gr, gru, eng_notation +from gnuradio import analog from gnuradio.wxgui import stdgui2 import wx import gnuradio.wxgui.plot as plot @@ -45,7 +46,7 @@ class scope_sink_f(gr.hier_block2): for i in range(num_inputs): self.connect((self, i), (self.guts, i)) - self.win = scope_window(win_info (msgq, sample_rate, frame_decim, + self.win = scope_window(win_info(msgq, sample_rate, frame_decim, v_scale, t_scale, self.guts, title), parent) def set_sample_rate(self, sample_rate): @@ -66,8 +67,8 @@ class scope_sink_c(gr.hier_block2): for i in range(num_inputs): c2f = gr.complex_to_float() self.connect((self, i), c2f) - self.connect((c2f, 0), (self.guts, 2*i+0)) - self.connect((c2f, 1), (self.guts, 2*i+1)) + self.connect((c2f, 0),(self.guts, 2*i+0)) + self.connect((c2f, 1),(self.guts, 2*i+1)) self.win = scope_window(win_info(msgq, sample_rate, frame_decim, v_scale, t_scale, self.guts, title), parent) @@ -81,7 +82,7 @@ class constellation_sink(scope_sink_c): def __init__(self, parent, title='Constellation', sample_rate=1, size=default_scopesink_size, frame_decim=default_frame_decim): scope_sink_c.__init__(self, parent=parent, title=title, sample_rate=sample_rate, - size=size, frame_decim=frame_decim) + size=size, frame_decim=frame_decim) self.win.info.xy = True #constellation mode # ======================================================================== @@ -141,21 +142,21 @@ def EVT_DATA_EVENT(win, func): class DataEvent(wx.PyEvent): def __init__(self, data): wx.PyEvent.__init__(self) - self.SetEventType (wxDATA_EVENT) + self.SetEventType(wxDATA_EVENT) self.data = data - def Clone (self): - self.__class__ (self.GetId()) + def Clone(self): + self.__class__(self.GetId()) -class win_info (object): +class win_info(object): __slots__ = ['msgq', 'sample_rate', 'frame_decim', 'v_scale', 'scopesink', 'title', 'time_scale_cursor', 'v_scale_cursor', 'marker', 'xy', 'autorange', 'running'] - def __init__ (self, msgq, sample_rate, frame_decim, v_scale, t_scale, - scopesink, title = "Oscilloscope", xy=False): + def __init__(self, msgq, sample_rate, frame_decim, v_scale, t_scale, + scopesink, title = "Oscilloscope", xy=False): self.msgq = msgq self.sample_rate = sample_rate self.frame_decim = frame_decim @@ -170,30 +171,30 @@ class win_info (object): self.autorange = not v_scale self.running = True - def get_time_per_div (self): - return self.time_scale_cursor.current () + def get_time_per_div(self): + return self.time_scale_cursor.current() - def get_volts_per_div (self): - return self.v_scale_cursor.current () + def get_volts_per_div(self): + return self.v_scale_cursor.current() def set_sample_rate(self, sample_rate): self.sample_rate = sample_rate - def get_sample_rate (self): + def get_sample_rate(self): return self.sample_rate - def get_decimation_rate (self): + def get_decimation_rate(self): return 1.0 - def set_marker (self, s): + def set_marker(self, s): self.marker = s - def get_marker (self): + def get_marker(self): return self.marker -class input_watcher (gru.msgq_runner): - def __init__ (self, msgq, event_receiver, frame_decim, **kwds): +class input_watcher(gru.msgq_runner): + def __init__(self, msgq, event_receiver, frame_decim, **kwds): self.event_receiver = event_receiver self.frame_decim = frame_decim self.iscan = 0 @@ -211,166 +212,166 @@ class input_watcher (gru.msgq_runner): bytes_per_chan = nsamples * gr.sizeof_float records = [] - for ch in range (nchan): + for ch in range(nchan): start = ch * bytes_per_chan chan_data = s[start:start+bytes_per_chan] - rec = numpy.fromstring (chan_data, numpy.float32) - records.append (rec) + rec = numpy.fromstring(chan_data, numpy.float32) + records.append(rec) # print "nrecords = %d, reclen = %d" % (len (records),nsamples) - de = DataEvent (records) - wx.PostEvent (self.event_receiver, de) + de = DataEvent(records) + wx.PostEvent(self.event_receiver, de) records = [] del de self.iscan -= 1 -class scope_window (wx.Panel): +class scope_window(wx.Panel): - def __init__ (self, info, parent, id = -1, - pos = wx.DefaultPosition, size = wx.DefaultSize, name = ""): - wx.Panel.__init__ (self, parent, -1) + def __init__(self, info, parent, id = -1, + pos = wx.DefaultPosition, size = wx.DefaultSize, name = ""): + wx.Panel.__init__(self, parent, -1) self.info = info - vbox = wx.BoxSizer (wx.VERTICAL) + vbox = wx.BoxSizer(wx.VERTICAL) - self.graph = graph_window (info, self, -1) + self.graph = graph_window(info, self, -1) - vbox.Add (self.graph, 1, wx.EXPAND) - vbox.Add (self.make_control_box(), 0, wx.EXPAND) - vbox.Add (self.make_control2_box(), 0, wx.EXPAND) + vbox.Add(self.graph, 1, wx.EXPAND) + vbox.Add(self.make_control_box(), 0, wx.EXPAND) + vbox.Add(self.make_control2_box(), 0, wx.EXPAND) self.sizer = vbox - self.SetSizer (self.sizer) - self.SetAutoLayout (True) - self.sizer.Fit (self) + self.SetSizer(self.sizer) + self.SetAutoLayout(True) + self.sizer.Fit(self) self.set_autorange(self.info.autorange) # second row of control buttons etc. appears BELOW control_box - def make_control2_box (self): - ctrlbox = wx.BoxSizer (wx.HORIZONTAL) + def make_control2_box(self): + ctrlbox = wx.BoxSizer(wx.HORIZONTAL) - self.inc_v_button = wx.Button (self, 1101, " < ", style=wx.BU_EXACTFIT) - self.inc_v_button.SetToolTipString ("Increase vertical range") - wx.EVT_BUTTON (self, 1101, self.incr_v_scale) # ID matches button ID above + self.inc_v_button = wx.Button(self, 1101, " < ", style=wx.BU_EXACTFIT) + self.inc_v_button.SetToolTipString("Increase vertical range") + wx.EVT_BUTTON(self, 1101, self.incr_v_scale) # ID matches button ID above - self.dec_v_button = wx.Button (self, 1100, " > ", style=wx.BU_EXACTFIT) - self.dec_v_button.SetToolTipString ("Decrease vertical range") - wx.EVT_BUTTON (self, 1100, self.decr_v_scale) + self.dec_v_button = wx.Button(self, 1100, " > ", style=wx.BU_EXACTFIT) + self.dec_v_button.SetToolTipString("Decrease vertical range") + wx.EVT_BUTTON(self, 1100, self.decr_v_scale) - self.v_scale_label = wx.StaticText (self, 1002, "None") # vertical /div - self.update_v_scale_label () + self.v_scale_label = wx.StaticText(self, 1002, "None") # vertical /div + self.update_v_scale_label() - self.autorange_checkbox = wx.CheckBox (self, 1102, "Autorange") - self.autorange_checkbox.SetToolTipString ("Select autorange on/off") + self.autorange_checkbox = wx.CheckBox(self, 1102, "Autorange") + self.autorange_checkbox.SetToolTipString("Select autorange on/off") wx.EVT_CHECKBOX(self, 1102, self.autorange_checkbox_event) - ctrlbox.Add ((5,0) ,0) # left margin space - ctrlbox.Add (self.inc_v_button, 0, wx.EXPAND) - ctrlbox.Add (self.dec_v_button, 0, wx.EXPAND) - ctrlbox.Add (self.v_scale_label, 0, wx.ALIGN_CENTER) - ctrlbox.Add ((20,0) ,0) # spacer - ctrlbox.Add (self.autorange_checkbox, 0, wx.ALIGN_CENTER) + ctrlbox.Add((5,0) ,0) # left margin space + ctrlbox.Add(self.inc_v_button, 0, wx.EXPAND) + ctrlbox.Add(self.dec_v_button, 0, wx.EXPAND) + ctrlbox.Add(self.v_scale_label, 0, wx.ALIGN_CENTER) + ctrlbox.Add((20,0) ,0) # spacer + ctrlbox.Add(self.autorange_checkbox, 0, wx.ALIGN_CENTER) return ctrlbox - def make_control_box (self): - ctrlbox = wx.BoxSizer (wx.HORIZONTAL) + def make_control_box(self): + ctrlbox = wx.BoxSizer(wx.HORIZONTAL) - tb_left = wx.Button (self, 1001, " < ", style=wx.BU_EXACTFIT) - tb_left.SetToolTipString ("Increase time base") - wx.EVT_BUTTON (self, 1001, self.incr_timebase) + tb_left = wx.Button(self, 1001, " < ", style=wx.BU_EXACTFIT) + tb_left.SetToolTipString("Increase time base") + wx.EVT_BUTTON(self, 1001, self.incr_timebase) - tb_right = wx.Button (self, 1000, " > ", style=wx.BU_EXACTFIT) - tb_right.SetToolTipString ("Decrease time base") - wx.EVT_BUTTON (self, 1000, self.decr_timebase) + tb_right = wx.Button(self, 1000, " > ", style=wx.BU_EXACTFIT) + tb_right.SetToolTipString("Decrease time base") + wx.EVT_BUTTON(self, 1000, self.decr_timebase) - self.time_base_label = wx.StaticText (self, 1002, "") - self.update_timebase_label () + self.time_base_label = wx.StaticText(self, 1002, "") + self.update_timebase_label() - ctrlbox.Add ((5,0) ,0) - # ctrlbox.Add (wx.StaticText (self, -1, "Horiz Scale: "), 0, wx.ALIGN_CENTER) - ctrlbox.Add (tb_left, 0, wx.EXPAND) - ctrlbox.Add (tb_right, 0, wx.EXPAND) - ctrlbox.Add (self.time_base_label, 0, wx.ALIGN_CENTER) + ctrlbox.Add((5,0) ,0) + # ctrlbox.Add(wx.StaticText(self, -1, "Horiz Scale: "), 0, wx.ALIGN_CENTER) + ctrlbox.Add(tb_left, 0, wx.EXPAND) + ctrlbox.Add(tb_right, 0, wx.EXPAND) + ctrlbox.Add(self.time_base_label, 0, wx.ALIGN_CENTER) - ctrlbox.Add ((10,0) ,1) # stretchy space + ctrlbox.Add((10,0) ,1) # stretchy space - ctrlbox.Add (wx.StaticText (self, -1, "Trig: "), 0, wx.ALIGN_CENTER) - self.trig_chan_choice = wx.Choice (self, 1004, - choices = ['Ch1', 'Ch2', 'Ch3', 'Ch4']) - self.trig_chan_choice.SetToolTipString ("Select channel for trigger") - wx.EVT_CHOICE (self, 1004, self.trig_chan_choice_event) - ctrlbox.Add (self.trig_chan_choice, 0, wx.ALIGN_CENTER) + ctrlbox.Add(wx.StaticText(self, -1, "Trig: "), 0, wx.ALIGN_CENTER) + self.trig_chan_choice = wx.Choice(self, 1004, + choices = ['Ch1', 'Ch2', 'Ch3', 'Ch4']) + self.trig_chan_choice.SetToolTipString("Select channel for trigger") + wx.EVT_CHOICE(self, 1004, self.trig_chan_choice_event) + ctrlbox.Add(self.trig_chan_choice, 0, wx.ALIGN_CENTER) - self.trig_mode_choice = wx.Choice (self, 1005, - choices = ['Free', 'Auto', 'Norm']) + self.trig_mode_choice = wx.Choice(self, 1005, + choices = ['Free', 'Auto', 'Norm']) self.trig_mode_choice.SetSelection(1) - self.trig_mode_choice.SetToolTipString ("Select trigger slope or Auto (untriggered roll)") - wx.EVT_CHOICE (self, 1005, self.trig_mode_choice_event) - ctrlbox.Add (self.trig_mode_choice, 0, wx.ALIGN_CENTER) + self.trig_mode_choice.SetToolTipString("Select trigger slope or Auto (untriggered roll)") + wx.EVT_CHOICE(self, 1005, self.trig_mode_choice_event) + ctrlbox.Add(self.trig_mode_choice, 0, wx.ALIGN_CENTER) - trig_level50 = wx.Button (self, 1006, "50%") - trig_level50.SetToolTipString ("Set trigger level to 50%") - wx.EVT_BUTTON (self, 1006, self.set_trig_level50) - ctrlbox.Add (trig_level50, 0, wx.EXPAND) + trig_level50 = wx.Button(self, 1006, "50%") + trig_level50.SetToolTipString("Set trigger level to 50%") + wx.EVT_BUTTON(self, 1006, self.set_trig_level50) + ctrlbox.Add(trig_level50, 0, wx.EXPAND) - run_stop = wx.Button (self, 1007, "Run/Stop") - run_stop.SetToolTipString ("Toggle Run/Stop mode") - wx.EVT_BUTTON (self, 1007, self.run_stop) - ctrlbox.Add (run_stop, 0, wx.EXPAND) + run_stop = wx.Button(self, 1007, "Run/Stop") + run_stop.SetToolTipString("Toggle Run/Stop mode") + wx.EVT_BUTTON(self, 1007, self.run_stop) + ctrlbox.Add(run_stop, 0, wx.EXPAND) - ctrlbox.Add ((10, 0) ,1) # stretchy space + ctrlbox.Add((10, 0) ,1) # stretchy space - ctrlbox.Add (wx.StaticText (self, -1, "Fmt: "), 0, wx.ALIGN_CENTER) - self.marker_choice = wx.Choice (self, 1002, choices = self._marker_choices) - self.marker_choice.SetToolTipString ("Select plotting with lines, pluses or dots") - wx.EVT_CHOICE (self, 1002, self.marker_choice_event) - ctrlbox.Add (self.marker_choice, 0, wx.ALIGN_CENTER) + ctrlbox.Add(wx.StaticText(self, -1, "Fmt: "), 0, wx.ALIGN_CENTER) + self.marker_choice = wx.Choice(self, 1002, choices = self._marker_choices) + self.marker_choice.SetToolTipString("Select plotting with lines, pluses or dots") + wx.EVT_CHOICE(self, 1002, self.marker_choice_event) + ctrlbox.Add(self.marker_choice, 0, wx.ALIGN_CENTER) - self.xy_choice = wx.Choice (self, 1003, choices = ['X:t', 'X:Y']) - self.xy_choice.SetToolTipString ("Select X vs time or X vs Y display") - wx.EVT_CHOICE (self, 1003, self.xy_choice_event) - ctrlbox.Add (self.xy_choice, 0, wx.ALIGN_CENTER) + self.xy_choice = wx.Choice(self, 1003, choices = ['X:t', 'X:Y']) + self.xy_choice.SetToolTipString("Select X vs time or X vs Y display") + wx.EVT_CHOICE(self, 1003, self.xy_choice_event) + ctrlbox.Add(self.xy_choice, 0, wx.ALIGN_CENTER) return ctrlbox _marker_choices = ['line', 'plus', 'dot'] - def update_timebase_label (self): - time_per_div = self.info.get_time_per_div () - s = ' ' + eng_notation.num_to_str (time_per_div) + 's/div' - self.time_base_label.SetLabel (s) + def update_timebase_label(self): + time_per_div = self.info.get_time_per_div() + s = ' ' + eng_notation.num_to_str(time_per_div) + 's/div' + self.time_base_label.SetLabel(s) - def decr_timebase (self, evt): - self.info.time_scale_cursor.prev () - self.update_timebase_label () + def decr_timebase(self, evt): + self.info.time_scale_cursor.prev() + self.update_timebase_label() - def incr_timebase (self, evt): - self.info.time_scale_cursor.next () - self.update_timebase_label () + def incr_timebase(self, evt): + self.info.time_scale_cursor.next() + self.update_timebase_label() - def update_v_scale_label (self): - volts_per_div = self.info.get_volts_per_div () - s = ' ' + eng_notation.num_to_str (volts_per_div) + '/div' # Not V/div - self.v_scale_label.SetLabel (s) + def update_v_scale_label(self): + volts_per_div = self.info.get_volts_per_div() + s = ' ' + eng_notation.num_to_str(volts_per_div) + '/div' # Not V/div + self.v_scale_label.SetLabel(s) - def decr_v_scale (self, evt): - self.info.v_scale_cursor.prev () - self.update_v_scale_label () + def decr_v_scale(self, evt): + self.info.v_scale_cursor.prev() + self.update_v_scale_label() - def incr_v_scale (self, evt): - self.info.v_scale_cursor.next () - self.update_v_scale_label () + def incr_v_scale(self, evt): + self.info.v_scale_cursor.next() + self.update_v_scale_label() - def marker_choice_event (self, evt): - s = evt.GetString () - self.set_marker (s) + def marker_choice_event(self, evt): + s = evt.GetString() + self.set_marker(s) def set_autorange(self, on): if on: @@ -395,64 +396,64 @@ class scope_window (wx.Panel): else: self.set_autorange(False) - def set_marker (self, s): - self.info.set_marker (s) # set info for drawing routines - i = self.marker_choice.FindString (s) + def set_marker(self, s): + self.info.set_marker(s) # set info for drawing routines + i = self.marker_choice.FindString(s) assert i >= 0, "Hmmm, set_marker problem" - self.marker_choice.SetSelection (i) + self.marker_choice.SetSelection(i) - def set_format_line (self): - self.set_marker ('line') + def set_format_line(self): + self.set_marker('line') - def set_format_dot (self): - self.set_marker ('dot') + def set_format_dot(self): + self.set_marker('dot') - def set_format_plus (self): - self.set_marker ('plus') + def set_format_plus(self): + self.set_marker('plus') - def xy_choice_event (self, evt): - s = evt.GetString () + def xy_choice_event(self, evt): + s = evt.GetString() self.info.xy = s == 'X:Y' - def trig_chan_choice_event (self, evt): - s = evt.GetString () - ch = int (s[-1]) - 1 - self.info.scopesink.set_trigger_channel (ch) + def trig_chan_choice_event(self, evt): + s = evt.GetString() + ch = int(s[-1]) - 1 + self.info.scopesink.set_trigger_channel(ch) - def trig_mode_choice_event (self, evt): + def trig_mode_choice_event(self, evt): sink = self.info.scopesink - s = evt.GetString () + s = evt.GetString() if s == 'Norm': - sink.set_trigger_mode (gr.gr_TRIG_MODE_NORM) + sink.set_trigger_mode(gr.gr_TRIG_MODE_NORM) elif s == 'Auto': - sink.set_trigger_mode (gr.gr_TRIG_MODE_AUTO) + sink.set_trigger_mode(gr.gr_TRIG_MODE_AUTO) elif s == 'Free': - sink.set_trigger_mode (gr.gr_TRIG_MODE_FREE) + sink.set_trigger_mode(gr.gr_TRIG_MODE_FREE) else: assert 0, "Bad trig_mode_choice string" - def set_trig_level50 (self, evt): - self.info.scopesink.set_trigger_level_auto () + def set_trig_level50(self, evt): + self.info.scopesink.set_trigger_level_auto() - def run_stop (self, evt): + def run_stop(self, evt): self.info.running = not self.info.running -class graph_window (plot.PlotCanvas): +class graph_window(plot.PlotCanvas): channel_colors = ['BLUE', 'RED', 'CYAN', 'MAGENTA', 'GREEN', 'YELLOW'] - def __init__ (self, info, parent, id = -1, + def __init__(self, info, parent, id = -1, pos = wx.DefaultPosition, size = (640, 240), style = wx.DEFAULT_FRAME_STYLE, name = ""): - plot.PlotCanvas.__init__ (self, parent, id, pos, size, style, name) + plot.PlotCanvas.__init__(self, parent, id, pos, size, style, name) - self.SetXUseScopeTicks (True) - self.SetEnableGrid (True) - self.SetEnableZoom (True) + self.SetXUseScopeTicks(True) + self.SetEnableGrid(True) + self.SetEnableZoom(True) self.SetEnableLegend(True) - # self.SetBackgroundColour ('black') + # self.SetBackgroundColour('black') self.info = info; self.y_range = None @@ -462,38 +463,38 @@ class graph_window (plot.PlotCanvas): self.avg_x_min = None self.avg_x_max = None - EVT_DATA_EVENT (self, self.format_data) + EVT_DATA_EVENT(self, self.format_data) - self.input_watcher = input_watcher (info.msgq, self, info.frame_decim) + self.input_watcher = input_watcher(info.msgq, self, info.frame_decim) - def channel_color (self, ch): + def channel_color(self, ch): return self.channel_colors[ch % len(self.channel_colors)] - def format_data (self, evt): + def format_data(self, evt): if not self.info.running: return if self.info.xy: - self.format_xy_data (evt) + self.format_xy_data(evt) return info = self.info records = evt.data - nchannels = len (records) - npoints = len (records[0]) + nchannels = len(records) + npoints = len(records[0]) objects = [] - Ts = 1.0 / (info.get_sample_rate () / info.get_decimation_rate ()) - x_vals = Ts * numpy.arange (-npoints/2, npoints/2) + Ts = 1.0 / (info.get_sample_rate() / info.get_decimation_rate()) + x_vals = Ts * numpy.arange(-npoints/2, npoints/2) # preliminary clipping based on time axis here, instead of in graphics code - time_per_window = self.info.get_time_per_div () * 10 - n = int (time_per_window / Ts + 0.5) + time_per_window = self.info.get_time_per_div() * 10 + n = int(time_per_window / Ts + 0.5) n = n & ~0x1 # make even - n = max (2, min (n, npoints)) + n = max(2, min(n, npoints)) - self.SetXUseScopeTicks (True) # use 10 divisions, no labels + self.SetXUseScopeTicks(True) # use 10 divisions, no labels for ch in range(nchannels): r = records[ch] @@ -502,74 +503,74 @@ class graph_window (plot.PlotCanvas): lb = npoints/2 - n/2 ub = npoints/2 + n/2 - # points = zip (x_vals[lb:ub], r[lb:ub]) - points = numpy.zeros ((ub-lb, 2), numpy.float64) + # points = zip(x_vals[lb:ub], r[lb:ub]) + points = numpy.zeros((ub-lb, 2), numpy.float64) points[:,0] = x_vals[lb:ub] points[:,1] = r[lb:ub] - m = info.get_marker () + m = info.get_marker() if m == 'line': - objects.append (plot.PolyLine (points, - colour=self.channel_color (ch), - legend=('Ch%d' % (ch+1,)))) + objects.append(plot.PolyLine(points, + colour=self.channel_color(ch), + legend=('Ch%d' % (ch+1,)))) else: - objects.append (plot.PolyMarker (points, - marker=m, - colour=self.channel_color (ch), - legend=('Ch%d' % (ch+1,)))) + objects.append(plot.PolyMarker(points, + marker=m, + colour=self.channel_color(ch), + legend=('Ch%d' % (ch+1,)))) - graphics = plot.PlotGraphics (objects, - title=self.info.title, - xLabel = '', yLabel = '') + graphics = plot.PlotGraphics(objects, + title=self.info.title, + xLabel = '', yLabel = '') - time_per_div = info.get_time_per_div () + time_per_div = info.get_time_per_div() x_range = (-5.0 * time_per_div, 5.0 * time_per_div) # ranges are tuples! - volts_per_div = info.get_volts_per_div () + volts_per_div = info.get_volts_per_div() if not self.info.autorange: self.y_range = (-4.0 * volts_per_div, 4.0 * volts_per_div) - self.Draw (graphics, xAxis=x_range, yAxis=self.y_range) - self.update_y_range () # autorange to self.y_range + self.Draw(graphics, xAxis=x_range, yAxis=self.y_range) + self.update_y_range() # autorange to self.y_range - def format_xy_data (self, evt): + def format_xy_data(self, evt): info = self.info records = evt.data - nchannels = len (records) - npoints = len (records[0]) + nchannels = len(records) + npoints = len(records[0]) if nchannels < 2: return objects = [] - # points = zip (records[0], records[1]) - points = numpy.zeros ((len(records[0]), 2), numpy.float32) + # points = zip(records[0], records[1]) + points = numpy.zeros((len(records[0]), 2), numpy.float32) points[:,0] = records[0] points[:,1] = records[1] - self.SetXUseScopeTicks (False) + self.SetXUseScopeTicks(False) - m = info.get_marker () + m = info.get_marker() if m == 'line': - objects.append (plot.PolyLine (points, - colour=self.channel_color (0))) + objects.append(plot.PolyLine(points, + colour=self.channel_color(0))) else: - objects.append (plot.PolyMarker (points, - marker=m, - colour=self.channel_color (0))) + objects.append(plot.PolyMarker(points, + marker=m, + colour=self.channel_color(0))) - graphics = plot.PlotGraphics (objects, - title=self.info.title, - xLabel = 'I', yLabel = 'Q') + graphics = plot.PlotGraphics(objects, + title=self.info.title, + xLabel = 'I', yLabel = 'Q') - self.Draw (graphics, xAxis=self.x_range, yAxis=self.y_range) - self.update_y_range () - self.update_x_range () + self.Draw(graphics, xAxis=self.x_range, yAxis=self.y_range) + self.update_y_range() + self.update_x_range() - def update_y_range (self): + def update_y_range(self): alpha = 1.0/25 graphics = self.last_draw[0] - p1, p2 = graphics.boundingBox () # min, max points of graphics + p1, p2 = graphics.boundingBox() # min, max points of graphics if self.avg_y_min: # prevent vertical scale from jumping abruptly --? self.avg_y_min = p1[1] * alpha + self.avg_y_min * (1 - alpha) @@ -578,15 +579,15 @@ class graph_window (plot.PlotCanvas): self.avg_y_min = p1[1] # -500.0 workaround, sometimes p1 is ~ 10^35 self.avg_y_max = p2[1] # 500.0 - self.y_range = self._axisInterval ('auto', self.avg_y_min, self.avg_y_max) + self.y_range = self._axisInterval('auto', self.avg_y_min, self.avg_y_max) # print "p1 %s p2 %s y_min %s y_max %s y_range %s" \ # % (p1, p2, self.avg_y_min, self.avg_y_max, self.y_range) - def update_x_range (self): + def update_x_range(self): alpha = 1.0/25 graphics = self.last_draw[0] - p1, p2 = graphics.boundingBox () # min, max points of graphics + p1, p2 = graphics.boundingBox() # min, max points of graphics if self.avg_x_min: self.avg_x_min = p1[0] * alpha + self.avg_x_min * (1 - alpha) @@ -595,16 +596,16 @@ class graph_window (plot.PlotCanvas): self.avg_x_min = p1[0] self.avg_x_max = p2[0] - self.x_range = self._axisInterval ('auto', self.avg_x_min, self.avg_x_max) + self.x_range = self._axisInterval('auto', self.avg_x_min, self.avg_x_max) # ---------------------------------------------------------------- # Stand-alone test application # ---------------------------------------------------------------- -class test_top_block (stdgui2.std_top_block): +class test_top_block(stdgui2.std_top_block): def __init__(self, frame, panel, vbox, argv): - stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv) + stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) if len(argv) > 1: frame_decim = int(argv[1]) @@ -626,26 +627,26 @@ class test_top_block (stdgui2.std_top_block): input_rate = 1e6 # Generate a complex sinusoid - self.src0 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 25.1e3, 1e3) + self.src0 = analog.sig_source_c(input_rate, analog.GR_SIN_WAVE, 25.1e3, 1e3) # We add this throttle block so that this demo doesn't suck down # all the CPU available. You normally wouldn't use it... self.thr = gr.throttle(gr.sizeof_gr_complex, input_rate) - scope = scope_sink_c (panel,"Secret Data",sample_rate=input_rate, - frame_decim=frame_decim, - v_scale=v_scale, t_scale=t_scale) - vbox.Add (scope.win, 1, wx.EXPAND) + scope = scope_sink_c(panel,"Secret Data",sample_rate=input_rate, + frame_decim=frame_decim, + v_scale=v_scale, t_scale=t_scale) + vbox.Add(scope.win, 1, wx.EXPAND) # Ultimately this will be # self.connect("src0 throttle scope") self.connect(self.src0, self.thr, scope) -def main (): - app = stdgui2.stdapp (test_top_block, "O'Scope Test App") - app.MainLoop () +def main(): + app = stdgui2.stdapp(test_top_block, "O'Scope Test App") + app.MainLoop() if __name__ == '__main__': - main () + main() # ---------------------------------------------------------------- diff --git a/gr-wxgui/src/python/waterfallsink_gl.py b/gr-wxgui/src/python/waterfallsink_gl.py index b17f292875..050bbb5924 100644 --- a/gr-wxgui/src/python/waterfallsink_gl.py +++ b/gr-wxgui/src/python/waterfallsink_gl.py @@ -1,5 +1,5 @@ # -# Copyright 2008,2009 Free Software Foundation, Inc. +# Copyright 2008,2009,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,6 +25,7 @@ import waterfall_window import common from gnuradio import gr, fft +from gnuradio import analog from pubsub import pubsub from constants import * @@ -133,9 +134,9 @@ class waterfall_sink_c(_waterfall_sink_base): import wx from gnuradio.wxgui import stdgui2 -class test_top_block (stdgui2.std_top_block): +class test_top_block(stdgui2.std_top_block): def __init__(self, frame, panel, vbox, argv): - stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv) + stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) fft_size = 512 @@ -143,30 +144,30 @@ class test_top_block (stdgui2.std_top_block): input_rate = 20.000e3 # Generate a complex sinusoid - self.src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 5.75e3, 1000) - #src1 = gr.sig_source_c (input_rate, gr.GR_CONST_WAVE, 5.75e3, 1000) + self.src1 = analog.sig_source_c(input_rate, analog.GR_SIN_WAVE, 5.75e3, 1000) + #src1 = analog.sig_source_c(input_rate, analog.GR_CONST_WAVE, 5.75e3, 1000) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. self.thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate) - sink1 = waterfall_sink_c (panel, title="Complex Data", fft_size=fft_size, - sample_rate=input_rate, baseband_freq=100e3) + sink1 = waterfall_sink_c(panel, title="Complex Data", fft_size=fft_size, + sample_rate=input_rate, baseband_freq=100e3) self.connect(self.src1, self.thr1, sink1) - vbox.Add (sink1.win, 1, wx.EXPAND) + vbox.Add(sink1.win, 1, wx.EXPAND) # generate a real sinusoid - self.src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 5.75e3, 1000) + self.src2 = analog.sig_source_f(input_rate, analog.GR_SIN_WAVE, 5.75e3, 1000) self.thr2 = gr.throttle(gr.sizeof_float, input_rate) - sink2 = waterfall_sink_f (panel, title="Real Data", fft_size=fft_size, - sample_rate=input_rate, baseband_freq=100e3) + sink2 = waterfall_sink_f(panel, title="Real Data", fft_size=fft_size, + sample_rate=input_rate, baseband_freq=100e3) self.connect(self.src2, self.thr2, sink2) - vbox.Add (sink2.win, 1, wx.EXPAND) + vbox.Add(sink2.win, 1, wx.EXPAND) def main (): - app = stdgui2.stdapp (test_top_block, "Waterfall Sink Test App") - app.MainLoop () + app = stdgui2.stdapp(test_top_block, "Waterfall Sink Test App") + app.MainLoop() if __name__ == '__main__': main () diff --git a/gr-wxgui/src/python/waterfallsink_nongl.py b/gr-wxgui/src/python/waterfallsink_nongl.py index be164bbccd..0e9b706708 100644 --- a/gr-wxgui/src/python/waterfallsink_nongl.py +++ b/gr-wxgui/src/python/waterfallsink_nongl.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2003,2004,2005,2007,2008 Free Software Foundation, Inc. +# Copyright 2003-2007,2008,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -21,6 +21,7 @@ # from gnuradio import gr, gru, window, fft, filter +from gnuradio import analog from gnuradio.wxgui import stdgui2 import wx import gnuradio.wxgui.plot as plot @@ -391,7 +392,7 @@ def next_down(v, seq): class test_top_block (stdgui2.std_top_block): def __init__(self, frame, panel, vbox, argv): - stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv) + stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) fft_size = 512 @@ -399,30 +400,30 @@ class test_top_block (stdgui2.std_top_block): input_rate = 20.000e3 # Generate a complex sinusoid - self.src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, 5.75e3, 1000) - #src1 = gr.sig_source_c (input_rate, gr.GR_CONST_WAVE, 5.75e3, 1000) + self.src1 = analog.sig_source_c(input_rate, analog.GR_SIN_WAVE, 5.75e3, 1000) + #src1 = analog.sig_source_c(input_rate, analog.GR_CONST_WAVE, 5.75e3, 1000) # We add these throttle blocks so that this demo doesn't # suck down all the CPU available. Normally you wouldn't use these. self.thr1 = gr.throttle(gr.sizeof_gr_complex, input_rate) - sink1 = waterfall_sink_c (panel, title="Complex Data", fft_size=fft_size, - sample_rate=input_rate, baseband_freq=100e3) + sink1 = waterfall_sink_c(panel, title="Complex Data", fft_size=fft_size, + sample_rate=input_rate, baseband_freq=100e3) self.connect(self.src1, self.thr1, sink1) - vbox.Add (sink1.win, 1, wx.EXPAND) + vbox.Add(sink1.win, 1, wx.EXPAND) # generate a real sinusoid - self.src2 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 5.75e3, 1000) + self.src2 = analog.sig_source_f(input_rate, analog.GR_SIN_WAVE, 5.75e3, 1000) self.thr2 = gr.throttle(gr.sizeof_float, input_rate) - sink2 = waterfall_sink_f (panel, title="Real Data", fft_size=fft_size, - sample_rate=input_rate, baseband_freq=100e3) + sink2 = waterfall_sink_f(panel, title="Real Data", fft_size=fft_size, + sample_rate=input_rate, baseband_freq=100e3) self.connect(self.src2, self.thr2, sink2) - vbox.Add (sink2.win, 1, wx.EXPAND) + vbox.Add(sink2.win, 1, wx.EXPAND) def main (): - app = stdgui2.stdapp (test_top_block, "Waterfall Sink Test App") - app.MainLoop () + app = stdgui2.stdapp(test_top_block, "Waterfall Sink Test App") + app.MainLoop() if __name__ == '__main__': - main () + main() diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 31298a2288..842e32c15e 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -8,9 +8,6 @@ <name></name> <!-- Blank for Root Name --> <cat> <name>Sources</name> - <block>const_source_x</block> - <block>gr_sig_source_x</block> - <block>gr_noise_source_x</block> <block>gr_vector_source_x</block> <block>random_source_x</block> <block>gr_null_source</block> @@ -123,10 +120,6 @@ <block>gr_mpsk_sync_cc</block> - <block>gr_pll_carriertracking_cc</block> - <block>gr_pll_freqdet_cf</block> - <block>gr_pll_refout_cc</block> - <block>gr_simple_correlator</block> <block>blks2_packet_decoder</block> @@ -134,20 +127,11 @@ </cat> <cat> <name>Level Controls</name> - <block>gr_dpll_bb</block> <block>gr_peak_detector_xb</block> <block>gr_peak_detector2_fb</block> <block>gr_sample_and_hold_xx</block> - <block>gr_agc_xx</block> - <block>gr_agc2_xx</block> - <block>gr_feedforward_agc_cc</block> - <block>gr_mute_xx</block> - <block>gr_simple_squelch_cc</block> - <block>blks2_standard_squelch</block> - <block>gr_pwr_squelch_xx</block> - <block>gr_ctcss_squelch_ff</block> <block>gr_threshold_ff</block> </cat> <cat> @@ -161,22 +145,6 @@ <cat> <name>Modulators</name> <block>gr_vco_f</block> - <block>gr_frequency_modulator_fc</block> - <block>gr_phase_modulator_fc</block> - <block>gr_quadrature_demod_cf</block> - <block>gr_cpfsk_bc</block> - - <block>blks2_wfm_tx</block> - <block>blks2_wfm_rcv</block> - <block>blks2_wfm_rcv_pll</block> - - <block>blks2_nbfm_tx</block> - <block>blks2_nbfm_rx</block> - - <block>blks2_am_demod_cf</block> - <block>blks2_fm_demod_cf</block> - <block>blks2_fm_deemph</block> - <block>blks2_fm_preemph</block> </cat> <cat> <name>Error Correction</name> @@ -189,7 +157,6 @@ </cat> <cat> <name>Probes</name> - <block>gr_probe_avg_mag_sqrd_x</block> <block>gr_probe_signal_f</block> </cat> <cat> diff --git a/grc/blocks/gr_agc2_xx.xml b/grc/blocks/gr_agc2_xx.xml deleted file mode 100644 index 55b20d4e82..0000000000 --- a/grc/blocks/gr_agc2_xx.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##AGC2 -################################################### - --> -<block> - <name>AGC2</name> - <key>gr_agc2_xx</key> - <import>from gnuradio import gr</import> - <make>gr.agc2_$(type.fcn)($attack_rate, $decay_rate, $reference, $gain, $max_gain)</make> - <callback>set_attack_rate($attack_rate)</callback> - <callback>set_decay_rate($decay_rate)</callback> - <callback>set_reference($reference)</callback> - <callback>set_gain($gain)</callback> - <callback>set_max_gain($max_gain)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:cc</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:ff</opt> - </option> - </param> - <param> - <name>Attack Rate</name> - <key>attack_rate</key> - <value>1e-1</value> - <type>real</type> - </param> - <param> - <name>Decay Rate</name> - <key>decay_rate</key> - <value>1e-2</value> - <type>real</type> - </param> - <param> - <name>Reference</name> - <key>reference</key> - <value>1.0</value> - <type>real</type> - </param> - <param> - <name>Gain</name> - <key>gain</key> - <value>1.0</value> - <type>real</type> - </param> - <param> - <name>Max Gain</name> - <key>max_gain</key> - <value>0.0</value> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>$type</type> - </sink> - <source> - <name>out</name> - <type>$type</type> - </source> -</block> diff --git a/grc/blocks/gr_agc_xx.xml b/grc/blocks/gr_agc_xx.xml deleted file mode 100644 index c87d239edd..0000000000 --- a/grc/blocks/gr_agc_xx.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##AGC -################################################### - --> -<block> - <name>AGC</name> - <key>gr_agc_xx</key> - <import>from gnuradio import gr</import> - <make>gr.agc_$(type.fcn)($rate, $reference, $gain, $max_gain)</make> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:cc</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:ff</opt> - </option> - </param> - <param> - <name>Rate</name> - <key>rate</key> - <value>1e-4</value> - <type>real</type> - </param> - <param> - <name>Reference</name> - <key>reference</key> - <value>1.0</value> - <type>real</type> - </param> - <param> - <name>Gain</name> - <key>gain</key> - <value>1.0</value> - <type>real</type> - </param> - <param> - <name>Max Gain</name> - <key>max_gain</key> - <value>0.0</value> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>$type</type> - </sink> - <source> - <name>out</name> - <type>$type</type> - </source> -</block> diff --git a/grc/blocks/gr_cpfsk_bc.xml b/grc/blocks/gr_cpfsk_bc.xml deleted file mode 100644 index d5549d933f..0000000000 --- a/grc/blocks/gr_cpfsk_bc.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##CPFSK -################################################### - --> -<block> - <name>CPFSK</name> - <key>gr_cpfsk_bc</key> - <import>from gnuradio import gr</import> - <make>gr.cpfsk_bc($k, $amplitude, $samples_per_symbol)</make> - <callback>set_amplitude($amplitude)</callback> - <param> - <name>K</name> - <key>k</key> - <type>real</type> - </param> - <param> - <name>Amplitude</name> - <key>amplitude</key> - <type>real</type> - </param> - <param> - <name>Samples/Symbol</name> - <key>samples_per_symbol</key> - <value>2</value> - <type>int</type> - </param> - <sink> - <name>in</name> - <type>byte</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/grc/blocks/gr_ctcss_squelch_ff.xml b/grc/blocks/gr_ctcss_squelch_ff.xml deleted file mode 100644 index a34c75374c..0000000000 --- a/grc/blocks/gr_ctcss_squelch_ff.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0"?> -<!-- -# -# Copyright 2011 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. ---> - -<!-- -################################################### -##CTCSS Squelch -################################################### - --> -<block> - <name>CTCSS Squelch</name> - <key>gr_ctcss_squelch_ff</key> - <import>from gnuradio import gr</import> - <make>gr.ctcss_squelch_ff($rate, $freq, $level, $len, $ramp, $gate)</make> - <callback>set_level($level)</callback> - <param> - <name>Sampling Rate (Hz)</name> - <key>rate</key> - <value>samp_rate</value> - <type>real</type> - </param> - <param> - <name>Tone Frequency</name> - <key>freq</key> - <value>100.0</value> - <type>real</type> - </param> - <param> - <name>Level</name> - <key>level</key> - <value>0.01</value> - <type>real</type> - </param> - <param> - <name>Length</name> - <key>len</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Ramp</name> - <key>ramp</key> - <value>0</value> - <type>int</type> - </param> - <param> - <name>Gate</name> - <key>gate</key> - <value>False</value> - <type>bool</type> - </param> - <sink> - <name>in</name> - <type>float</type> - </sink> - <source> - <name>out</name> - <type>float</type> - </source> -</block> diff --git a/grc/blocks/gr_dpll_bb.xml b/grc/blocks/gr_dpll_bb.xml deleted file mode 100644 index 044d398ff1..0000000000 --- a/grc/blocks/gr_dpll_bb.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Detect Peak -################################################### - --> -<block> - <name>Detect Peak</name> - <key>gr_dpll_bb</key> - <import>from gnuradio import gr</import> - <make>gr.dpll_bb($period, $gain)</make> - <param> - <name>Period</name> - <key>period</key> - <type>real</type> - </param> - <param> - <name>Gain</name> - <key>gain</key> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>byte</type> - </sink> - <source> - <name>out</name> - <type>byte</type> - </source> -</block> diff --git a/grc/blocks/gr_frequency_modulator_fc.xml b/grc/blocks/gr_frequency_modulator_fc.xml deleted file mode 100644 index d5f8fcfe35..0000000000 --- a/grc/blocks/gr_frequency_modulator_fc.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Frequency Modulator -################################################### - --> -<block> - <name>Frequency Mod</name> - <key>gr_frequency_modulator_fc</key> - <import>from gnuradio import gr</import> - <make>gr.frequency_modulator_fc($sensitivity)</make> - <callback>set_sensitivity($sensitivity)</callback> - <param> - <name>Sensitivity</name> - <key>sensitivity</key> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>float</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/grc/blocks/gr_noise_source_x.xml b/grc/blocks/gr_noise_source_x.xml deleted file mode 100644 index 72daaaa209..0000000000 --- a/grc/blocks/gr_noise_source_x.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Noise Source -################################################### - --> -<block> - <name>Noise Source</name> - <key>gr_noise_source_x</key> - <import>from gnuradio import gr</import> - <make>gr.noise_source_$(type.fcn)($noise_type, $amp, $seed)</make> - <callback>set_type($noise_type)</callback> - <callback>set_amplitude($amp)</callback> - <param> - <name>Output Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:c</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:f</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>fcn:i</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:s</opt> - </option> - </param> - <param> - <name>Noise Type</name> - <key>noise_type</key> - <value>gr.GR_GAUSSIAN</value> - <type>int</type> - <option> - <name>Uniform</name> - <key>gr.GR_UNIFORM</key> - </option> - <option> - <name>Gaussian</name> - <key>gr.GR_GAUSSIAN</key> - </option> - <option> - <name>Laplacian</name> - <key>gr.GR_LAPLACIAN</key> - </option> - <option> - <name>Impulse</name> - <key>gr.GR_IMPULSE</key> - </option> - </param> - <param> - <name>Amplitude</name> - <key>amp</key> - <value>1</value> - <type>real</type> - </param> - <param> - <name>Seed</name> - <key>seed</key> - <value>0</value> - <type>int</type> - </param> - <source> - <name>out</name> - <type>$type</type> - </source> -</block> diff --git a/grc/blocks/gr_phase_modulator_fc.xml b/grc/blocks/gr_phase_modulator_fc.xml deleted file mode 100644 index 758c50863b..0000000000 --- a/grc/blocks/gr_phase_modulator_fc.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Phase Modulator -################################################### - --> -<block> - <name>Phase Mod</name> - <key>gr_phase_modulator_fc</key> - <import>from gnuradio import gr</import> - <make>gr.phase_modulator_fc($sensitivity)</make> - <param> - <name>Sensitivity</name> - <key>sensitivity</key> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>float</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/grc/blocks/gr_pll_carriertracking_cc.xml b/grc/blocks/gr_pll_carriertracking_cc.xml deleted file mode 100644 index 27e6732482..0000000000 --- a/grc/blocks/gr_pll_carriertracking_cc.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##PLL Carrier Tracking -################################################### - --> -<block> - <name>PLL Carrier Tracking</name> - <key>gr_pll_carriertracking_cc</key> - <import>from gnuradio import gr</import> - <make>gr.pll_carriertracking_cc($w, $max_freq, $min_freq)</make> - <callback>set_loop_bandwidth($w)</callback> - <param> - <name>Loop Bandwidth</name> - <key>w</key> - <type>real</type> - </param> - <param> - <name>Max Freq</name> - <key>max_freq</key> - <type>real</type> - </param> - <param> - <name>Min Freq</name> - <key>min_freq</key> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/grc/blocks/gr_pll_freqdet_cf.xml b/grc/blocks/gr_pll_freqdet_cf.xml deleted file mode 100644 index d6e4694f00..0000000000 --- a/grc/blocks/gr_pll_freqdet_cf.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##PLL Frequency Det -################################################### - --> -<block> - <name>PLL Freq Det</name> - <key>gr_pll_freqdet_cf</key> - <import>from gnuradio import gr</import> - <make>gr.pll_freqdet_cf($w, $max_freq, $min_freq)</make> - <callback>set_loop_bandwidth($w)</callback> - <param> - <name>Loop Bandwidth</name> - <key>w</key> - <type>real</type> - </param> - <param> - <name>Max Freq</name> - <key>max_freq</key> - <type>real</type> - </param> - <param> - <name>Min Freq</name> - <key>min_freq</key> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>float</type> - </source> -</block> diff --git a/grc/blocks/gr_pll_refout_cc.xml b/grc/blocks/gr_pll_refout_cc.xml deleted file mode 100644 index b231ddd19a..0000000000 --- a/grc/blocks/gr_pll_refout_cc.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##PLL Reference Out -################################################### - --> -<block> - <name>PLL Ref Out</name> - <key>gr_pll_refout_cc</key> - <import>from gnuradio import gr</import> - <make>gr.pll_refout_cc($w, $max_freq, $min_freq)</make> - <callback>set_loop_bandwidth($w)</callback> - <param> - <name>Loop Bandwidth</name> - <key>w</key> - <type>real</type> - </param> - <param> - <name>Max Freq</name> - <key>max_freq</key> - <type>real</type> - </param> - <param> - <name>Min Freq</name> - <key>min_freq</key> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml b/grc/blocks/gr_probe_avg_mag_sqrd_x.xml deleted file mode 100644 index 6bf706ae1c..0000000000 --- a/grc/blocks/gr_probe_avg_mag_sqrd_x.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Probe Average Magnitude Squared -################################################### - --> -<block> - <name>Probe Avg Mag^2</name> - <key>gr_probe_avg_mag_sqrd_x</key> - <import>from gnuradio import gr</import> - <make>gr.probe_avg_mag_sqrd_$(type)($threshold, $alpha)</make> - <callback>set_alpha($alpha)</callback> - <callback>set_threshold($threshold)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>c</key> - <opt>input:complex</opt> - </option> - <option> - <name>Float</name> - <key>f</key> - <opt>input:float</opt> - </option> - </param> - <param> - <name>Threshold (dB)</name> - <key>threshold</key> - <value>0</value> - <type>real</type> - </param> - <param> - <name>Alpha</name> - <key>alpha</key> - <value>1</value> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>$type.input</type> - </sink> - <doc> -Available functions to probe: level() - -Use with the function probe block. - </doc> -</block> diff --git a/grc/blocks/gr_pwr_squelch_xx.xml b/grc/blocks/gr_pwr_squelch_xx.xml deleted file mode 100644 index 08d6211770..0000000000 --- a/grc/blocks/gr_pwr_squelch_xx.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Power Squelch -################################################### - --> -<block> - <name>Power Squelch</name> - <key>gr_pwr_squelch_xx</key> - <import>from gnuradio import gr</import> - <make>gr.pwr_squelch_$(type.fcn)($threshold, $alpha, $ramp, $gate)</make> - <callback>set_threshold($threshold)</callback> - <callback>set_alpha($alpha)</callback> - <param> - <name>Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:cc</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:ff</opt> - </option> - </param> - <param> - <name>Threshold (dB)</name> - <key>threshold</key> - <type>real</type> - </param> - <param> - <name>Alpha</name> - <key>alpha</key> - <type>real</type> - </param> - <param> - <name>Ramp</name> - <key>ramp</key> - <type>int</type> - </param> - <param> - <name>Gate</name> - <key>gate</key> - <type>enum</type> - <option> - <name>Yes</name> - <key>True</key> - </option> - <option> - <name>No</name> - <key>False</key> - </option> - </param> - <sink> - <name>in</name> - <type>$type</type> - </sink> - <source> - <name>out</name> - <type>$type</type> - </source> -</block> diff --git a/grc/blocks/gr_quadrature_demod_cf.xml b/grc/blocks/gr_quadrature_demod_cf.xml deleted file mode 100644 index fad0b3879c..0000000000 --- a/grc/blocks/gr_quadrature_demod_cf.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Quadrature Demodulator -################################################### - --> -<block> - <name>Quadrature Demod</name> - <key>gr_quadrature_demod_cf</key> - <import>from gnuradio import gr</import> - <make>gr.quadrature_demod_cf($gain)</make> - <callback>set_gain($gain)</callback> - <param> - <name>Gain</name> - <key>gain</key> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>float</type> - </source> -</block> diff --git a/grc/blocks/gr_sig_source_x.xml b/grc/blocks/gr_sig_source_x.xml deleted file mode 100644 index 644cf52d0c..0000000000 --- a/grc/blocks/gr_sig_source_x.xml +++ /dev/null @@ -1,104 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Signal Source -################################################### - --> -<block> - <name>Signal Source</name> - <key>gr_sig_source_x</key> - <import>from gnuradio import gr</import> - <make>gr.sig_source_$(type.fcn)($samp_rate, $waveform, $freq, $amp, $offset)</make> - <callback>set_sampling_freq($samp_rate)</callback> - <callback>set_waveform($waveform)</callback> - <callback>set_frequency($freq)</callback> - <callback>set_amplitude($amp)</callback> - <callback>set_offset($offset)</callback> - <param> - <name>Output Type</name> - <key>type</key> - <type>enum</type> - <option> - <name>Complex</name> - <key>complex</key> - <opt>fcn:c</opt> - <opt>offset_type:complex</opt> - </option> - <option> - <name>Float</name> - <key>float</key> - <opt>fcn:f</opt> - <opt>offset_type:real</opt> - </option> - <option> - <name>Int</name> - <key>int</key> - <opt>fcn:i</opt> - <opt>offset_type:int</opt> - </option> - <option> - <name>Short</name> - <key>short</key> - <opt>fcn:s</opt> - <opt>offset_type:int</opt> - </option> - </param> - <param> - <name>Sample Rate</name> - <key>samp_rate</key> - <value>samp_rate</value> - <type>real</type> - </param> - <param> - <name>Waveform</name> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> - <type>int</type> - <option> - <name>Constant</name> - <key>gr.GR_CONST_WAVE</key> - </option> - <option> - <name>Sine</name> - <key>gr.GR_SIN_WAVE</key> - </option> - <option> - <name>Cosine</name> - <key>gr.GR_COS_WAVE</key> - </option> - <option> - <name>Square</name> - <key>gr.GR_SQR_WAVE</key> - </option> - <option> - <name>Triangle</name> - <key>gr.GR_TRI_WAVE</key> - </option> - <option> - <name>Saw Tooth</name> - <key>gr.GR_SAW_WAVE</key> - </option> - </param> - <param> - <name>Frequency</name> - <key>freq</key> - <value>1000</value> - <type>real</type> - </param> - <param> - <name>Amplitude</name> - <key>amp</key> - <value>1</value> - <type>real</type> - </param> - <param> - <name>Offset</name> - <key>offset</key> - <value>0</value> - <type>$type.offset_type</type> - </param> - <source> - <name>out</name> - <type>$type</type> - </source> -</block> diff --git a/grc/blocks/gr_simple_squelch_cc.xml b/grc/blocks/gr_simple_squelch_cc.xml deleted file mode 100644 index 5c0727f5f8..0000000000 --- a/grc/blocks/gr_simple_squelch_cc.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0"?> -<!-- -################################################### -##Simple Squelch -################################################### - --> -<block> - <name>Simple Squelch</name> - <key>gr_simple_squelch_cc</key> - <import>from gnuradio import gr</import> - <make>gr.simple_squelch_cc($threshold, $alpha)</make> - <callback>set_threshold($threshold)</callback> - <callback>set_alpha($alpha)</callback> - <param> - <name>Threshold (dB)</name> - <key>threshold</key> - <type>real</type> - </param> - <param> - <name>Alpha</name> - <key>alpha</key> - <type>real</type> - </param> - <sink> - <name>in</name> - <type>complex</type> - </sink> - <source> - <name>out</name> - <type>complex</type> - </source> -</block> diff --git a/grc/examples/simple/variable_config.grc b/grc/examples/simple/variable_config.grc index 95c287cce7..fc0d2fea6b 100644 --- a/grc/examples/simple/variable_config.grc +++ b/grc/examples/simple/variable_config.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Thu Jun 25 10:56:04 2009</timestamp> + <timestamp>Sat Nov 10 15:20:12 2012</timestamp> <block> <key>options</key> <param> @@ -36,10 +36,18 @@ <value>Custom</value> </param> <param> - <key>autostart</key> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> <value>True</value> </param> <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> <key>realtime_scheduling</key> <value></value> </param> @@ -161,6 +169,10 @@ <value></value> </param> <param> + <key>notebook</key> + <value></value> + </param> + <param> <key>_coordinate</key> <value>(429, 24)</value> </param> @@ -170,10 +182,10 @@ </param> </block> <block> - <key>gr_throttle</key> + <key>wxgui_fftsink2</key> <param> <key>id</key> - <value>gr_throttle_0</value> + <value>wxgui_fftsink2_0</value> </param> <param> <key>_enabled</key> @@ -184,59 +196,76 @@ <value>complex</value> </param> <param> - <key>samples_per_second</key> - <value>samp_rate</value> + <key>title</key> + <value>FFT Plot</value> </param> <param> - <key>vlen</key> - <value>1</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>_coordinate</key> - <value>(392, 233)</value> + <key>baseband_freq</key> + <value>0</value> </param> <param> - <key>_rotation</key> - <value>0</value> + <key>y_per_div</key> + <value>10</value> </param> - </block> - <block> - <key>gr_sig_source_x</key> <param> - <key>id</key> - <value>gr_sig_source_x_0</value> + <key>y_divs</key> + <value>10</value> </param> <param> - <key>_enabled</key> - <value>True</value> + <key>ref_level</key> + <value>50</value> </param> <param> - <key>type</key> - <value>complex</value> + <key>ref_scale</key> + <value>2.0</value> </param> <param> - <key>samp_rate</key> - <value>samp_rate</value> + <key>fft_size</key> + <value>1024</value> </param> <param> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> + <key>fft_rate</key> + <value>30</value> </param> <param> - <key>freq</key> - <value>freq</value> + <key>peak_hold</key> + <value>False</value> </param> <param> - <key>amp</key> - <value>1</value> + <key>average</key> + <value>False</value> </param> <param> - <key>offset</key> + <key>avg_alpha</key> <value>0</value> </param> <param> + <key>win</key> + <value>None</value> + </param> + <param> + <key>win_size</key> + <value></value> + </param> + <param> + <key>grid_pos</key> + <value></value> + </param> + <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>freqvar</key> + <value>None</value> + </param> + <param> <key>_coordinate</key> - <value>(148, 233)</value> + <value>(671, 233)</value> </param> <param> <key>_rotation</key> @@ -244,10 +273,10 @@ </param> </block> <block> - <key>wxgui_fftsink2</key> + <key>gr_throttle</key> <param> <key>id</key> - <value>wxgui_fftsink2_0</value> + <value>gr_throttle_0</value> </param> <param> <key>_enabled</key> @@ -258,56 +287,59 @@ <value>complex</value> </param> <param> - <key>title</key> - <value>FFT Plot</value> + <key>samples_per_second</key> + <value>samp_rate</value> </param> <param> - <key>samp_rate</key> - <value>samp_rate</value> + <key>vlen</key> + <value>1</value> </param> <param> - <key>baseband_freq</key> - <value>0</value> + <key>_coordinate</key> + <value>(392, 233)</value> </param> <param> - <key>y_per_div</key> - <value>10</value> + <key>_rotation</key> + <value>0</value> </param> + </block> + <block> + <key>analog_sig_source_x</key> <param> - <key>y_divs</key> - <value>10</value> + <key>id</key> + <value>analog_sig_source_x_0</value> </param> <param> - <key>ref_level</key> - <value>50</value> + <key>_enabled</key> + <value>True</value> </param> <param> - <key>fft_size</key> - <value>1024</value> + <key>type</key> + <value>complex</value> </param> <param> - <key>fft_rate</key> - <value>30</value> + <key>samp_rate</key> + <value>samp_rate</value> </param> <param> - <key>peak_hold</key> - <value>False</value> + <key>waveform</key> + <value>analog.GR_COS_WAVE</value> </param> <param> - <key>average</key> - <value>False</value> + <key>freq</key> + <value>freq</value> </param> <param> - <key>avg_alpha</key> - <value>0</value> + <key>amp</key> + <value>1</value> </param> <param> - <key>grid_pos</key> - <value></value> + <key>offset</key> + <value>0</value> </param> <param> <key>_coordinate</key> - <value>(671, 233)</value> + <value>(173, 201)</value> </param> <param> <key>_rotation</key> @@ -315,14 +347,14 @@ </param> </block> <connection> - <source_block_id>gr_sig_source_x_0</source_block_id> - <sink_block_id>gr_throttle_0</sink_block_id> + <source_block_id>gr_throttle_0</source_block_id> + <sink_block_id>wxgui_fftsink2_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_throttle_0</source_block_id> - <sink_block_id>wxgui_fftsink2_0</sink_block_id> + <source_block_id>analog_sig_source_x_0</source_block_id> + <sink_block_id>gr_throttle_0</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> diff --git a/grc/examples/xmlrpc/xmlrpc_server.grc b/grc/examples/xmlrpc/xmlrpc_server.grc index dc539ef1b1..ea70ded720 100644 --- a/grc/examples/xmlrpc/xmlrpc_server.grc +++ b/grc/examples/xmlrpc/xmlrpc_server.grc @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='ASCII'?> <flow_graph> - <timestamp>Thu Jul 24 14:27:42 2008</timestamp> + <timestamp>Sat Nov 10 15:20:55 2012</timestamp> <block> <key>options</key> <param> @@ -36,51 +36,24 @@ <value>Custom</value> </param> <param> - <key>_coordinate</key> - <value>(10, 10)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> - <key>gr_sig_source_x</key> - <param> - <key>id</key> - <value>gr_sig_source_x</value> + <key>run_options</key> + <value>prompt</value> </param> <param> - <key>_enabled</key> + <key>run</key> <value>True</value> </param> <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>samp_rate</key> - <value>samp_rate</value> - </param> - <param> - <key>waveform</key> - <value>gr.GR_COS_WAVE</value> - </param> - <param> - <key>freq</key> - <value>freq</value> - </param> - <param> - <key>amp</key> - <value>ampl</value> + <key>max_nouts</key> + <value>0</value> </param> <param> - <key>offset</key> - <value>offset</value> + <key>realtime_scheduling</key> + <value></value> </param> <param> <key>_coordinate</key> - <value>(162, 200)</value> + <value>(10, 10)</value> </param> <param> <key>_rotation</key> @@ -138,37 +111,6 @@ </param> </block> <block> - <key>gr_throttle</key> - <param> - <key>id</key> - <value>gr_throttle</value> - </param> - <param> - <key>_enabled</key> - <value>True</value> - </param> - <param> - <key>type</key> - <value>float</value> - </param> - <param> - <key>samples_per_second</key> - <value>samp_rate</value> - </param> - <param> - <key>vlen</key> - <value>1</value> - </param> - <param> - <key>_coordinate</key> - <value>(386, 93)</value> - </param> - <param> - <key>_rotation</key> - <value>0</value> - </param> - </block> - <block> <key>wxgui_scopesink2</key> <param> <key>id</key> @@ -191,11 +133,11 @@ <value>samp_rate</value> </param> <param> - <key>frame_decim</key> - <value>15</value> + <key>v_scale</key> + <value>0</value> </param> <param> - <key>v_scale</key> + <key>v_offset</key> <value>0</value> </param> <param> @@ -203,18 +145,38 @@ <value>.001</value> </param> <param> - <key>marker</key> - <value>set_format_line</value> + <key>ac_couple</key> + <value>False</value> + </param> + <param> + <key>xy_mode</key> + <value>False</value> </param> <param> <key>num_inputs</key> <value>1</value> </param> <param> + <key>win_size</key> + <value></value> + </param> + <param> <key>grid_pos</key> <value>0, 0, 2, 4</value> </param> <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>trig_mode</key> + <value>gr.gr_TRIG_MODE_AUTO</value> + </param> + <param> + <key>y_axis_label</key> + <value>Counts</value> + </param> + <param> <key>_coordinate</key> <value>(623, 28)</value> </param> @@ -262,6 +224,10 @@ <value>50</value> </param> <param> + <key>ref_scale</key> + <value>2.0</value> + </param> + <param> <key>fft_size</key> <value>512</value> </param> @@ -270,22 +236,38 @@ <value>15</value> </param> <param> - <key>avg_alpha</key> - <value>0</value> + <key>peak_hold</key> + <value>False</value> </param> <param> <key>average</key> <value>False</value> </param> <param> - <key>peak_hold</key> - <value>False</value> + <key>avg_alpha</key> + <value>0</value> + </param> + <param> + <key>win</key> + <value>None</value> + </param> + <param> + <key>win_size</key> + <value></value> </param> <param> <key>grid_pos</key> <value>2, 0, 2, 4</value> </param> <param> + <key>notebook</key> + <value></value> + </param> + <param> + <key>freqvar</key> + <value>None</value> + </param> + <param> <key>_coordinate</key> <value>(630, 233)</value> </param> @@ -363,22 +345,96 @@ <value>0</value> </param> </block> + <block> + <key>gr_throttle</key> + <param> + <key>id</key> + <value>gr_throttle</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>_coordinate</key> + <value>(386, 93)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_sig_source_x</key> + <param> + <key>id</key> + <value>analog_sig_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>samp_rate</key> + <value>samp_rate</value> + </param> + <param> + <key>waveform</key> + <value>analog.GR_COS_WAVE</value> + </param> + <param> + <key>freq</key> + <value>freq</value> + </param> + <param> + <key>amp</key> + <value>ampl</value> + </param> + <param> + <key>offset</key> + <value>offset</value> + </param> + <param> + <key>_coordinate</key> + <value>(164, 154)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> <connection> - <source_block_id>gr_sig_source_x</source_block_id> - <sink_block_id>gr_throttle</sink_block_id> + <source_block_id>gr_throttle</source_block_id> + <sink_block_id>wxgui_scopesink2</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> <source_block_id>gr_throttle</source_block_id> - <sink_block_id>wxgui_scopesink2</sink_block_id> + <sink_block_id>wxgui_fftsink2</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> <connection> - <source_block_id>gr_throttle</source_block_id> - <sink_block_id>wxgui_fftsink2</sink_block_id> + <source_block_id>analog_sig_source_x_0</source_block_id> + <sink_block_id>gr_throttle</sink_block_id> <source_key>0</source_key> <sink_key>0</sink_key> </connection> -</flow_graph>
\ No newline at end of file +</flow_graph> |