From 7b527030c4f2e207f93942a884ad9bac772db5cc Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 7 Oct 2009 18:32:35 -0700 Subject: [PATCH] Adding imaginary stream to PAM demo to test IQ sync. Also properly setting beta at runtime from GRC block. --- gnuradio-examples/grc/demod/pam_timing.grc | 791 +++++++++++++-------- grc/blocks/gr_pfb_clock_sync.xml | 3 +- 2 files changed, 496 insertions(+), 298 deletions(-) diff --git a/gnuradio-examples/grc/demod/pam_timing.grc b/gnuradio-examples/grc/demod/pam_timing.grc index 21fb63ab..3acca51a 100644 --- a/gnuradio-examples/grc/demod/pam_timing.grc +++ b/gnuradio-examples/grc/demod/pam_timing.grc @@ -1,6 +1,6 @@ - Wed Oct 7 11:00:26 2009 + Wed Oct 7 18:31:11 2009 options @@ -57,38 +57,68 @@ - random_source_x + variable id - random_source_x_0 + spb _enabled True - type - byte + value + 4 - min + _coordinate + (34, 915) + + + _rotation 0 + + + variable - max - 2 + id + nfilts - num_samps - 1000 + _enabled + True - repeat + value + 32 + + + _coordinate + (31, 828) + + + _rotation + 0 + + + + variable + + id + initphase + + + _enabled True + + value + 0.5 + _coordinate - (13, 80) + (110, 913) _rotation @@ -96,26 +126,45 @@ - const_source_x + variable id - const_source_x_0 + rrctaps _enabled True - type - float + value + firdes.root_raised_cosine(nfilts,1.0,1.0/(spb*nfilts), .35, 11*spb*nfilts) - const - -0.5 + _coordinate + (110, 830) + + + _rotation + 0 + + + + variable + + id + samp_rate + + + _enabled + True + + + value + 320000 _coordinate - (179, 160) + (128, 9) _rotation @@ -170,7 +219,7 @@ _coordinate - (600, -1) + (440, 3) _rotation @@ -178,34 +227,45 @@ - gr_noise_source_x + gr_uchar_to_float id - gr_noise_source_x_0 + gr_uchar_to_float_0 _enabled True - type - float + _coordinate + (217, 108) - noise_type - gr.GR_GAUSSIAN + _rotation + 0 + + + const_source_x - amp - noise_amp + id + const_source_x_0 - seed - 42 + _enabled + True + + + type + float + + + const + -0.5 _coordinate - (45, 497) + (213, 197) _rotation @@ -213,10 +273,10 @@ - root_raised_cosine_filter + gr_add_xx id - root_raised_cosine_filter_0 + gr_add_xx_0 _enabled @@ -224,70 +284,78 @@ type - interp_fir_filter_fff + float - decim + num_inputs + 2 + + + vlen 1 - interp - spb + _coordinate + (440, 167) - gain - 2*spb + _rotation + 0 + + + wxgui_scopesink2 - samp_rate - 1.0 + id + wxgui_scopesink2_0 - sym_rate - 1./spb + _enabled + True - alpha - 0.35 + type + complex - ntaps - 11*spb + title + Scope Plot - _coordinate - (50, 295) + samp_rate + samp_rate - _rotation + v_scale 0 - - - gr_add_xx - id - gr_add_xx_0_0 + t_scale + 0 - _enabled - True + ac_couple + False - type - float + xy_mode + False num_inputs - 2 + 1 - vlen - 1 + grid_pos + + + + notebook + _coordinate - (375, 390) + (1155, 281) _rotation @@ -295,10 +363,10 @@ - const_source_x + gr_throttle id - const_source_x_1 + gr_throttle_0 _enabled @@ -306,15 +374,19 @@ type - float + complex - const - 0 + samples_per_second + samp_rate + + + vlen + 1 _coordinate - (36, 723) + (1128, 428) _rotation @@ -322,22 +394,30 @@ - variable + gr_fractional_interpolator_xx id - spb + gr_fractional_interpolator_xx_0 _enabled True - value - 4 + type + complex + + + phase_shift + initphase + + + interp_ratio + interpratio _coordinate - (34, 915) + (116, 530) _rotation @@ -345,22 +425,34 @@ - variable + gr_noise_source_x id - nfilts + gr_noise_source_x_0 _enabled True - value - 32 + type + complex + + + noise_type + gr.GR_GAUSSIAN + + + amp + noise_amp + + + seed + 42 _coordinate - (31, 828) + (148, 595) _rotation @@ -368,10 +460,10 @@ - gr_throttle + gr_add_xx id - gr_throttle_0 + gr_add_xx_0_0 _enabled @@ -382,8 +474,8 @@ complex - samples_per_second - samp_rate + num_inputs + 2 vlen @@ -391,7 +483,7 @@ _coordinate - (757, 418) + (393, 561) _rotation @@ -399,18 +491,42 @@ - gr_uchar_to_float + gr_pfb_clock_sync_ccf id - gr_uchar_to_float_0 + gr_pfb_clock_sync_ccf_0 _enabled True + + sps + spb + + + alpha + alpha + + + beta + beta + + + taps + rrctaps + + + filter_size + nfilts + + + init_phase + 14 + _coordinate - (261, 107) + (511, 527) _rotation @@ -418,22 +534,58 @@ - gr_float_to_complex + wxgui_scopesink2 id - gr_float_to_complex_0 + wxgui_scopesink2_0_0 _enabled True - vlen + type + 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 + _coordinate - (380, 553) + (1068, 553) _rotation @@ -441,22 +593,34 @@ - variable + notebook id - samp_rate + notebook_0 _enabled True - value - 320000 + style + wx.NB_TOP + + + labels + ['error', 'phase', 'freq'] + + + grid_pos + + + + notebook + _coordinate - (128, 9) + (964, 466) _rotation @@ -467,7 +631,7 @@ wxgui_scopesink2 id - wxgui_scopesink2_0 + wxgui_scopesink2_0_0_0_0 _enabled @@ -475,7 +639,7 @@ type - complex + float title @@ -487,7 +651,7 @@ v_scale - 0 + 1.25 t_scale @@ -511,11 +675,11 @@ notebook - + notebook_0,2 _coordinate - (789, 258) + (1068, 673) _rotation @@ -523,10 +687,10 @@ - gr_add_xx + wxgui_scopesink2 id - gr_add_xx_0 + wxgui_scopesink2_0_0_0 _enabled @@ -537,39 +701,32 @@ float - num_inputs - 2 + title + Scope Plot - vlen - 1 + samp_rate + samp_rate - _coordinate - (482, 130) + v_scale + 9 - _rotation + t_scale 0 - - - notebook - id - notebook_0 - - - _enabled - True + ac_couple + False - style - wx.NB_TOP + xy_mode + False - labels - ['error', 'phase', 'freq'] + num_inputs + 1 grid_pos @@ -577,11 +734,11 @@ notebook - + notebook_0,1 _coordinate - (851, 531) + (1070, 790) _rotation @@ -589,22 +746,38 @@ - variable + random_source_x id - initphase + random_source_x_0 _enabled True - value - 0.5 + type + byte + + + min + 0 + + + max + 2 + + + num_samps + 10000 + + + repeat + True _coordinate - (110, 913) + (13, 80) _rotation @@ -612,10 +785,10 @@ - gr_fractional_interpolator_xx + root_raised_cosine_filter id - gr_fractional_interpolator_xx_0 + root_raised_cosine_filter_0 _enabled @@ -623,19 +796,39 @@ type - complex + interp_fir_filter_fff - phase_shift - initphase + decim + 1 - interp_ratio - interpratio + interp + spb + + + gain + 2*spb + + + samp_rate + 1.0 + + + sym_rate + 1./spb + + + alpha + 0.35 + + + ntaps + 11*spb _coordinate - (349, 662) + (557, 140) _rotation @@ -643,10 +836,10 @@ - wxgui_scopesink2 + root_raised_cosine_filter id - wxgui_scopesink2_0_0 + root_raised_cosine_filter_0_0 _enabled @@ -654,47 +847,39 @@ type - float - - - title - Error - - - samp_rate - samp_rate + interp_fir_filter_fff - v_scale - .5 + decim + 1 - t_scale - 0 + interp + spb - ac_couple - False + gain + 2*spb - xy_mode - False + samp_rate + 1.0 - num_inputs - 1 + sym_rate + 1./spb - grid_pos - + alpha + 0.35 - notebook - notebook_0,0 + ntaps + 11*spb _coordinate - (798, 638) + (559, 303) _rotation @@ -702,58 +887,49 @@ - wxgui_scopesink2 + gr_float_to_complex id - wxgui_scopesink2_0_0_0 + gr_float_to_complex_0 _enabled True - type - float - - - title - Scope Plot - - - samp_rate - samp_rate + vlen + 1 - v_scale - 9 + _coordinate + (897, 272) - t_scale + _rotation 0 + + + gr_null_source - ac_couple - False + id + gr_null_source_1 - xy_mode + _enabled False - num_inputs - 1 - - - grid_pos - + type + float - notebook - notebook_0,1 + vlen + 1 _coordinate - (792, 777) + (387, 257) _rotation @@ -761,10 +937,10 @@ - wxgui_scopesink2 + gr_add_xx id - wxgui_scopesink2_0_0_0_0 + gr_add_xx_0_1 _enabled @@ -775,44 +951,43 @@ float - title - Scope Plot + num_inputs + 2 - samp_rate - samp_rate + vlen + 1 - v_scale - 1.25 + _coordinate + (430, 330) - t_scale + _rotation 0 + + + const_source_x - ac_couple - False - - - xy_mode - False + id + const_source_x_0_0 - num_inputs - 1 + _enabled + True - grid_pos - + type + float - notebook - notebook_0,2 + const + -0.5 _coordinate - (797, 915) + (200, 360) _rotation @@ -820,65 +995,57 @@ - gr_pfb_clock_sync_ccf + gr_uchar_to_float id - gr_pfb_clock_sync_ccf_0 + gr_uchar_to_float_0_0 _enabled True - sps - spb - - - alpha - alpha - - - beta - beta + _coordinate + (216, 273) - taps - rrctaps + _rotation + 0 + + + random_source_x - filter_size - nfilts + id + random_source_x_0_0 - init_phase - 14 + _enabled + True - _coordinate - (346, 773) + type + byte - _rotation + min 0 - - - variable - id - rrctaps + max + 2 - _enabled - True + num_samps + 10000 - value - firdes.root_raised_cosine(nfilts,1.0,1.0/(spb*nfilts), .35, 11*spb*nfilts) + repeat + True _coordinate - (110, 830) + (15, 245) _rotation @@ -889,7 +1056,7 @@ variable_slider id - beta + alpha _enabled @@ -897,19 +1064,19 @@ label - Beta + Alpha value - 10e-3 + 2 min - 0.0 + 0 max - 0.1 + 10 num_steps @@ -933,7 +1100,7 @@ _coordinate - (871, 0) + (552, 4) _rotation @@ -944,7 +1111,7 @@ variable_slider id - alpha + interpratio _enabled @@ -952,19 +1119,19 @@ label - Alpha + value - 2 + 1.001 min - 0 + 0.9 max - 10 + 1.1 num_steps @@ -988,18 +1155,18 @@ _coordinate - (757, -1) + (802, 3) _rotation - 0 + 180 variable_slider id - interpratio + beta _enabled @@ -1007,19 +1174,19 @@ label - + Beta value - 1.001 + 20e-3 min - 0 + 0.0 max - 2 + 0.1 num_steps @@ -1043,7 +1210,7 @@ _coordinate - (757, 133) + (668, 5) _rotation @@ -1051,93 +1218,123 @@ - random_source_x_0 - gr_uchar_to_float_0 + gr_throttle_0 + wxgui_scopesink2_0 0 0 - gr_uchar_to_float_0 - gr_add_xx_0 + gr_noise_source_x_0 + gr_add_xx_0_0 0 - 0 + 1 - const_source_x_0 - gr_add_xx_0 + gr_pfb_clock_sync_ccf_0 + gr_throttle_0 0 - 1 + 0 - gr_add_xx_0 - root_raised_cosine_filter_0 + gr_pfb_clock_sync_ccf_0 + wxgui_scopesink2_0_0 + 1 + 0 + + + gr_float_to_complex_0 + gr_fractional_interpolator_xx_0 0 0 - gr_throttle_0 - wxgui_scopesink2_0 + gr_pfb_clock_sync_ccf_0 + wxgui_scopesink2_0_0_0 + 3 + 0 + + + gr_pfb_clock_sync_ccf_0 + wxgui_scopesink2_0_0_0_0 + 2 + 0 + + + random_source_x_0 + gr_uchar_to_float_0 0 0 - root_raised_cosine_filter_0 - gr_add_xx_0_0 + gr_uchar_to_float_0 + gr_add_xx_0 0 0 - gr_noise_source_x_0 - gr_add_xx_0_0 + const_source_x_0 + gr_add_xx_0 0 1 - gr_add_xx_0_0 - gr_float_to_complex_0 + gr_add_xx_0 + root_raised_cosine_filter_0 0 0 - const_source_x_1 - gr_float_to_complex_0 + gr_uchar_to_float_0_0 + gr_add_xx_0_1 + 0 + 0 + + + const_source_x_0_0 + gr_add_xx_0_1 0 1 - gr_pfb_clock_sync_ccf_0 - gr_throttle_0 + gr_add_xx_0_1 + root_raised_cosine_filter_0_0 0 0 - gr_pfb_clock_sync_ccf_0 - wxgui_scopesink2_0_0 - 1 + random_source_x_0_0 + gr_uchar_to_float_0_0 + 0 0 - gr_float_to_complex_0 - gr_fractional_interpolator_xx_0 + gr_fractional_interpolator_xx_0 + gr_add_xx_0_0 0 0 - gr_fractional_interpolator_xx_0 + gr_add_xx_0_0 gr_pfb_clock_sync_ccf_0 0 0 - gr_pfb_clock_sync_ccf_0 - wxgui_scopesink2_0_0_0 - 3 + gr_null_source_1 + root_raised_cosine_filter_0_0 + 0 0 - gr_pfb_clock_sync_ccf_0 - wxgui_scopesink2_0_0_0_0 - 2 + root_raised_cosine_filter_0 + gr_float_to_complex_0 + 0 + 1 + + + root_raised_cosine_filter_0_0 + gr_float_to_complex_0 + 0 0 diff --git a/grc/blocks/gr_pfb_clock_sync.xml b/grc/blocks/gr_pfb_clock_sync.xml index e62ab84a..670d5b46 100644 --- a/grc/blocks/gr_pfb_clock_sync.xml +++ b/grc/blocks/gr_pfb_clock_sync.xml @@ -8,7 +8,8 @@ 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) +self.$(id).set_beta($beta) set_taps($taps) set_alpha($alpha) set_beta($beta) -- 2.30.2