今天擦完了玻璃,尽管有地方不那么明亮干净,冷风中瑟瑟发抖,年也快临近了。
代码是从网上找的,
function [p, np, r, nr] = deconv_m(b, nb, a, na) % Modified deconvolution routine for noncausal sequences % ---------------------------------------------------- % function [p, np, r, nr] = deconv_m(b, nb, a, na) % % p = polynomial part of support np1 <=n <= np2 % np = [np1, np2] % r = remainder part of support nr1 <= n <= nr2 % nr = [nr1, nr2] % b = numerator palynomial of support nb1 <= n <= nb2 % nb = [nb1, nb2] % a = denominal polynomial of support na1 <= n <= na2 % na = [na1, na2] % npb = nb(1)-na(1); npe = nb(length(b)) - na(length(a)); np = [npb:npe]; nr = nb; [p, r] = deconv(b, a);
运行代码如下:
%% ---------------------------------------------------------------------------- %% Output Info about this m-file fprintf(' *********************************************************** '); fprintf(' <DSP using MATLAB> Problem 4.10 '); banner(); %% ---------------------------------------------------------------------------- %% ------------------------------------------------- %% 1 X(z) %% ------------------------------------------------- b = [1, 1, 1, 1, 1, 1]; nb = [-2:3]; a = [1, 2, 1]; na = [-1:1]; %[p, r] = deconv(b, a) [p, np, r, nr] = deconv_m(b, nb, a, na)
运行结果: