⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 factorize.m

📁 《数字信号处理:基于计算机的方法(第三版)》资源下载第三部分。 著者: (美)米特拉著 作译者: 孙洪等译 ISBN号: 7-121-02652-X 出版日期: 2006-06 出版
💻 M
字号:
function Factors = factorize(polyn)
format long; Factors = [];
% Use threshold of 1e-8 instead of 0 to account for
% precision effects
THRESH = 1e-8;
%
proots = roots(polyn); % get the zeroes of the polynomial
len = length(proots); % get the number of zeroes
%
while(len > 1)
   if(abs(imag(proots(1))) < THRESH) % if the zero is a real zero
       fac = [1 -real(proots(1))];
       % construct the factor with proots(1) as zero
       Factors = [Factors;[fac 0]];
   else  % if the zero has imaginary part get all zeroes whose
       %  imag part is -ve of imaginary part of proots(1)
       negimag = imag(proots)+imag(proots(1));
       % get all zeroes which have same real part as proot(1)
       samereal = real(proots)-real(proots(1));
       %find the complex conjugate zero
       index = find(abs(negimag) <THRESH & abs(samereal)<THRESH);
           if(index) % if the complex conjugate exists
               fac = [1 -2*real(proots(1)) abs(proots(1))^2];
               %form 2nd order factor
               Factors = [Factors;fac];
           else % if the complex conjugate does not exist
               fac = [1 -proots(1)];
               Factors = [Factors;[fac 0]];
           end
   end
   polyn = deconv(polyn,fac);
   %deconvolve the 1st/2nd order factor from polyn
   proots = roots(polyn); %determine the new zeros
   len = length(polyn); %determine the number of zeros
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -