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