dan@0: function [dg rs] = ddm_fft(R,w, w_d, mf_ders,sig, N, N_fft,fs) dan@0: % multi-frequency distribution derivative based non-stationary sinusoidal estimator dan@0: % can estimate only 1 sinusoid at the once 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 x K, where R is the number of dan@0: % non-static parameters to estimate and at the same time, the number dan@0: % of kernels for each sinusoid, K dan@0: % dan@0: % krlns_ders: matrix of all the kernel time derivatives... N x R x K , 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: % K: number of sinusoids to estimate - NOT OVERLAPPING!!! 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: dan@0: Q = size(mf_ders,2); dan@0: dan@0: [A_,b_,As, bs] = ddm_lin_sys_fft(R, size(mf_ders, 2), w, w_d, mf_ders, sig, N, N_fft, fs); dan@0: %[A, b] = ddm_lin_sys(krnls, krlns_ders, mf_ders, sig, N); % generate the linear system of eqs (slow) dan@0: %dg2 = lin_solve_dgr_3(A,b,1); %hardcoded degree 2 solver (fast) dan@0: dg = zeros(Q,N_fft-R+1); dan@0: rs = zeros(1,N_fft-R+1); dan@0: for k = 1:N_fft-R+1 dan@0: A = As(:,:,k); dan@0: b = bs(:,k); dan@0: Asq = A.'*A; dan@0: rs(k) = rcond(Asq); dan@0: dg(:,k) = inv(Asq)*A.'*b; dan@0: end