# HG changeset patch # User Ulf.Hammarqvist@gmail.com # Date 1333792775 0 # Node ID 463240c9e10440d6a6d037750e9a66500920d7ac # Parent 20de0b60b694e329d24ce4e122a1d094d63ff834 comments diff -r 20de0b60b694 -r 463240c9e104 src/CARFAC.cpp --- a/src/CARFAC.cpp Sat Apr 07 09:52:04 2012 +0000 +++ b/src/CARFAC.cpp Sat Apr 07 09:59:35 2012 +0000 @@ -29,12 +29,13 @@ max_channels_per_octave_ = log(2) / log(pole_freqs_[0]/pole_freqs_[1]); - // replace with feeding this (as const ref) instead? Saves storing doubly + //TODO: pass const references? car_coeffs_ = new CAR_coefficients(car_params_, fs_, pole_freqs_); ihc_coeffs_ = new IHC_coefficients(ihc_params_, fs_, n_ch_); agc_coeffs_ = new AGC_coefficients(agc_params_, fs_, n_ch_); - // move this into AGC_coefficients constructor instead + //TODO: move this into AGC_coefficients constructor instead? This style + // makes me a bit wary. agc_coeffs_->detect_scale_ = agc_params_->detect_scale_ / (ihc_coeffs_->saturation_output_ * agc_coeffs_->agc_gain_); @@ -42,11 +43,10 @@ } -//move this somewhere else? - +//TODO: move this somewhere else? float CARFAC::ERB_Hz(float cf_hz){ return ERB_Hz(cf_hz, 1000/4.37, 1000/(24.7*4.37)); -} // is it really intentional to use this default value thing in matlab code? +} // TODO: is it really intentional to use this default value thing in matlab code? float CARFAC::ERB_Hz(float cf_hz, float erb_break_freq, float erb_q){ return (erb_break_freq + cf_hz) / erb_q; } @@ -56,6 +56,9 @@ delete ihc_coeffs_; delete agc_coeffs_; + //TODO: as the current design takes ownership OR creates news params, + //deletion is a ambiguos. Revise this design! + //delete car_params_; //delete ihc_params_; //delete agc_params_;