From a8d8b8355478ac127efb775d4f6e900f1c830090 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 7 Oct 2009 20:53:30 -0700 Subject: [PATCH] Adding channel model to simulation to test frequency offset. --- gnuradio-examples/grc/demod/pam_timing.grc | 1295 ++++++++++++-------- 1 file changed, 781 insertions(+), 514 deletions(-) diff --git a/gnuradio-examples/grc/demod/pam_timing.grc b/gnuradio-examples/grc/demod/pam_timing.grc index 3acca51a..a0dc6642 100644 --- a/gnuradio-examples/grc/demod/pam_timing.grc +++ b/gnuradio-examples/grc/demod/pam_timing.grc @@ -1,6 +1,6 @@ - Wed Oct 7 18:31:11 2009 + Wed Oct 7 20:47:05 2009 options @@ -60,7 +60,7 @@ variable id - spb + samp_rate _enabled @@ -68,11 +68,11 @@ value - 4 + 320000 _coordinate - (34, 915) + (128, 9) _rotation @@ -80,22 +80,18 @@ - variable + gr_uchar_to_float id - nfilts + gr_uchar_to_float_0 _enabled True - - value - 32 - _coordinate - (31, 828) + (217, 108) _rotation @@ -103,22 +99,26 @@ - variable + const_source_x id - initphase + const_source_x_0 _enabled True - value - 0.5 + type + float + + + const + -0.5 _coordinate - (110, 913) + (213, 197) _rotation @@ -126,45 +126,30 @@ - variable + gr_add_xx id - rrctaps + gr_add_xx_0 _enabled True - value - firdes.root_raised_cosine(nfilts,1.0,1.0/(spb*nfilts), .35, 11*spb*nfilts) - - - _coordinate - (110, 830) - - - _rotation - 0 - - - - variable - - id - samp_rate + type + float - _enabled - True + num_inputs + 2 - value - 320000 + vlen + 1 _coordinate - (128, 9) + (440, 167) _rotation @@ -172,22 +157,18 @@ - variable_slider + random_source_x id - noise_amp + random_source_x_0 _enabled True - label - noise_amp - - - value - 0 + type + byte min @@ -195,50 +176,19 @@ max - 1.0 - - - num_steps - 1000 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (440, 3) - - - _rotation - 0 + 2 - - - gr_uchar_to_float - id - gr_uchar_to_float_0 + num_samps + 10000 - _enabled + repeat True _coordinate - (217, 108) + (13, 80) _rotation @@ -246,26 +196,26 @@ - const_source_x + gr_null_source id - const_source_x_0 + gr_null_source_1 _enabled - True + False type float - const - -0.5 + vlen + 1 _coordinate - (213, 197) + (387, 257) _rotation @@ -276,7 +226,7 @@ gr_add_xx id - gr_add_xx_0 + gr_add_xx_0_1 _enabled @@ -296,7 +246,7 @@ _coordinate - (440, 167) + (430, 330) _rotation @@ -304,10 +254,10 @@ - wxgui_scopesink2 + const_source_x id - wxgui_scopesink2_0 + const_source_x_0_0 _enabled @@ -315,47 +265,34 @@ type - complex - - - title - Scope Plot + float - samp_rate - samp_rate + const + -0.5 - v_scale - 0 + _coordinate + (200, 360) - t_scale + _rotation 0 + + + gr_uchar_to_float - ac_couple - False - - - xy_mode - False - - - num_inputs - 1 - - - grid_pos - + id + gr_uchar_to_float_0_0 - notebook - + _enabled + True _coordinate - (1155, 281) + (216, 273) _rotation @@ -363,10 +300,10 @@ - gr_throttle + random_source_x id - gr_throttle_0 + random_source_x_0_0 _enabled @@ -374,19 +311,27 @@ type - complex + byte - samples_per_second - samp_rate + min + 0 - vlen - 1 + max + 2 + + + num_samps + 10000 + + + repeat + True _coordinate - (1128, 428) + (15, 245) _rotation @@ -394,30 +339,22 @@ - gr_fractional_interpolator_xx + variable id - gr_fractional_interpolator_xx_0 + rrctaps _enabled True - type - complex - - - phase_shift - initphase - - - interp_ratio - interpratio + value + firdes.root_raised_cosine(nfilts,1.0,1.0/(spb*nfilts), .35, 11*spb*nfilts) _coordinate - (116, 530) + (513, 679) _rotation @@ -425,10 +362,10 @@ - gr_noise_source_x + root_raised_cosine_filter id - gr_noise_source_x_0 + root_raised_cosine_filter_0_0 _enabled @@ -436,54 +373,39 @@ type - complex - - - noise_type - gr.GR_GAUSSIAN - - - amp - noise_amp - - - seed - 42 + interp_fir_filter_fff - _coordinate - (148, 595) + decim + 1 - _rotation - 0 + interp + spb - - - gr_add_xx - id - gr_add_xx_0_0 + gain + 2*spb - _enabled - True + samp_rate + 1.0 - type - complex + sym_rate + 1./spb - num_inputs - 2 + alpha + 0.35 - vlen - 1 + ntaps + 11*spb _coordinate - (393, 561) + (559, 303) _rotation @@ -491,42 +413,477 @@ - gr_pfb_clock_sync_ccf + root_raised_cosine_filter id - gr_pfb_clock_sync_ccf_0 + root_raised_cosine_filter_0 _enabled True - sps - spb + type + interp_fir_filter_fff - alpha + decim + 1 + + + interp + spb + + + gain + 2*spb + + + samp_rate + 1.0 + + + sym_rate + 1./spb + + + alpha + 0.35 + + + ntaps + 11*spb + + + _coordinate + (557, 140) + + + _rotation + 0 + + + + gr_float_to_complex + + id + gr_float_to_complex_0 + + + _enabled + True + + + vlen + 1 + + + _coordinate + (897, 272) + + + _rotation + 0 + + + + variable_slider + + id + noise_amp + + + _enabled + True + + + label + Channel Noise + + + value + 0 + + + min + 0 + + + max + 1.0 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (168, 684) + + + _rotation + 0 + + + + variable + + id + nfilts + + + _enabled + True + + + value + 32 + + + _coordinate + (435, 686) + + + _rotation + 0 + + + + variable_slider + + id + beta + + + _enabled + True + + + label + Timing Beta + + + value + 20e-3 + + + min + 0.0 + + + max + 0.1 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (668, 5) + + + _rotation + 180 + + + + variable_slider + + id alpha - beta - beta + _enabled + True + + + label + Timing Alpha + + + value + 2 + + + min + 0 + + + max + 10 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (552, 4) + + + _rotation + 0 + + + + wxgui_scopesink2 + + id + wxgui_scopesink2_0 + + + _enabled + True + + + type + complex + + + title + Scope Plot + + + samp_rate + samp_rate + + + v_scale + 0 + + + t_scale + 0 + + + ac_couple + False + + + xy_mode + False + + + num_inputs + 1 + + + grid_pos + + + + notebook + + + + _coordinate + (1133, 325) + + + _rotation + 0 + + + + variable_slider + + id + freq_offset + + + _enabled + True + + + label + Frequency Offset + + + value + 0 + + + min + -0.5 + + + max + 0.5 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (293, 684) + + + _rotation + 0 + + + + variable + + id + spb + + + _enabled + True + + + value + 4 + + + _coordinate + (436, 752) + + + _rotation + 0 + + + + wxgui_fftsink2 + + id + wxgui_fftsink2_0 + + + _enabled + True + + + type + complex + + + title + FFT Plot + + + samp_rate + samp_rate + + + baseband_freq + 0 + + + y_per_div + 10 + + + y_divs + 10 + + + ref_level + 50 + + + ref_scale + 2.0 + + + fft_size + 1024 + + + fft_rate + 30 + + + peak_hold + False + + + average + False - taps - rrctaps + avg_alpha + 0 - filter_size - nfilts + grid_pos + - init_phase - 14 + notebook + notebook_0,3 _coordinate - (511, 527) + (517, 767) _rotation @@ -534,46 +891,42 @@ - wxgui_scopesink2 + variable_slider id - wxgui_scopesink2_0_0 + interpratio _enabled True - type - float - - - title - Error + label + Timing Offset - samp_rate - samp_rate + value + 1.00 - v_scale - .5 + min + 0.9 - t_scale - 0 + max + 1.1 - ac_couple - False + num_steps + 1000 - xy_mode - False + style + wx.SL_HORIZONTAL - num_inputs - 1 + converver + float_converter grid_pos @@ -581,34 +934,54 @@ notebook - notebook_0,0 + _coordinate - (1068, 553) + (40, 684) _rotation - 0 + 180 - notebook + variable_slider id - notebook_0 + beta_0 _enabled True + + label + Freq Beta + + + value + 0.001 + + + min + 0.0 + + + max + 0.01 + + + num_steps + 1000 + style - wx.NB_TOP + wx.SL_HORIZONTAL - labels - ['error', 'phase', 'freq'] + converver + float_converter grid_pos @@ -620,54 +993,50 @@ _coordinate - (964, 466) + (919, 7) _rotation - 0 + 180 - wxgui_scopesink2 + variable_slider id - wxgui_scopesink2_0_0_0_0 + alpha_0 _enabled True - type - float - - - title - Scope Plot + label + Freq Alpha - samp_rate - samp_rate + value + 0.01 - v_scale - 1.25 + min + 0 - t_scale - 0 + max + 0.1 - ac_couple - False + num_steps + 1000 - xy_mode - False + style + wx.SL_HORIZONTAL - num_inputs - 1 + converver + float_converter grid_pos @@ -675,11 +1044,11 @@ notebook - notebook_0,2 + _coordinate - (1068, 673) + (792, 6) _rotation @@ -738,7 +1107,7 @@ _coordinate - (1070, 790) + (1115, 961) _rotation @@ -746,10 +1115,10 @@ - random_source_x + wxgui_scopesink2 id - random_source_x_0 + wxgui_scopesink2_0_0_0_0 _enabled @@ -757,78 +1126,47 @@ type - byte - - - min - 0 - - - max - 2 + float - num_samps - 10000 + title + Scope Plot - repeat - True + samp_rate + samp_rate - _coordinate - (13, 80) + v_scale + 1.25 - _rotation + t_scale 0 - - - root_raised_cosine_filter - - id - root_raised_cosine_filter_0 - - _enabled - True + ac_couple + False - type - interp_fir_filter_fff + xy_mode + False - decim + num_inputs 1 - interp - spb - - - gain - 2*spb - - - samp_rate - 1.0 - - - sym_rate - 1./spb - - - alpha - 0.35 + grid_pos + - ntaps - 11*spb + notebook + notebook_0,2 _coordinate - (557, 140) + (1113, 844) _rotation @@ -836,10 +1174,10 @@ - root_raised_cosine_filter + wxgui_scopesink2 id - root_raised_cosine_filter_0_0 + wxgui_scopesink2_0_0 _enabled @@ -847,89 +1185,47 @@ type - interp_fir_filter_fff - - - decim - 1 - - - interp - spb + float - gain - 2*spb + title + Error samp_rate - 1.0 - - - sym_rate - 1./spb - - - alpha - 0.35 - - - ntaps - 11*spb - - - _coordinate - (559, 303) - - - _rotation - 0 - - - - gr_float_to_complex - - id - gr_float_to_complex_0 - - - _enabled - True - - - vlen - 1 + samp_rate - _coordinate - (897, 272) + v_scale + .5 - _rotation + t_scale 0 - - - gr_null_source - id - gr_null_source_1 + ac_couple + False - _enabled + xy_mode False - type - float + num_inputs + 1 + + + grid_pos + - vlen - 1 + notebook + notebook_0,0 _coordinate - (387, 257) + (1113, 724) _rotation @@ -937,10 +1233,10 @@ - gr_add_xx + wxgui_scopesink2 id - gr_add_xx_0_1 + wxgui_scopesink2_0_0_1 _enabled @@ -948,46 +1244,47 @@ type - float + complex - num_inputs - 2 + title + Error - vlen - 1 + samp_rate + samp_rate - _coordinate - (430, 330) + v_scale + .5 - _rotation + t_scale 0 - - - const_source_x - id - const_source_x_0_0 + ac_couple + False - _enabled - True + xy_mode + False - type - float + num_inputs + 1 - const - -0.5 + grid_pos + + + + notebook + notebook_0,4 _coordinate - (200, 360) + (1111, 518) _rotation @@ -995,18 +1292,34 @@ - gr_uchar_to_float + notebook id - gr_uchar_to_float_0_0 + notebook_0 _enabled True + + style + wx.NB_TOP + + + labels + ['error', 'phase', 'freq', 'FFT', 'Costas error'] + + + grid_pos + + + + notebook + + _coordinate - (216, 273) + (729, 769) _rotation @@ -1014,38 +1327,38 @@ - random_source_x + gr_channel_model id - random_source_x_0_0 + gr_channel_model_0 _enabled True - type - byte + noise_voltage + noise_amp - min - 0 + freq_offset + freq_offset - max - 2 + epsilon + interpratio - num_samps - 10000 + taps + 1.0 + 1.0j - repeat - True + seed + 42 _coordinate - (15, 245) + (65, 542) _rotation @@ -1053,54 +1366,42 @@ - variable_slider + gr_pfb_clock_sync_ccf id - alpha + gr_pfb_clock_sync_ccf_0 _enabled True - label - Alpha - - - value - 2 - - - min - 0 - - - max - 10 + sps + spb - num_steps - 1000 + alpha + alpha - style - wx.SL_HORIZONTAL + beta + beta - converver - float_converter + taps + rrctaps - grid_pos - + filter_size + nfilts - notebook - + init_phase + 14 _coordinate - (552, 4) + (512, 527) _rotation @@ -1108,113 +1409,73 @@ - variable_slider + gr_throttle id - interpratio + gr_throttle_0 _enabled True - label - - - - value - 1.001 - - - min - 0.9 - - - max - 1.1 - - - num_steps - 1000 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter + type + complex - grid_pos - + samples_per_second + samp_rate - notebook - + vlen + 1 _coordinate - (802, 3) + (1129, 462) _rotation - 180 + 0 - variable_slider + gr_costas_loop_cc id - beta + gr_costas_loop_cc_0 _enabled True - label - Beta - - - value - 20e-3 - - - min - 0.0 - - - max - 0.1 - - - num_steps - 1000 + alpha + alpha_0 - style - wx.SL_HORIZONTAL + beta + beta_0 - converver - float_converter + max_freq + 5 - grid_pos - + min_freq + -5 - notebook - + order + 4 _coordinate - (668, 5) + (916, 473) _rotation - 180 + 0 @@ -1223,30 +1484,12 @@ 0 0 - - gr_noise_source_x_0 - gr_add_xx_0_0 - 0 - 1 - - - gr_pfb_clock_sync_ccf_0 - gr_throttle_0 - 0 - 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_pfb_clock_sync_ccf_0 wxgui_scopesink2_0_0_0 @@ -1308,32 +1551,56 @@ 0 - gr_fractional_interpolator_xx_0 - gr_add_xx_0_0 + gr_null_source_1 + root_raised_cosine_filter_0_0 0 0 - gr_add_xx_0_0 - gr_pfb_clock_sync_ccf_0 + root_raised_cosine_filter_0_0 + gr_float_to_complex_0 + 0 + 1 + + + root_raised_cosine_filter_0 + gr_float_to_complex_0 0 0 - gr_null_source_1 - root_raised_cosine_filter_0_0 + gr_float_to_complex_0 + gr_channel_model_0 0 0 - root_raised_cosine_filter_0 - gr_float_to_complex_0 + gr_channel_model_0 + wxgui_fftsink2_0 0 - 1 + 0 - root_raised_cosine_filter_0_0 - gr_float_to_complex_0 + gr_costas_loop_cc_0 + wxgui_scopesink2_0_0_1 + 1 + 0 + + + gr_channel_model_0 + gr_pfb_clock_sync_ccf_0 + 0 + 0 + + + gr_pfb_clock_sync_ccf_0 + gr_costas_loop_cc_0 + 0 + 0 + + + gr_costas_loop_cc_0 + gr_throttle_0 0 0 -- 2.39.5