annotate C++/PsychoAcoustics.H @ 640:d08c02c8e26f

More small style revisions to C++ CARFAC, adjusted struct member variable naming, header guards and #include structure.
author alexbrandmeyer
date Wed, 29 May 2013 15:37:28 +0000
parents c692afd86cc9
children
rev   line source
flatmax@632 1
flatmax@593 2 // Author Matt Flax <flatmax@>
flatmax@593 3 //
flatmax@593 4 // This C++ file is part of an implementation of Lyon's cochlear model:
flatmax@593 5 // "Cascade of Asymmetric Resonators with Fast-Acting Compression"
flatmax@593 6 // to supplement Lyon's upcoming book "Human and Machine Hearing"
flatmax@593 7 //
flatmax@593 8 // Licensed under the Apache License, Version 2.0 (the "License");
flatmax@593 9 // you may not use this file except in compliance with the License.
flatmax@593 10 // You may obtain a copy of the License at
flatmax@593 11 //
flatmax@593 12 // http://www.apache.org/licenses/LICENSE-2.0
flatmax@593 13 //
flatmax@593 14 // Unless required by applicable law or agreed to in writing, software
flatmax@593 15 // distributed under the License is distributed on an "AS IS" BASIS,
flatmax@593 16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
flatmax@593 17 // See the License for the specific language governing permissions and
flatmax@593 18 // limitations under the License.
flatmax@593 19 #ifndef PSYCHOACOUSTICS_H_
flatmax@593 20 #define PSYCHOACOUSTICS_H_
flatmax@593 21
flatmax@593 22 #include "CARFACCommon.H"
flatmax@593 23
flatmax@593 24 class PsychoAcoustics {
flatmax@593 25 public:
flatmax@593 26 PsychoAcoustics() {}
flatmax@593 27 virtual ~PsychoAcoustics() {}
flatmax@593 28
flatmax@593 29 /** Auditory filter nominal Equivalent Rectangular Bandwidth
flatmax@593 30 Ref: Glasberg and Moore: Hearing Research, 47 (1990), 103-138
flatmax@593 31 ERB = 24.7 * (1 + 4.37 * CF_Hz / 1000);
flatmax@593 32 \param CFHz The central frequency to find the ERB at.
flatmax@593 33 \param ERBBreakFreq The linear scaling factor for frequency
flatmax@593 34 \param ERBQ The tuning of the rectangular bandwidth
flatmax@593 35 */
flatmax@593 36 static FP_TYPE Hz2ERB(FP_TYPE CFHz, FP_TYPE ERBBreakFreq=1000./4.37 /* 228.833 */, FP_TYPE ERBQ=1000./(24.7*4.37) /* 9.2645 */);
flatmax@593 37
flatmax@593 38 /** Auditory filter nominal Equivalent Rectangular Bandwidth
flatmax@593 39 Ref: Glasberg and Moore: Hearing Research, 47 (1990), 103-138
flatmax@593 40 ERB = 24.7 * (1 + 4.37 * CF_Hz / 1000);
flatmax@593 41 \param CFHz The central frequency to find the ERB at.
flatmax@593 42 \param ERBBreakFreq The linear scaling factor for frequency
flatmax@593 43 \param ERBQ The tuning of the rectangular bandwidth
flatmax@593 44 */
flatmax@593 45 static Array<FP_TYPE, Dynamic, 1> Hz2ERB(Array<FP_TYPE, Dynamic, 1> &CFHz, FP_TYPE ERBBreakFreq=1000./4.37 /* 228.833 */, FP_TYPE ERBQ=1000./(24.7*4.37) /* 9.2645 */);
flatmax@593 46 };
flatmax@593 47
flatmax@593 48 #endif // PSYCHOACOUSTICS_H_