dan@0: % a high-level function for computing a DTFT based DDM dan@0: % (constructs the linear system of equations using distribution derivative rule and solves it via dan@0: % pseudo-inverse (pinv). Use this function if non-Fourier kernels are needed or dan@0: % DTFT at specific frequency rather than FFT is required for whatever reason... dan@0: % no zero-padding is used internally dan@0: function [gdi,r, A,b, gdi_lns, r_lns] = ddm_gen(krnls, krlns_ders, mf_ders, sig, N, tol) dan@0: %generic multi-frequency distribution derivative based estimator for dan@0: % non-stationary sinusoidal analysis dan@0: % dan@0: % dan@0: % [1] Michael Betser: Sinusoidal Polynomial Estimation Using The Distribution dan@0: % Derivative, in IEEE Transactions on Signal Processing, Vol.57, Nr. 12, dan@0: % December 2009 dan@0: % dan@0: % krnls: matrix of all the kernels... N x R , where R is the number of dan@0: % non-static parameters to estimate and at the same time, the number dan@0: % of kernels dan@0: % dan@0: % krlns_ders: matrix of all the kernel time derivatives... N x R , where R dan@0: % is the number of non-static parameters to estimate and at the same dan@0: % time, the number of kernels dan@0: % dan@0: % mf_ders: matrix of all the model function time derivatives... N x Q , where Q dan@0: % is the number of model functions dan@0: % dan@0: % dan@0: % sig: vector - signal, N x 1 (CAUTION: MUST be column vector!!!) dan@0: % dan@0: % N: odd integer - signal buffer length, ... dan@0: % dan@0: % For any reasonable use, Q equals R, otherwise it makes little sense. dan@0: % Kernels must include the window function... dan@0: dan@0: [A,b] = ddm_lin_sys(krnls, krlns_ders, mf_ders, sig, N); dan@0: dan@0: % solving via pinv with provided tolerance dan@0: gdi = pinv(A,tol) * b; dan@0: % r = rcond(A); dan@0: % [gdi_lns r_lns] = linsolve(A,b); dan@0: end