dan@0
|
1 % distribution derivative method:
|
dan@0
|
2 % 2nd degree system solver is used, make sure the data provided corresponds to that
|
dan@0
|
3 function dg2 = gen_ddm_2(krnls, krlns_ders, mf_ders, sig, N)
|
dan@0
|
4 % multi-frequency distribution derivative based non-stationary sinusoidal estimator
|
dan@0
|
5 % can estimate only 1 sinusoid at the once
|
dan@0
|
6 %
|
dan@0
|
7 %
|
dan@0
|
8 % [1] Michael Betser: Sinusoidal Polynomial Estimation Using The Distribution
|
dan@0
|
9 % Derivative, in IEEE Transactions on Signal Processing, Vol.57, Nr. 12,
|
dan@0
|
10 % December 2009
|
dan@0
|
11 %
|
dan@0
|
12 % krnls: matrix of all the kernels... N x R x K, where R is the number of
|
dan@0
|
13 % non-static parameters to estimate and at the same time, the number
|
dan@0
|
14 % of kernels for each sinusoid, K
|
dan@0
|
15 %
|
dan@0
|
16 % krlns_ders: matrix of all the kernel time derivatives... N x R x K , where R
|
dan@0
|
17 % is the number of non-static parameters to estimate and at the same
|
dan@0
|
18 % time, the number of kernels
|
dan@0
|
19 %
|
dan@0
|
20 % mf_ders: matrix of all the model function time derivatives... N x Q , where Q
|
dan@0
|
21 % is the number of model functions
|
dan@0
|
22 %
|
dan@0
|
23 %
|
dan@0
|
24 % sig: vector - signal, N x 1 (CAUTION: MUST be column vector!!!)
|
dan@0
|
25 %
|
dan@0
|
26 % N: odd integer - signal buffer length, ...
|
dan@0
|
27 %
|
dan@0
|
28 % K: number of sinusoids to estimate - NOT OVERLAPPING!!!
|
dan@0
|
29 %
|
dan@0
|
30 % For any reasonable use, Q equals R, otherwise it makes little sense.
|
dan@0
|
31 % Kernels must include the window function...
|
dan@0
|
32
|
dan@0
|
33
|
dan@0
|
34 R = size(krnls,2);
|
dan@0
|
35 assert(R == 2);
|
dan@0
|
36 assert(R == size(krlns_ders,2) );
|
dan@0
|
37 assert(R == size(mf_ders,2) );
|
dan@0
|
38
|
dan@0
|
39 [A, b] = ddm_lin_sys(krnls, krlns_ders, mf_ders, sig, N); % generate the linear system of eqs (slow)
|
dan@0
|
40 dg2 = lin_solve_dgr_2(A,b,1); %hardcoded degree 2 solver (fast)
|
dan@0
|
41
|
dan@0
|
42
|