📄 fpeak4.m
字号:
function [f, amp]=fpeak4(a,radius)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% jmw
%
% 12/01/93
% find freq response peaks of LPC cofa vector
% return both peaks and amplitudes of peaks
% amp and f are both 1 by 4 vectors
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
echo off
N=256; % number of points in spectrum
FSOVR2 = 5000; % fs times 0.5
% compute freq response
[h,w]=jo_freqz(1,a, N,radius);
mag = abs(h);
% find peaks - start at point n=6 to ignore points below about 125 Hz
inflect_frq = zeros(1,4); % allocate mem
amp = zeros(1,4);
cnt = 0; % inflection counter
slope = sign(mag(8) -mag(7)); % IC's for slope
LIMIT = 192; % corresponds to 3750 Hz
for i=9:LIMIT,
old_slope = slope; % update old slope
slope = sign(mag(i) - mag(i-1)); % compute new slope
if (slope < 0)
if (old_slope>= 0)
% inflection found
cnt = cnt + 1;
inflect_frq(cnt) = (i)/N*FSOVR2; % remember freq offset
amp(cnt) = mag(i-1);
end;
end;
end;
f = [inflect_frq(1) inflect_frq(2) inflect_frq(3) inflect_frq(4) ];
amp = [ amp(1) amp(2) amp(3) amp(4) ];
return;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -