dan@0: function [df3,A_sys,b_sys] = ddm_fft_3(win, win_der, mf_ders, sig, N, N_fft, fs) dan@0: R = 3; dan@0: Q = R; % nr of unknows is the same as the number of model funcs dan@0: [A_sys b_sys] = ddm_lin_sys_fft(Q, R, win, win_der, mf_ders, sig, N, N_fft, fs); dan@0: % A_sys1 = cat(2,shiftdim(A(1:N_fft-2,1),-2),shiftdim(A(1:N_fft-2,2),-2),shiftdim(A(1:N_fft-2,3),-2)); dan@0: % A_sys2 = cat(2,shiftdim(A(2:N_fft-1,1),-2),shiftdim(A(2:N_fft-1,2),-2),shiftdim(A(2:N_fft-1,3),-2)); dan@0: % A_sys3 = cat(2,shiftdim(A(3:N_fft ,1),-2),shiftdim(A(3:N_fft ,2),-2),shiftdim(A(3:N_fft ,3),-2)); dan@0: % A_sys = cat(1,A_sys1,A_sys2,A_sys3); dan@0: % b_sys = cat(1,shiftdim(b(1:N_fft-2).',-1),shiftdim(b(2:N_fft-1).', -1),shiftdim(b(3:N_fft ).', -1)); dan@0: df3 = lin_solve_dgr_3(A_sys,b_sys,N_fft-2); %hardcoded degree 3 solver (fast) dan@0: dan@0: end