spike.m

来自「solution for the Statistical modelling f」· M 代码 · 共 55 行

M
55
字号
function [h,err] = spike(g,n0,n)%SPIKE	Finds the FIR least squares inverse of g(n)%----%USAGE:	[h,err] = spike(g,n0,n) %%	g   : the filter that is to be inverted%	n0  : the delay used in the minimization of%		e(n)=g(n)*g(n) - delta(n-n0)%	n   : order (number of coefficients) in h%	h   : the FIR least squares inverse of g%	err : squared error in the approximation%%---------------------------------------------------------------% copyright 1996, by M.H. Hayes.  For use with the book % "Statistical Digital Signal Processing and Modeling"% (John Wiley & Sons, 1996).%---------------------------------------------------------------g   = g(:);m   = length(g);if m+n-1<=n0, error('Delay too large'), endG   = convm(g,n);d   = zeros(m+n-1,1);d(n0+1) = 1;h   = G\d;err = 1 - G(n0+1,:)*h;end;

⌨️ 快捷键说明

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