Mercurial > hg > aimmat
annotate aim-mat/modules/bmm/dcgc/Fpeak2Fr.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 | 74dedb26614d |
children |
rev | line source |
---|---|
tomwalters@0 | 1 % |
tomwalters@0 | 2 % Estimate fr from fpeak |
tomwalters@0 | 3 % Toshio IRINO |
tomwalters@0 | 4 % 10 June 98 |
tomwalters@0 | 5 % |
tomwalters@0 | 6 % function [fr, ERBw] = Fpeak2Fr(n,b,c,fpeak) |
tomwalters@0 | 7 % INPUT: n,b,c : gammachirp param. |
tomwalters@0 | 8 % fpeak : peak freq. |
tomwalters@0 | 9 % OUTPUT: fr : fr |
tomwalters@0 | 10 % ERBw : ERBw(fr) |
tomwalters@0 | 11 % |
tomwalters@0 | 12 function [fr, ERBw] = Fpeak2Fr(n,b,c,fpeak) |
tomwalters@0 | 13 |
tomwalters@0 | 14 if nargin < 4; help Fpeak2Fr; end; |
tomwalters@0 | 15 |
tomwalters@0 | 16 n = n(:); |
tomwalters@0 | 17 b = b(:); |
tomwalters@0 | 18 c = c(:); |
tomwalters@0 | 19 fpeak = fpeak(:); |
tomwalters@0 | 20 |
tomwalters@0 | 21 % fpeak = fr + c*b*ERBw(fr)/n |
tomwalters@0 | 22 % ERBw(fr) = 24.7*(4.37*fr/1000 + 1) = k1*fr + k2 % M&G 1990 |
tomwalters@0 | 23 |
tomwalters@0 | 24 k1 = 24.7*4.37/1000; |
tomwalters@0 | 25 k2 = 24.7; |
tomwalters@0 | 26 |
tomwalters@0 | 27 fr = (fpeak - c.*b./n * k2)./(1 + c.*b./n * k1); |
tomwalters@0 | 28 ERBw = k1*fr + k2; |
tomwalters@0 | 29 |
tomwalters@0 | 30 |