tomwalters@0: % generating function for 'aim-mat' tomwalters@0: % tomwalters@0: % tomwalters@0: % Toshio Irino and Roy Patterson (2005). "A dynamic, compressive gammachirp auditory filterbank" Revision submitted to IEEE SAP.. tomwalters@0: % Implementation in aim-mat by Ralph van Dinther tomwalters@0: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org bleeck@3: tomwalters@0: tomwalters@0: function fr=gen_dcgc(sig,options) tomwalters@0: tomwalters@0: % Generating the dcgc tomwalters@0: tomwalters@0: NumCh = options.nr_channels; tomwalters@0: fre1 = options.lowest_frequency; tomwalters@0: fre2 = options.highest_frequency; tomwalters@0: FRange = [fre1 fre2]; tomwalters@0: Frs = FcNch2EqERB(min(FRange),max(FRange),NumCh); tomwalters@0: tomwalters@0: sr = getsr(sig); tomwalters@0: GCparam.fs=sr;% Sampling rate (48000) tomwalters@0: GCparam.NumCh=NumCh;% Number of Channels (75) tomwalters@0: GCparam.FRange=FRange; tomwalters@0: GCparam.Ctrl = 'tim'; tomwalters@0: tomwalters@0: % TCW AIM 2006 - Now defaults to 70 dB, not 40 as before tomwalters@0: if isfield(options, 'gain_ref') tomwalters@0: GCparam.GainRefdB=options.gain_ref; tomwalters@0: else tomwalters@0: GCparam.GainRefdB=70; tomwalters@0: end tomwalters@0: tomwalters@0: %% Anticipating the noise pre-excitation stuff I'm going to write... tomwalters@0: % if ~isfield(options, 'pre_excite_with_noise') tomwalters@0: % do_pre_excite=0; tomwalters@0: % else tomwalters@0: % do_pre_excite=options.pre_excite_with_noise; tomwalters@0: % end tomwalters@0: % tomwalters@0: % if ~isfield(options, 'pre_excite_time') tomwalters@0: % pre_excite_time=0.2; % 200ms tomwalters@0: % else tomwalters@0: % pre_excite_time=options.pre_excite_time; tomwalters@0: % end tomwalters@0: % tomwalters@0: % if ~isfield(options, 'pre_excite_level_dB') tomwalters@0: % pre_excite_level_dB=-10; tomwalters@0: % else tomwalters@0: % pre_excite_level_dB=options.pre_excite_level_dB; tomwalters@0: % end tomwalters@0: tomwalters@0: NAPparam.cf_afb = [fre1 fre2]; tomwalters@0: cf_afb=NAPparam.cf_afb; tomwalters@0: NAPparam.SubBase = 0.5; tomwalters@0: tomwalters@0: tomwalters@0: sr = getsr(sig); tomwalters@0: Snd = getvalues(sig); tomwalters@0: LenSnd = length(Snd); tomwalters@0: tomwalters@0: if (fre2>(0.4.*sr)) tomwalters@0: warning('Top filter centre frequency is > 0.4 times the signal samplerate - aliasing effects possible'); tomwalters@0: end tomwalters@0: tomwalters@0: %%%%% BMM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% tomwalters@0: tomwalters@0: [cGCout, pGCout, GCparam, GCresp] = GCFBv205(Snd',GCparam); tomwalters@0: BMM=cGCout; tomwalters@0: tomwalters@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% tomwalters@0: tomwalters@0: fr = frame(BMM); tomwalters@0: fr = setsr(fr,sr); tomwalters@0: fr = setstarttime(fr,getminimumtime(sig)); tomwalters@0: fr = setcf(fr,Frs); tomwalters@0: tomwalters@0: if ~strcmp(options.do_phase_alignment,'off') tomwalters@0: fr=phasealign(fr,options); tomwalters@0: end tomwalters@0: tomwalters@0: tomwalters@0: