Piotr Krysik | 47ab20e | 2016-07-04 21:23:51 +0200 | [diff] [blame] | 1 | /* -*- c++ -*- */ |
| 2 | /* @file |
Piotr Krysik | a6268a5 | 2017-08-23 16:02:19 +0200 | [diff] [blame] | 3 | * @author (C) 2016 by Piotr Krysik <ptrkrysik@gmail.com> |
Piotr Krysik | 47ab20e | 2016-07-04 21:23:51 +0200 | [diff] [blame] | 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 | |
Piotr Krysik | cab0604 | 2016-07-18 10:39:31 +0200 | [diff] [blame] | 26 | #include <grgsm/misc_utils/controlled_fractional_resampler_cc.h> |
Piotr Krysik | 47ab20e | 2016-07-04 21:23:51 +0200 | [diff] [blame] | 27 | #include <gnuradio/filter/mmse_fir_interpolator_cc.h> |
| 28 | |
| 29 | using namespace gr::filter; |
| 30 | |
| 31 | namespace 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 Krysik | 74c4f2c | 2016-07-15 13:12:46 +0200 | [diff] [blame] | 40 | |
Piotr Krysik | 47ab20e | 2016-07-04 21:23:51 +0200 | [diff] [blame] | 41 | inline uint64_t resample(const gr_complex *in, |
| 42 | uint64_t first_in_sample, |
| 43 | gr_complex *out, |
| 44 | uint64_t first_out_sample, |
| 45 | uint64_t samples_to_produce); |
| 46 | |
| 47 | public: |
| 48 | controlled_fractional_resampler_cc_impl(float phase_shift, |
| 49 | float resamp_ratio); |
| 50 | ~controlled_fractional_resampler_cc_impl(); |
| 51 | |
| 52 | void forecast(int noutput_items, |
| 53 | gr_vector_int &ninput_items_required); |
| 54 | |
| 55 | int general_work(int noutput_items, |
| 56 | gr_vector_int &ninput_items, |
| 57 | gr_vector_const_void_star &input_items, |
| 58 | gr_vector_void_star &output_items); |
| 59 | |
| 60 | |
| 61 | float mu() const; |
| 62 | float resamp_ratio() const; |
| 63 | void set_mu(float mu); |
| 64 | void set_resamp_ratio(float resamp_ratio); |
| 65 | }; |
| 66 | |
Piotr Krysik | 264fbf6 | 2017-11-05 12:25:51 +0100 | [diff] [blame] | 67 | } // namespace gsm |
Piotr Krysik | 47ab20e | 2016-07-04 21:23:51 +0200 | [diff] [blame] | 68 | } // namespace gr |
| 69 | |
| 70 | #endif /* INCLUDED_GRGSM_CONTROLLED_FRACTIONAL_RESAMPLER_CC_IMPL_H */ |
| 71 | |