Mercurial > hg > aimmat
annotate 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 |
rev | line source |
---|---|
tomwalters@0 | 1 % |
tomwalters@0 | 2 % function adjacent_band_level=calcfreqslope(cf,af); |
tomwalters@0 | 3 % |
tomwalters@0 | 4 % INPUT VALUES: |
tomwalters@0 | 5 % |
tomwalters@0 | 6 % |
tomwalters@0 | 7 % RETURN VALUE: |
tomwalters@0 | 8 % |
tomwalters@0 | 9 % |
tomwalters@0 | 10 % (c) 2011, University of Southampton |
bleeck@3 | 11 % Maintained by Stefan Bleeck (bleeck@gmail.com) |
bleeck@3 | 12 % download of current version is on the soundsoftware site: |
bleeck@3 | 13 % http://code.soundsoftware.ac.uk/projects/aimmat |
bleeck@3 | 14 % documentation and everything is on http://www.acousticscale.org |
bleeck@3 | 15 |
tomwalters@0 | 16 |
tomwalters@0 | 17 |
tomwalters@0 | 18 function adjacent_band_level=calcfreqslope(cf,af,b); |
tomwalters@0 | 19 % function used to calculate the relative amplitudes in adjacent GTFBs |
tomwalters@0 | 20 %e.g to calculate the level in 2000Hz critical band due to excitation |
tomwalters@0 | 21 %in 1000Hz critical band calcfreqslope(2000,1000); |
tomwalters@0 | 22 |
tomwalters@0 | 23 |
tomwalters@0 | 24 n=4; |
tomwalters@0 | 25 %ERB = 24.7+0.108.*cf; |
tomwalters@0 | 26 [dummy ERB]=Freq2ERB(cf); |
tomwalters@0 | 27 B=b.*ERB; |
tomwalters@0 | 28 |
tomwalters@0 | 29 |
tomwalters@0 | 30 h_cf=abs(3.*(B./(2.*pi.*i.*(cf-cf)+2.*pi.*B)).^n); |
tomwalters@0 | 31 h_af=abs(3.*(B./(2.*pi.*i.*(af-cf)+2.*pi.*B)).^n); |
tomwalters@0 | 32 |
tomwalters@0 | 33 adjacent_band_level=h_af./h_cf; |
tomwalters@0 | 34 adjacent_band_level=20.*log10(adjacent_band_level); |
tomwalters@0 | 35 |
tomwalters@0 | 36 |