blob: dab8a0b1122a98378a69b081a81b9673d6b319db [file] [log] [blame]
Piotr Krysik47ab20e2016-07-04 21:23:51 +02001/* -*- c++ -*- */
2/* @file
3 * @author Piotr Krysik <ptrkrysik@gmail.com>
4 * @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
26#include <grgsm/controlled_fractional_resampler_cc.h>
27//#include <gnuradio/filter/fractional_resampler_cc.h>
28#include <gnuradio/filter/mmse_fir_interpolator_cc.h>
29
30using namespace gr::filter;
31
32namespace gr {
33 namespace gsm {
34
35 class controlled_fractional_resampler_cc_impl : public controlled_fractional_resampler_cc
36 {
37 private:
38 float d_mu;
39 float d_mu_inc;
40 mmse_fir_interpolator_cc *d_resamp;
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
68 } // namespace grgsm
69} // namespace gr
70
71#endif /* INCLUDED_GRGSM_CONTROLLED_FRACTIONAL_RESAMPLER_CC_IMPL_H */
72