From 8c846fb7946fb58ad9573d05bed0a71f0ba1ae73 Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 9 Oct 2009 14:34:39 -0700 Subject: [PATCH] Cleaning up GRC PAM timing example and adding ability to do M-ary PAM. --- gnuradio-examples/grc/demod/pam_timing.grc | 1037 +++++++------------- grc/blocks/gr_pfb_clock_sync.xml | 7 +- 2 files changed, 364 insertions(+), 680 deletions(-) diff --git a/gnuradio-examples/grc/demod/pam_timing.grc b/gnuradio-examples/grc/demod/pam_timing.grc index d51adb1f..ba5235fa 100644 --- a/gnuradio-examples/grc/demod/pam_timing.grc +++ b/gnuradio-examples/grc/demod/pam_timing.grc @@ -1,6 +1,6 @@ - Thu Oct 8 21:29:27 2009 + Fri Oct 9 14:21:35 2009 options @@ -76,26 +76,18 @@ - const_source_x + gr_uchar_to_float id - const_source_x_0 + gr_uchar_to_float_0_0 _enabled True - - type - float - - - const - -0.5 - _coordinate - (213, 197) + (216, 273) _rotation @@ -103,69 +95,54 @@ - gr_add_xx + variable_slider id - gr_add_xx_0 + noise_amp _enabled True - type - float - - - num_inputs - 2 - - - vlen - 1 - - - _coordinate - (440, 167) + label + Channel Noise - _rotation + value 0 - - - random_source_x - id - random_source_x_0 + min + 0 - _enabled - True + max + 1.0 - type - byte + num_steps + 1000 - min - 0 + style + wx.SL_HORIZONTAL - max - 2 + converver + float_converter - num_samps - 10000 + grid_pos + - repeat - True + notebook + _coordinate - (13, 80) + (168, 684) _rotation @@ -173,26 +150,22 @@ - gr_null_source + variable id - gr_null_source_1 + samp_rate _enabled - False - - - type - float + True - vlen - 1 + value + 32000 _coordinate - (387, 257) + (128, 9) _rotation @@ -200,57 +173,54 @@ - gr_add_xx + variable_slider id - gr_add_xx_0_1 + freq_offset _enabled True - type - float + label + Frequency Offset - num_inputs - 2 + value + 0 - vlen - 1 + min + -0.5 - _coordinate - (430, 330) + max + 0.5 - _rotation - 0 + num_steps + 1000 - - - const_source_x - id - const_source_x_0_0 + style + wx.SL_HORIZONTAL - _enabled - True + converver + float_converter - type - float + grid_pos + - const - -0.5 + notebook + _coordinate - (200, 360) + (293, 684) _rotation @@ -258,18 +228,22 @@ - gr_uchar_to_float + variable id - gr_uchar_to_float_0_0 + rrctaps _enabled True + + value + firdes.root_raised_cosine(nfilts,1.0,1.0/(spb*nfilts), .35, int(11*spb*nfilts)) + _coordinate - (216, 273) + (513, 679) _rotation @@ -277,18 +251,22 @@ - random_source_x + variable_slider id - random_source_x_0_0 + alpha _enabled True - type - byte + label + Timing Alpha + + + value + 0 min @@ -296,19 +274,31 @@ max - 2 + 10 - num_samps - 10000 + num_steps + 1000 - repeat - True + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + _coordinate - (15, 245) + (552, 4) _rotation @@ -319,7 +309,7 @@ variable_slider id - noise_amp + beta _enabled @@ -327,7 +317,7 @@ label - Channel Noise + Timing Beta value @@ -335,11 +325,11 @@ min - 0 + 0.0 max - 1.0 + 0.1 num_steps @@ -363,7 +353,30 @@ _coordinate - (168, 684) + (668, 5) + + + _rotation + 180 + + + + variable + + id + spb_gen + + + _enabled + True + + + value + 4 + + + _coordinate + (119, 841) _rotation @@ -426,10 +439,10 @@ - wxgui_scopesink2 + random_source_x id - wxgui_scopesink2_0_0_0 + random_source_x_0 _enabled @@ -437,47 +450,27 @@ type - float - - - title - Scope Plot - - - samp_rate - samp_rate - - - v_scale - 9 + byte - t_scale + min 0 - ac_couple - False - - - xy_mode - False - - - num_inputs - 1 + max + pam_amp - grid_pos - + num_samps + 10000 - notebook - notebook_0,1 + repeat + True _coordinate - (1115, 961) + (13, 80) _rotation @@ -485,10 +478,10 @@ - wxgui_scopesink2 + random_source_x id - wxgui_scopesink2_0_0_0_0 + random_source_x_0_0 _enabled @@ -496,47 +489,27 @@ type - float + byte - title - Scope Plot + min + 0 - samp_rate - samp_rate - - - v_scale - 1.25 - - - t_scale - 0 - - - ac_couple - False - - - xy_mode - False - - - num_inputs - 1 + max + pam_amp - grid_pos - + num_samps + 10000 - notebook - notebook_0,2 + repeat + True _coordinate - (1113, 844) + (15, 245) _rotation @@ -544,10 +517,10 @@ - wxgui_scopesink2 + const_source_x id - wxgui_scopesink2_0_0 + const_source_x_0 _enabled @@ -558,44 +531,12 @@ float - title - Error - - - samp_rate - samp_rate - - - v_scale - .5 - - - t_scale - 0 - - - ac_couple - False - - - xy_mode - False - - - num_inputs - 1 - - - grid_pos - - - - notebook - notebook_0,0 + const + -0.5*(pam_amp-1) _coordinate - (1113, 724) + (213, 197) _rotation @@ -603,57 +544,26 @@ - notebook + const_source_x id - notebook_0 + const_source_x_0_0 _enabled True - style - wx.NB_TOP - - - labels - ['error', 'phase', 'freq', 'FFT', 'Costas error'] - - - grid_pos - - - - notebook - - - - _coordinate - (729, 769) - - - _rotation - 0 - - - - variable - - id - samp_rate - - - _enabled - True + type + float - value - 32000 + const + -0.5*(pam_amp-1) _coordinate - (128, 9) + (200, 360) _rotation @@ -661,10 +571,10 @@ - gr_throttle + wxgui_scopesink2 id - gr_throttle_0 + wxgui_scopesink2_0_0 _enabled @@ -672,58 +582,47 @@ type - complex + float - samples_per_second - samp_rate + title + Error - vlen - 1 + samp_rate + samp_rate - _coordinate - (1129, 462) + v_scale + .5 - _rotation + t_scale 0 - - - gr_costas_loop_cc - - id - gr_costas_loop_cc_0 - - _enabled + ac_couple False - alpha - alpha_0 - - - beta - beta_0 + xy_mode + False - max_freq - 5 + num_inputs + 1 - min_freq - -5 + grid_pos + - order - 4 + notebook + notebook_0,0 _coordinate - (299, 453) + (1110, 651) _rotation @@ -731,77 +630,58 @@ - variable_slider + wxgui_scopesink2 id - freq_offset + wxgui_scopesink2_0_0_0_0 _enabled True - label - Frequency Offset + type + float - value - 0 + title + Scope Plot - min - -0.5 + samp_rate + samp_rate - max - 0.5 + v_scale + 1.25 - num_steps - 1000 + t_scale + 0 - style - wx.SL_HORIZONTAL + ac_couple + False - converver - float_converter + xy_mode + False - grid_pos - + num_inputs + 1 - notebook + grid_pos - _coordinate - (293, 684) - - - _rotation - 0 - - - - variable - - id - rrctaps - - - _enabled - True - - - value - firdes.root_raised_cosine(nfilts,1.0,1.0/(spb*nfilts), .35, int(11*spb*nfilts)) + notebook + notebook_0,2 _coordinate - (513, 679) + (1111, 767) _rotation @@ -809,10 +689,10 @@ - root_raised_cosine_filter + wxgui_scopesink2 id - root_raised_cosine_filter_0_0 + wxgui_scopesink2_0_0_0 _enabled @@ -820,82 +700,35 @@ type - interp_fir_filter_fff - - - decim - 1 - - - interp - spb_gen + float - gain - 2*spb_gen + title + Scope Plot samp_rate - 1.0 - - - sym_rate - 1./spb_gen - - - alpha - 0.35 - - - ntaps - 11*spb_gen - - - _coordinate - (564, 301) - - - _rotation - 0 - - - - variable_slider - - id - alpha - - - _enabled - True - - - label - Timing Alpha + samp_rate - value - 0 + v_scale + 9 - min + t_scale 0 - max - 10 - - - num_steps - 1000 + ac_couple + False - style - wx.SL_HORIZONTAL + xy_mode + False - converver - float_converter + num_inputs + 1 grid_pos @@ -903,11 +736,11 @@ notebook - + notebook_0,1 _coordinate - (552, 4) + (1112, 881) _rotation @@ -915,109 +748,69 @@ - variable_slider + gr_channel_model id - beta + gr_channel_model_0 _enabled True - label - Timing Beta - - - value - 0 - - - min - 0.0 - - - max - 0.1 - - - num_steps - 1000 + noise_voltage + noise_amp - style - wx.SL_HORIZONTAL + freq_offset + freq_offset - converver - float_converter + epsilon + interpratio - grid_pos - + taps + 1.0 - notebook - + seed + 42 _coordinate - (668, 5) + (59, 543) _rotation - 180 + 0 - variable_slider + gr_throttle id - alpha_0 + gr_throttle_0 _enabled - False - - - label - Freq Alpha - - - value - 0.01 - - - min - 0 - - - max - 0.1 - - - num_steps - 1000 - - - style - wx.SL_HORIZONTAL + True - converver - float_converter + type + complex - grid_pos - + samples_per_second + samp_rate - notebook - + vlen + 1 _coordinate - (792, 6) + (290, 575) _rotation @@ -1025,42 +818,22 @@ - variable_slider + notebook id - beta_0 + notebook_0 _enabled - False - - - label - Freq Beta - - - value - 0.001 - - - min - 0.0 - - - max - 0.01 - - - num_steps - 1000 + True style - wx.SL_HORIZONTAL + wx.NB_TOP - converver - float_converter + labels + ['error', 'phase', 'freq', 'Resampled Signal'] grid_pos @@ -1072,18 +845,18 @@ _coordinate - (919, 7) + (729, 769) _rotation - 180 + 0 wxgui_scopesink2 id - wxgui_scopesink2_0 + wxgui_scopesink2_0_0_1 _enabled @@ -1095,7 +868,7 @@ title - Scope Plot + Error samp_rate @@ -1103,7 +876,7 @@ v_scale - 0 + .5 t_scale @@ -1126,12 +899,35 @@ - notebook - + notebook + notebook_0,3 + + + _coordinate + (1115, 358) + + + _rotation + 0 + + + + variable + + id + spb + + + _enabled + True + + + value + 4.1 _coordinate - (1145, 258) + (32, 842) _rotation @@ -1139,10 +935,10 @@ - wxgui_scopesink2 + gr_add_xx id - wxgui_scopesink2_0_0_1 + gr_add_xx_0 _enabled @@ -1150,47 +946,50 @@ type - complex + float - title - Error + num_inputs + 2 - samp_rate - samp_rate + vlen + 1 - v_scale - .5 + _coordinate + (440, 167) - t_scale + _rotation 0 + + + gr_add_xx - ac_couple - False + id + gr_add_xx_0_1 - xy_mode - False + _enabled + True - num_inputs - 1 + type + float - grid_pos - + num_inputs + 2 - notebook - notebook_0,4 + vlen + 1 _coordinate - (1107, 533) + (430, 330) _rotation @@ -1198,22 +997,30 @@ - variable + blks2_pfb_arb_resampler_ccf id - spb_gen + blks2_pfb_arb_resampler_ccf_0 _enabled True - value - 4 + rate + float(spb)/float(spb_gen) + + + taps + firdes.low_pass(128, 128, 0.45, 0.1) + + + size + 128 _coordinate - (119, 841) + (617, 374) _rotation @@ -1236,7 +1043,7 @@ _coordinate - (904, 184) + (590, 184) _rotation @@ -1255,7 +1062,7 @@ type - interp_fir_filter_fff + interp_fir_filter_ccf decim @@ -1287,7 +1094,7 @@ _coordinate - (557, 140) + (832, 157) _rotation @@ -1295,61 +1102,58 @@ - variable + wxgui_scopesink2 id - spb + wxgui_scopesink2_0 _enabled True - value - 4.01 + type + complex - _coordinate - (32, 842) + title + Scope Plot - _rotation - 0 + samp_rate + samp_rate - - - gr_channel_model - id - gr_channel_model_0 + v_scale + 0 - _enabled - False + t_scale + 0 - noise_voltage - noise_amp + ac_couple + False - freq_offset - freq_offset + xy_mode + False - epsilon - interpratio + num_inputs + 1 - taps - 1.0 + grid_pos + - seed - 42 + notebook + _coordinate - (59, 543) + (1116, 500) _rotation @@ -1357,30 +1161,22 @@ - blks2_pfb_arb_resampler_ccf + variable id - blks2_pfb_arb_resampler_ccf_0 + nfilts _enabled True - rate - float(spb)/float(spb_gen) - - - taps - firdes.low_pass(320, 320, 0.45, 0.1) - - - size - 320 + value + 64 _coordinate - (874, 374) + (435, 686) _rotation @@ -1419,90 +1215,15 @@ init_phase - 14 - - - _coordinate - (512, 527) - - - _rotation - 0 - - - - wxgui_fftsink2 - - id - wxgui_fftsink2_0 - - - _enabled - False - - - type - complex - - - title - FFT Plot - - - samp_rate - samp_rate - - - baseband_freq - 0 - - - y_per_div - 10 + 16 - y_divs - 10 - - - ref_level - 50 - - - ref_scale - 2.0 - - - fft_size - 1024 - - - fft_rate - 30 - - - peak_hold - False - - - average - False - - - avg_alpha - 0 - - - grid_pos - - - - notebook - notebook_0,3 + max_dev + 20 _coordinate - (517, 767) + (512, 527) _rotation @@ -1513,7 +1234,7 @@ variable id - nfilts + pam_amp _enabled @@ -1521,23 +1242,17 @@ value - 64 + 16 _coordinate - (435, 686) + (223, 9) _rotation 0 - - gr_throttle_0 - wxgui_scopesink2_0 - 0 - 0 - gr_pfb_clock_sync_ccf_0 wxgui_scopesink2_0_0 @@ -1574,12 +1289,6 @@ 0 1 - - gr_add_xx_0 - root_raised_cosine_filter_0 - 0 - 0 - gr_uchar_to_float_0_0 gr_add_xx_0_1 @@ -1592,12 +1301,6 @@ 0 1 - - gr_add_xx_0_1 - root_raised_cosine_filter_0_0 - 0 - 0 - random_source_x_0_0 gr_uchar_to_float_0_0 @@ -1605,80 +1308,56 @@ 0 - gr_null_source_1 - root_raised_cosine_filter_0_0 - 0 - 0 - - - root_raised_cosine_filter_0_0 - gr_float_to_complex_0 - 0 - 1 - - - root_raised_cosine_filter_0 - gr_float_to_complex_0 + blks2_pfb_arb_resampler_ccf_0 + gr_channel_model_0 0 0 - gr_channel_model_0 - wxgui_fftsink2_0 + blks2_pfb_arb_resampler_ccf_0 + wxgui_scopesink2_0_0_1 0 0 gr_channel_model_0 - gr_costas_loop_cc_0 + gr_throttle_0 0 0 - gr_costas_loop_cc_0 + gr_throttle_0 gr_pfb_clock_sync_ccf_0 0 0 - - gr_costas_loop_cc_0 - wxgui_scopesink2_0_0_1 - 1 - 0 - gr_pfb_clock_sync_ccf_0 - gr_throttle_0 - 0 - 0 - - - gr_channel_model_0 - gr_pfb_clock_sync_ccf_0 + wxgui_scopesink2_0 0 0 - gr_float_to_complex_0 - blks2_pfb_arb_resampler_ccf_0 + gr_add_xx_0 + gr_float_to_complex_0 0 0 - blks2_pfb_arb_resampler_ccf_0 - gr_channel_model_0 + gr_add_xx_0_1 + gr_float_to_complex_0 0 - 0 + 1 - blks2_pfb_arb_resampler_ccf_0 - wxgui_scopesink2_0_0_1 + gr_float_to_complex_0 + root_raised_cosine_filter_0 0 0 - blks2_pfb_arb_resampler_ccf_0 - gr_pfb_clock_sync_ccf_0 + root_raised_cosine_filter_0 + blks2_pfb_arb_resampler_ccf_0 0 0 diff --git a/grc/blocks/gr_pfb_clock_sync.xml b/grc/blocks/gr_pfb_clock_sync.xml index 670d5b46..9cb909ac 100644 --- a/grc/blocks/gr_pfb_clock_sync.xml +++ b/grc/blocks/gr_pfb_clock_sync.xml @@ -8,7 +8,7 @@ Polyphase Clock Sync gr_pfb_clock_sync_ccf from gnuradio import gr - gr.pfb_clock_sync_ccf($sps, $alpha, $taps, $filter_size, $init_phase) + gr.pfb_clock_sync_ccf($sps, $alpha, $taps, $filter_size, $init_phase, $max_dev) self.$(id).set_beta($beta) set_taps($taps) set_alpha($alpha) @@ -44,6 +44,11 @@ self.$(id).set_beta($beta) init_phase real + + Maximum Rate Deviation + max_dev + real + in complex -- 2.30.2