blob: 913a47fd8526a1b94aaa230812caae538d3e83d4 [file] [log] [blame]
Piotr Krysik47ab20e2016-07-04 21:23:51 +02001/* -*- c++ -*- */
2/* @file
Piotr Krysika6268a52017-08-23 16:02:19 +02003 * @author (C) 2016 by Piotr Krysik <ptrkrysik@gmail.com>
Piotr Krysik47ab20e2016-07-04 21:23:51 +02004 * @section LICENSE
5 *
6 * Gr-gsm is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3, or (at your option)
9 * any later version.
10 *
11 * Gr-gsm is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with gr-gsm; see the file COPYING. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23#ifndef INCLUDED_GRGSM_CONTROLLED_FRACTIONAL_RESAMPLER_CC_IMPL_H
24#define INCLUDED_GRGSM_CONTROLLED_FRACTIONAL_RESAMPLER_CC_IMPL_H
25
Piotr Krysikcab06042016-07-18 10:39:31 +020026#include <grgsm/misc_utils/controlled_fractional_resampler_cc.h>
Piotr Krysik47ab20e2016-07-04 21:23:51 +020027#include <gnuradio/filter/mmse_fir_interpolator_cc.h>
28
29using namespace gr::filter;
30
31namespace gr {
32 namespace gsm {
33
34 class controlled_fractional_resampler_cc_impl : public controlled_fractional_resampler_cc
35 {
36 private:
37 float d_mu;
38 float d_mu_inc;
39 mmse_fir_interpolator_cc *d_resamp;
Piotr Krysik21fc94d2019-07-17 10:34:42 +020040 uint64_t d_last_original_offset;
Piotr Krysik74c4f2c2016-07-15 13:12:46 +020041
Piotr Krysik47ab20e2016-07-04 21:23:51 +020042 inline uint64_t resample(const gr_complex *in,
43 uint64_t first_in_sample,
44 gr_complex *out,
45 uint64_t first_out_sample,
46 uint64_t samples_to_produce);
47
48 public:
49 controlled_fractional_resampler_cc_impl(float phase_shift,
50 float resamp_ratio);
51 ~controlled_fractional_resampler_cc_impl();
52
53 void forecast(int noutput_items,
54 gr_vector_int &ninput_items_required);
55
56 int general_work(int noutput_items,
57 gr_vector_int &ninput_items,
58 gr_vector_const_void_star &input_items,
59 gr_vector_void_star &output_items);
60
61
62 float mu() const;
63 float resamp_ratio() const;
64 void set_mu(float mu);
65 void set_resamp_ratio(float resamp_ratio);
66 };
67
Piotr Krysik264fbf62017-11-05 12:25:51 +010068 } // namespace gsm
Piotr Krysik47ab20e2016-07-04 21:23:51 +020069} // namespace gr
70
71#endif /* INCLUDED_GRGSM_CONTROLLED_FRACTIONAL_RESAMPLER_CC_IMPL_H */
72