view aim-mat/modules/nap/twodat2003/calcfreqslope.m @ 4:537f939baef0 tip

various bug fixes and changed copyright message
author Stefan Bleeck <bleeck@gmail.com>
date Tue, 16 Aug 2011 14:37:17 +0100
parents 20ada0af3d7d
children
line wrap: on
line source
%  
% function adjacent_band_level=calcfreqslope(cf,af);
%
%   INPUT VALUES:
% 		
%
%   RETURN VALUE:
%		
% 
% (c) 2011, University of Southampton
% Maintained by Stefan Bleeck (bleeck@gmail.com)
% download of current version is on the soundsoftware site: 
% http://code.soundsoftware.ac.uk/projects/aimmat
% documentation and everything is on http://www.acousticscale.org



function adjacent_band_level=calcfreqslope(cf,af,b);
% function used to calculate the relative amplitudes in adjacent GTFBs
%e.g to calculate the level in 2000Hz critical band due to excitation 
%in 1000Hz critical band calcfreqslope(2000,1000);


n=4;
%ERB = 24.7+0.108.*cf;
[dummy ERB]=Freq2ERB(cf);
B=b.*ERB;


h_cf=abs(3.*(B./(2.*pi.*i.*(cf-cf)+2.*pi.*B)).^n);
h_af=abs(3.*(B./(2.*pi.*i.*(af-cf)+2.*pi.*B)).^n);

adjacent_band_level=h_af./h_cf;
adjacent_band_level=20.*log10(adjacent_band_level);