DAU96 - Auditory model from Dau et. al. 1996.

Program code:

function [inoutsig, fc] = dau96(inoutsig, fs, flow, fhigh,basef)

%   AUTHOR : Torsten Dau, Morten, Løve Jepsen, Peter L. Soendergaard

% ------ Checking of input parameters ------------

error(nargchk(2,5,nargin));

if nargin==2
  flow=80;
  fhigh=8000;
end;

if ~isnumeric(inoutsig)
  error('%s: insig must be numeric.',upper(mfilename));
end;

if ~isnumeric(fs) || ~isscalar(fs) || fs<=0
  error('%s: fs must be a positive scalar.',upper(mfilename));
end;

if ~isnumeric(flow) || ~isscalar(flow) || flow<0
  error('%s: flow must be a non-negative scalar.',upper(mfilename));
end;

if ~isnumeric(fhigh) || ~isscalar(fhigh) || fhigh<0
  error('%s: fhigh must be a non-negative scalar.',upper(mfilename));
end;

if flow>fhigh
  error('%s: flow must be less than or equal to fhigh.',upper(mfilename));
end;

if nargin<5
  basef=-1;
end;

% ------ do the computation -------------------------

% find the center frequencies used in the filterbank, 1 ERB spacing
fc = erbspacebw(flow, fhigh, 1, basef);

% Calculate filter coefficients for the gammatone filter bank.
[gt_b, gt_a]=gammatone(fc, fs);

% Apply the Gammatone filterbank
inoutsig = 2*real(filterbank(gt_b,gt_a,inoutsig));

% 'haircell' envelope extraction
inoutsig = envextract(inoutsig,fs);

% non-linear adaptation loops
inoutsig = adaptloop(inoutsig, fs,10);

% Calculate filter coefficients for the 20 ms (approx.eq to 8 Hz) modulation
% lowpass filter.
mlp_a = exp(-(1/0.02)/fs);
mlp_b = 1 - mlp_a;
mlp_a = [1, -mlp_a];

% Apply the low-pass modulation filter.
inoutsig = filter(mlp_b,mlp_a,inoutsig);