aubio
0.4.1
|
00001 /* 00002 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org> 00003 00004 This file is part of aubio. 00005 00006 aubio is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 aubio is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with aubio. If not, see <http://www.gnu.org/licenses/>. 00018 00019 */ 00020 00021 #ifndef _AUBIO_FILTER_C_DESIGN_H 00022 #define _AUBIO_FILTER_C_DESIGN_H 00023 00024 /** \file 00025 00026 C-weighting filter coefficients 00027 00028 This file creates a C-weighting digital filter, which reduces low and high 00029 frequencies and enhance the middle ones to reflect the ability of the human 00030 hearing. 00031 00032 The implementation is based on the following standard: 00033 00034 - IEC/CD 1672: Electroacoustics-Sound Level Meters, IEC, Geneva, Nov. 1996, 00035 for A- and C-weighting filters. 00036 00037 See also: 00038 00039 - <a href="http://en.wikipedia.org/wiki/A-weighting">A-Weighting on 00040 Wikipedia</a> 00041 - <a href="http://en.wikipedia.org/wiki/Weighting_filter">Weighting filter on 00042 Wikipedia</a> 00043 - <a href="http://www.mathworks.com/matlabcentral/fileexchange/69">Christophe 00044 Couvreur's 'octave' toolbox</a> 00045 00046 The coefficients in this file have been computed using Christophe Couvreur's 00047 scripts in octave 3.0 (debian package 1:3.0.5-6+b2 with octave-signal 00048 1.0.9-1+b1 on i386), with <pre> [b, a] = cdsign(1/Fs) </pre> for various 00049 sampling frequencies (8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 00050 88200, 96000, and 192000 Hz). 00051 00052 The sampling frequency should normally be higher than 20kHz, but most common 00053 file sampling rates have been included for completeness. 00054 00055 \example temporal/test-c_weighting.c 00056 00057 */ 00058 00059 #ifdef __cplusplus 00060 extern "C" { 00061 #endif 00062 00063 /** create new C-design filter 00064 00065 \param samplerate sampling frequency of the signal to filter. Should be one of 00066 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and 00067 192000 Hz 00068 00069 \return a new filter object 00070 00071 */ 00072 aubio_filter_t *new_aubio_filter_c_weighting (uint_t samplerate); 00073 00074 /** set feedback and feedforward coefficients of a C-weighting filter 00075 00076 \param f filter object to get coefficients from 00077 \param samplerate sampling frequency of the signal to filter. Should be one of 00078 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and 00079 192000 Hz 00080 00081 */ 00082 uint_t aubio_filter_set_c_weighting (aubio_filter_t * f, uint_t samplerate); 00083 00084 #ifdef __cplusplus 00085 } 00086 #endif 00087 00088 #endif /* _AUBIO_FILTER_C_DESIGN_H */