|
CARFAC C++
C++ implementation of CARFAC
|
00001 // Copyright 2013 Matt R. Flax <flatmax\@> All Rights Reserved. 00002 // Author Matt Flax <flatmax@> 00003 // 00004 // This C++ file is part of an implementation of Lyon's cochlear model: 00005 // "Cascade of Asymmetric Resonators with Fast-Acting Compression" 00006 // to supplement Lyon's upcoming book "Human and Machine Hearing" 00007 // 00008 // Licensed under the Apache License, Version 2.0 (the "License"); 00009 // you may not use this file except in compliance with the License. 00010 // You may obtain a copy of the License at 00011 // 00012 // http://www.apache.org/licenses/LICENSE-2.0 00013 // 00014 // Unless required by applicable law or agreed to in writing, software 00015 // distributed under the License is distributed on an "AS IS" BASIS, 00016 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00017 // See the License for the specific language governing permissions and 00018 // limitations under the License. 00019 #ifndef CARPARAMS_H_ 00020 #define CARPARAMS_H_ 00021 00022 #include "Parameters.H" 00023 00024 class CAR; // required for decleration as a friend 00025 class Ear; 00026 00033 class CARParam : public Parameters { 00034 FP_TYPE velocity_scale; 00035 FP_TYPE v_offset; 00036 FP_TYPE min_zeta; 00037 FP_TYPE max_zeta; 00038 FP_TYPE first_pole_theta; 00039 FP_TYPE zero_ratio; 00040 FP_TYPE high_f_damping_compression; 00041 FP_TYPE ERB_per_step; 00042 FP_TYPE min_pole_Hz; 00043 FP_TYPE ERB_break_freq; 00044 FP_TYPE ERB_Q; 00045 00046 public: 00047 00049 CARParam(FP_TYPE velocity_scale_=0.1, FP_TYPE v_offset_=0.04, FP_TYPE min_zeta_=0.10, FP_TYPE max_zeta_=0.35, 00050 FP_TYPE first_pole_theta_=0.85*M_PI, FP_TYPE zero_ratio_=sqrt(2.), FP_TYPE high_f_damping_compression_=0.5, 00051 FP_TYPE ERB_per_step_=0.5, FP_TYPE min_pole_Hz_=30., FP_TYPE ERB_break_freq_=165.3, 00052 FP_TYPE ERB_Q_=1000./(24.7*4.37)); 00053 virtual ~CARParam(); 00054 00055 friend class CAR; 00056 friend class Ear; 00057 }; 00058 00059 #endif // CARPARAMS_H_