view branches/carfac_cpp/src/Ear.cpp @ 668:933cf18d9a59

Fourth revision of Alex Brandmeyer's C++ implementation. Fixed more style issues, changed AGC structures to vectors, replaced FloatArray2d with vector<FloatArray>, implemented first tests using GTest to verify coefficients and monaural output against Matlab values (stored in aimc/carfac/test_data/). To run tests, change the path stored in carfac_test.h in TEST_SRC_DIR. Added CARFAC_GenerateTestData to the Matlab branch, fixed stage indexing in CARFAC_Cross_Couple.m to reflect changes in AGCCoeffs and AGCState structs.
author alexbrandmeyer
date Wed, 22 May 2013 21:30:02 +0000
parents f3dde307f4b8
children
line wrap: on
line source
/*
 * Ear.cpp
 *
 *  Created on: 16 maj 2012
 *      Author: ulha
 */

#include "Ear.h"
#include "CAR.h"
#include "IHC.h"
#include "AGC.h"

Ear::Ear(CAR_parameters* car_params, IHC_parameters* ihc_params, AGC_parameters* agc_params, FloatArray pole_freqs, int n_ch, float fs){
  car_params_ = *car_params;
  ihc_params_ = *ihc_params;
  agc_params_ = *agc_params;

  car_coeffs_p_ = new CAR_coefficients(&car_params_, fs, pole_freqs);
  ihc_coeffs_p_ = new IHC_coefficients(&ihc_params_, fs, n_ch);
  agc_coeffs_p_ = new AGC_coefficients(&agc_params_, fs, n_ch);
}