tomwalters@0: /* tomwalters@0: Copyright (c) Applied Psychology Unit, Medical Research Council. 1988, 1989 tomwalters@0: =========================================================================== tomwalters@0: tomwalters@0: Permission to use, copy, modify, and distribute this software without fee tomwalters@0: is hereby granted for research purposes, provided that this copyright tomwalters@0: notice appears in all copies and in all supporting documentation, and that tomwalters@0: the software is not redistributed for any fee (except for a nominal shipping tomwalters@0: charge). Anyone wanting to incorporate all or part of this software in a tomwalters@0: commercial product must obtain a license from the Medical Research Council. tomwalters@0: tomwalters@0: The MRC makes no representations about the suitability of this tomwalters@0: software for any purpose. It is provided "as is" without express or implied tomwalters@0: warranty. tomwalters@0: tomwalters@0: THE MRC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING tomwalters@0: ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE tomwalters@0: A.P.U. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY tomwalters@0: DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN tomwalters@0: AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF tomwalters@0: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. tomwalters@0: */ tomwalters@0: tomwalters@0: /* tomwalters@0: tomwalters@0: ============================================================== tomwalters@0: gamma_tone.h - portable recursive auditory filter bank code. tomwalters@0: ============================================================== tomwalters@0: tomwalters@0: J. Holdsworth - 23rd February 1988. tomwalters@0: tomwalters@0: tomwalters@0: Copywright (c) Applied Psychology Unit, Medical Research Council. 1988. tomwalters@0: ======================================================================= tomwalters@0: tomwalters@0: tomwalters@0: Release 2: 5th July 1988. tomwalters@0: Release 3: 20th September 1988. tomwalters@0: Rewrite : 21st January 1988. tomwalters@0: tomwalters@0: */ tomwalters@0: tomwalters@0: #define _GAMMA_TONE_H_ tomwalters@0: tomwalters@0: #define GT_IDENT_STRING "@(#)gamma_tone.h 1.5 J. Holdsworth (MRC-APU) 1/30/90\n" tomwalters@0: tomwalters@0: tomwalters@0: /* number of bits significant in input data */ tomwalters@0: tomwalters@0: #define bits_significant 12 tomwalters@0: tomwalters@0: tomwalters@0: /* structure storing information common to all channels in filter */ tomwalters@0: tomwalters@0: typedef struct _bank_info FilterBankInfo, *FilterBankInfoPtr ; tomwalters@0: tomwalters@0: struct _bank_info { double samplerate, b_scalar, max_desired_advance_time ; tomwalters@0: int order, phase_comp ; } ; tomwalters@0: tomwalters@0: tomwalters@0: /* structure storing information specific to state of particualr channel's filter */ tomwalters@0: tomwalters@0: typedef char FilterChannelInfo, *FilterChannelInfoPtr ; tomwalters@0: tomwalters@0: tomwalters@0: extern double *GenerateCenterFrequencies( tomwalters@0: #ifdef vaxc tomwalters@0: double min_cf, double max_cf, double erb_density tomwalters@0: #endif tomwalters@0: ) ; tomwalters@0: tomwalters@0: extern int NumberCenterFrequencies( tomwalters@0: #ifdef vaxc tomwalters@0: int min_cf, double max_cf, double erb_density tomwalters@0: #endif tomwalters@0: ) ; tomwalters@0: tomwalters@0: extern double *NumberedCenterFrequencies( tomwalters@0: #ifdef vaxc tomwalters@0: double min_cf, double max_cf, int channels tomwalters@0: #endif tomwalters@0: ) ; tomwalters@0: tomwalters@0: extern double bandwidth_normalisation() ; tomwalters@0: tomwalters@0: tomwalters@0: extern FilterBankInfo *InitGammaToneFilterBank() ; tomwalters@0: extern FilterChannelInfo *InitGammaToneFilterChannel() ; tomwalters@0: extern void EndChannel() ; tomwalters@0: extern void EndFilter() ; tomwalters@0: tomwalters@0: extern int FilterShortDataArray() ; tomwalters@0: extern int RealFilterShortDataArray() ; tomwalters@0: extern int FilterIntDataArray() ; tomwalters@0: extern int RealFilterIntDataArray() ; tomwalters@0: extern int RealFilterDoubleDataArray() ; tomwalters@0: tomwalters@0: /* envelope functions */ tomwalters@0: tomwalters@0: extern int EnvelopeShortDataArray() ; tomwalters@0: extern int RealEnvelopeShortDataArray() ; tomwalters@0: tomwalters@0: tomwalters@0: /* for compatability with release 1 */ tomwalters@0: tomwalters@0: #define InitGammaToneFilter InitGammaToneFilterBank tomwalters@0: #define FilterDataArray FilterShortDataArray tomwalters@0: #define erb( _f ) Erb( _f ) tomwalters@0: #define erb_rate( _f ) ErbRate( _f ) tomwalters@0: #define f_of_erb_rate( _E ) FofErbRate( _E ) tomwalters@0: #define bandwidth_divisor bandwidth_normalisation tomwalters@0: tomwalters@0: /* missing parameters availiable as globl variables */ tomwalters@0: tomwalters@0: extern double filterDefaultGain ; tomwalters@0: extern int filterDefaultInputBits ;