function dg3 = gen_ddm_fft(krnls, krlns_ders, mf_ders, sig, N)
% multi-frequency distribution derivative based non-stationary sinusoidal estimator 
%  can estimate only 1 sinusoid at the once
%
%
% [1] Michael Betser: Sinusoidal Polynomial Estimation Using The Distribution
% Derivative, in IEEE Transactions on Signal Processing, Vol.57, Nr. 12,
% December 2009
%
% krnls: matrix of all the kernels... N x R x K, where R is the number of 
%      non-static parameters to estimate and at the same time, the number 
%      of kernels for each sinusoid, K
%
% krlns_ders: matrix of all the kernel time derivatives... N x R x K , where R 
%     is the number of non-static parameters to estimate and at the same 
%     time, the number of kernels
%
% mf_ders: matrix of all the model function time derivatives... N x Q , where Q 
%     is the number of model functions
%
%
% sig: vector - signal, N x 1 (CAUTION: MUST be column vector!!!)
%
% N: odd integer - signal buffer length, ...
%
% K: number of sinusoids to estimate - NOT OVERLAPPING!!!
%
% For any reasonable use, Q equals R, otherwise it makes little sense.
% Kernels must include the window function...

R = size(krnls,2);
assert(R == size(krlns_ders,2) );
assert(R == size(mf_ders,2) );

[A, b] = ddm_lin_sys(krnls, krlns_ders, mf_ders, sig, N); % generate the linear system of eqs (slow)
%dg2 = lin_solve_dgr_3(A,b,1); %hardcoded degree 2 solver (fast)
dg2 = [];


