view aim-mat/modules/pcp/map/genmap.m @ 0:74dedb26614d

Initial checkin of AIM-MAT version 1.5 (6.4.2011).
author tomwalters
date Fri, 20 May 2011 12:32:31 +0100
parents
children 20ada0af3d7d
line wrap: on
line source
% generating function for 'aim-mat'
% 
%   INPUT VALUES:
%  
%   RETURN VALUE:
%
% 
% (c) 2011, University of Southampton
% Maintained and written by Stefan Bleeck (bleec@gmail.com)
% http://www.soton.ac.uk/aim


function sig=genome(sig,options)
% generating function for the outer/middle ear transfere function 

waithand=waitbar(0,'generating pre cochlea processing');

samplerate=getsr(sig);
start_time=getminimumtime(sig);


		firfiltercoef = OutMidCrctFilt('MAP',samplerate,0);


% to compensate the huge delay from the filter, a pause is added to the
% signal, that is taken away in the end:
pause=signal(abs(options.delay_correction),samplerate);
sig=setstarttime(sig,0);
sig=append(sig,pause);

Snd=getvalues(sig);
Snd=Snd';
Snd = filter(firfiltercoef,1,Snd);

sig=setvalues(sig,Snd);

%take the delay back:
siglen=getlength(sig);
sig=getpart(sig,abs(options.delay_correction),siglen);
sig=setstarttime(sig,start_time);

close(waithand);