|
DAU97 - Auditory model from Dau et. al. 1997.
Program code:
function [outsig,fc,mfc] = dau97(insig, fs, flow, fhigh,basef)
% AUTHOR : Torsten Dau, Morten, Løve Jepsen, Peter L. Soendergaard
% ------ Checking of input parameters ------------
error(nargchk(4,5,nargin));
if ~isnumeric(insig)
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==4
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
insig = 2*real(filterbank(gt_b,gt_a,insig));
% 'haircell' envelope extraction
insig = envextract(insig,fs);
% non-linear adaptation loops
insig = adaptloop(insig, fs,10);
% set lowest mf as constant value. The multiplication by 0 is just an easy
% way to get an array of zeros of the correct size.
mflow = fc.*0;
% set highest mf as proportion of FC
mfhigh = min(fc.*0.25, 1000);
% to find the number of MF's
[MF_CFs,out] = mfbtd(1,min(mflow),max(mfhigh),1,fs);
% maximum number of modulation filters
NrMFChannels = size(MF_CFs,2);
outsig=zeros(size(insig,1),size(insig(,2),NrMFChannels);
for ChannelNr = 1:NrFBChannels
% Modulation filterbank
% MFB incl 150 LP
[infopar,y] = mfbtd(y,MFlow(ChannelNr),MFhigh(ChannelNr),1,fs);
y = mfbtdpp(y,infopar,fs);
% Fill 'y' into output array
outsig(:,ChannelNr,1:length(infopar)) = y;
end
|