view branches/carfac_cpp/include/AGC.h @ 621:d763637a05c5

Second check-in of Alex Brandmeyer's C++ implementation of CARFAC. Addressed style issues and completed implementation of remaining functions. Still needs proper testing of the output stages against the MATLAB version, and runtime functions need improvements in efficiency.
author alexbrandmeyer
date Thu, 16 May 2013 17:33:23 +0000
parents 057946a60b91
children
line wrap: on
line source
#ifndef AGC_H_
#define AGC_H_

#include "CARFAC_common.h"

class AGC_parameters {
public:
  AGC_parameters();

  int n_stages_;
  FloatArray time_constants_;
  float agc_stage_gain_;
  FloatArray decimation_;
  FloatArray agc1_scales_;
  FloatArray agc2_scales_;
  float detect_scale_;
  float agc_mix_coeff_;
};

class AGC_coefficients {
public:
  AGC_coefficients(AGC_parameters* AGC_params_p,
      float fs, int n_ch);

  int n_ch_;
  int n_agc_stages_;
  float agc_stage_gain_;
  FloatArray agc_epsilon_;
  FloatArray decimation_;
  FloatArray agc_polez1_;
  FloatArray agc_polez2_;
  FloatArray agc_spatial_iterations_;
  FloatMatrix agc_spatial_fir_;
  FloatArray agc_spatial_n_taps_;
  FloatArray agc_mix_coeffs_;
  float agc_gain_;
  float detect_scale_;
  
private:
  FloatArray Build_FIR_coeffs(float var, float mn, int* ptr_iters, int* ptr_taps);
};

#endif /* AGC_H_ */