THE AUDITORY MODELING TOOLBOX

Applies to version: 1.5.0

View the code

Go to function

MAY2011_GAMMATONE - Auditory filterbank

Usage:

[BM,ENV,GFB] = may2011_gammatone(IN)
[BM,ENV,GFB] = may2011_gammatone(IN,GFB)
[BM,ENV,GFB] = may2011_gammatone(IN,FS,FLOW,FUP,NFILTER,bEAR,bALIGN,bINFO)

Input parameters:

IN audio object. The gammatone parameter will be initialized using the audio sampling frequency.
IN mono input signal [nSamples x nChannels]
GFB gammatone parameter structure (see gammatoneInit)
IN multi-channel input signal [nSamples x nChannels]
FS sampling frequency in Hz
FLOW center frequency of lowest auditory filter (default, FLOW = 80)
FUP center frequency of highest auditory filter (default, FUP = 5e3)
NFILTER number of auditory filters which will be spaced linear in the ERB domain. If NFILTER is not a scalar but a vector, the first value is assumed to represent the number of auditory channels and the following values represents the indices of the filters which should be processed. This can be useful if a large number of channels is required as MATLAB might run out of memory for long signals if all filters should be computed in one step. (default, NFILTER = round(freq2erb(FS/2))
bEAR Adjust gain coefficients of the auditory channels to incorporate middle ear effects. Note that this feature can only be used if the center frequencies of the auditory channels are above 20 Hz and below 12500 Hz. (default, bEAR = true)
bALIGN phase-aligned gammatone output (non-causal output) (default, bALIGN = false)
bINFO info flag printing gammatone parameters on the screen (default, bINFO = false)

Output parameters:

BM basilar membrane displacement [nSamples x nFilter]
ENV instantaneous envelope [nSamples x nFilter]
GFB gammatone parameter structure

Description:

may2011_gammatone applies gammatone filtering using the gammatone structure derived from gammatone_init. If only the basilar membrane output "bm" is required, computing BM = gammatone(...); will be significantly faster then computing the envelope as well: [BM,ENV] = gammatone(...);

The MEX implementaion is based on the source code of the ohio-state university: www.cse.ohio-state.edu/pnl/shareware/roman-jasa03/

Example:

nSamples = 500;
% Initialize gammatone parameter structure
GFB = may2011_gammatone_init(20e3);
% Filter impulse with gammatone filtering
bm = may2011_gammatone([1; zeros(nSamples-1,1)],GFB);
% Plot result
waveplot(1:nSamples,GFB.cf,bm);