flatmax@632: flatmax@593: // Author Matt Flax flatmax@593: // flatmax@593: // This C++ file is part of an implementation of Lyon's cochlear model: flatmax@593: // "Cascade of Asymmetric Resonators with Fast-Acting Compression" flatmax@593: // to supplement Lyon's upcoming book "Human and Machine Hearing" flatmax@593: // flatmax@593: // Licensed under the Apache License, Version 2.0 (the "License"); flatmax@593: // you may not use this file except in compliance with the License. flatmax@593: // You may obtain a copy of the License at flatmax@593: // flatmax@593: // http://www.apache.org/licenses/LICENSE-2.0 flatmax@593: // flatmax@593: // Unless required by applicable law or agreed to in writing, software flatmax@593: // distributed under the License is distributed on an "AS IS" BASIS, flatmax@593: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. flatmax@593: // See the License for the specific language governing permissions and flatmax@593: // limitations under the License. flatmax@593: #ifndef PSYCHOACOUSTICS_H_ flatmax@593: #define PSYCHOACOUSTICS_H_ flatmax@593: flatmax@593: #include "CARFACCommon.H" flatmax@593: flatmax@593: class PsychoAcoustics { flatmax@593: public: flatmax@593: PsychoAcoustics() {} flatmax@593: virtual ~PsychoAcoustics() {} flatmax@593: flatmax@593: /** Auditory filter nominal Equivalent Rectangular Bandwidth flatmax@593: Ref: Glasberg and Moore: Hearing Research, 47 (1990), 103-138 flatmax@593: ERB = 24.7 * (1 + 4.37 * CF_Hz / 1000); flatmax@593: \param CFHz The central frequency to find the ERB at. flatmax@593: \param ERBBreakFreq The linear scaling factor for frequency flatmax@593: \param ERBQ The tuning of the rectangular bandwidth flatmax@593: */ flatmax@593: 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: flatmax@593: /** Auditory filter nominal Equivalent Rectangular Bandwidth flatmax@593: Ref: Glasberg and Moore: Hearing Research, 47 (1990), 103-138 flatmax@593: ERB = 24.7 * (1 + 4.37 * CF_Hz / 1000); flatmax@593: \param CFHz The central frequency to find the ERB at. flatmax@593: \param ERBBreakFreq The linear scaling factor for frequency flatmax@593: \param ERBQ The tuning of the rectangular bandwidth flatmax@593: */ flatmax@593: static Array Hz2ERB(Array &CFHz, FP_TYPE ERBBreakFreq=1000./4.37 /* 228.833 */, FP_TYPE ERBQ=1000./(24.7*4.37) /* 9.2645 */); flatmax@593: }; flatmax@593: flatmax@593: #endif // PSYCHOACOUSTICS_H_