Пример #1
0
/*! \brief Create DC correction object object.
 *
 * Use make_dc_corr_cc() instead.
 */
dc_corr_cc::dc_corr_cc(float alpha)
    : gr_sync_block ("dc_corr_cc",
          gr_make_io_signature(1, 1, sizeof(gr_complex)),
          gr_make_io_signature(1, 1, sizeof(gr_complex))),
      d_alpha(alpha),
      d_avg_i(0.0),
      d_avg_q(0.0),
      d_cnt(0)
{

}
Пример #2
0
/*! \brief Create a sniffe_fr object.
 *  \param buffsize The internal buffer size.
 *
 * When choosing buffer size, the user of this class should take into account:
 *  - The input sample rate.
 *  - How ofter the data will be popped.
 */
sniffer_f::sniffer_f(int buffsize)
    : gr_sync_block ("rx_fft_c",
          gr_make_io_signature(1, 1, sizeof(float)),
          gr_make_io_signature(0, 0, 0)),
      d_minsamp(1000)
{

    /* allocate circular buffer */
    d_buffer.set_capacity(buffsize);

}
Пример #3
0
soft_frame_contor::soft_frame_contor(gr_msg_queue_sptr target_queue, short_codec_sptr header_decoder)
  : gr_sync_block ("soft_frame_contor",
		   gr_make_io_signature2 (2, 2, sizeof(unsigned char), sizeof(float)),
		   gr_make_io_signature (0, 0, 0)),
    d_target_queue(target_queue), d_short_decoder(header_decoder), d_soft_float_counter(0)
{
  enter_search();
}
Пример #4
0
/*! \brief Create noise blanker object.
 *
 * Use make_rx_nb_cc() instead.
 */
rx_nb_cc::rx_nb_cc(double sample_rate, float thld1, float thld2)
    : gr_sync_block ("rx_nb_cc",
          gr_make_io_signature(1, 1, sizeof(gr_complex)),
          gr_make_io_signature(1, 1, sizeof(gr_complex))),
      d_sample_rate(sample_rate),
      d_thld_nb1(thld1),
      d_thld_nb2(thld2),
      d_nb1_on(false),
      d_nb2_on(false),
      d_avgmag_nb1(1.0),
      d_avgmag_nb2(1.0),
      d_hangtime(0),
      d_sigidx(0),
      d_delidx(2)
{
    memset(d_delay, 0, 8 * sizeof(gr_complex));
}
Пример #5
0
/*! \brief Create receiver AGC object.
 *
 * Use make_rx_agc_cc() instead.
 */
rx_agc_cc::rx_agc_cc(double sample_rate, bool agc_on, int threshold,
                     int manual_gain, int slope, int decay, bool use_hang)
    : gr_sync_block ("rx_agc_cc",
          gr_make_io_signature(1, 1, sizeof(gr_complex)),
          gr_make_io_signature(1, 1, sizeof(gr_complex))),
      d_sample_rate(sample_rate),
      d_agc_on(agc_on),
      d_threshold(threshold),
      d_manual_gain(manual_gain),
      d_slope(slope),
      d_decay(decay),
      d_use_hang(use_hang)
{
    d_agc = new CAgc();
    d_agc->SetParameters(d_agc_on, d_use_hang, d_threshold, d_manual_gain,
                         d_slope, d_decay, d_sample_rate);
}
Пример #6
0
lpf_ff::lpf_ff(double sample_rate, double cutoff_freq,
               double trans_width, double gain)
    : gr_hier_block2("lpf_ff",
                     gr_make_io_signature(MIN_IN,  MAX_IN,  sizeof (float)),
                     gr_make_io_signature(MIN_OUT, MAX_OUT, sizeof (float))),
    d_sample_rate(sample_rate),
    d_cutoff_freq(cutoff_freq),
    d_trans_width(trans_width),
    d_gain(gain)
{
    /* generate taps */
    d_taps = gr_firdes::low_pass(d_gain, d_sample_rate,
                                 d_cutoff_freq, d_trans_width);

    /* create low-pass filter (decimation=1) */
    lpf = gr_make_fir_filter_fff(1, d_taps);

    /* connect filter */
    connect(self(), 0, lpf, 0);
    connect(lpf, 0, self(), 0);
}