📄 jo_freqz.m
字号:
function [h,w] = johnfreqz(b,a,n,radius)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% jmw
%
% sometime in early 1994 ...
%
% a variation of freqz that calculates frequency response on a circle
% that may or may NOT have a unit radius.
%
% used in the McCandless Algorithm to "home in" on pole positions
% by iteratively reducing the size of the circle that the
% frequency response is calculated on in the Z plane.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a = a(:).';
b = b(:).';
na = max(size(a));
nb = max(size(b));
nn = max(size(n));
s = 2;
if nn == 1
w = (2*pi/s*(0:n-1)/n)';
else
w = n;
n = nn;
end
a = [a zeros(1,nb-na)]; % Make sure a and b have the same length
b = [b zeros(1,na-nb)];
s = radius*exp(sqrt(-1)*w);
h = polyval(b,s) ./ polyval(a,s);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -