3 * Copyright 2002 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
23 #include <GrAtscSegSymSyncImpl.h>
24 #include <GrAtscSegSymSyncImpl_export.h>
28 GrAtscSegSymSyncImpl::GrAtscSegSymSyncImpl (
29 double nominal_ratio_of_rx_clock_to_symbol_freq)
30 : d_interp (nominal_ratio_of_rx_clock_to_symbol_freq)
32 // set approximate decimation rate for superclass's benefit
33 decimation = (int) rint (nominal_ratio_of_rx_clock_to_symbol_freq);
35 history = 1500; // spare input samples in case we need them.
40 d_rx_clock_to_symbol_freq = nominal_ratio_of_rx_clock_to_symbol_freq;
43 GrAtscSegSymSyncImpl::~GrAtscSegSymSyncImpl ()
49 GrAtscSegSymSyncImpl::pre_initialize ()
51 setSamplingFrequency (
52 getInputSamplingFrequencyN (0) / d_rx_clock_to_symbol_freq);
56 GrAtscSegSymSyncImpl::forecast (VrSampleRange output,
57 VrSampleRange inputs[])
59 assert (numberInputs == 1); // I hate these free references to
60 // superclass's instance variables...
62 inputs[0].index = d_next_input;
64 ((long unsigned int) (output.size * d_rx_clock_to_symbol_freq)
71 GrAtscSegSymSyncImpl::work (VrSampleRange output, void *ao[],
72 VrSampleRange inputs[], void *ai[])
75 float *input_samples = ((float **) ai)[0];
76 float *output_samples = ((float **) ao)[0];
77 atsc::syminfo *output_info = ((atsc::syminfo **) ao)[1];
87 GrAtscSegSymSyncImpl::reset ()
95 * Exported constructor.
96 * Doesn't expose any of the internals or our compile time dependencies.
100 create_GrAtscSegSymSyncImpl (double nominal_ratio_of_rx_clock_to_symbol_freq)
102 return new GrAtscSegSymSyncImpl (nominal_ratio_of_rx_clock_to_symbol_freq);