function [A_sys,b_sys,sig_fft] = ddm_der2_lin_sys_fft(Q, R, win, win_der, mf_ders, sig, N, N_fft, fs)
  
  assert(size(mf_ders,1) == N );
  assert(size(mf_ders, 2) == R);
  assert(size(win,1) == N );
  assert(size(win,2) == 1 );
  assert(size(win_der,1) == N );
  assert(size(win_der,2) == 1 );
  assert(size(sig,1) == N );
  assert(size(sig,2) == 1 );
  assert(N <= N_fft);
  
  win_mat  = repmat(win, 1, R);
  frqs_fft = [0:N_fft-1]'*fs*2*pi/N_fft;
  [str_idx end_idx] = zpzh_idxs(N);
  sig_mat  = repmat(sig, 1, R);
  t = disc_time_axis(N)/fs;
  fft_sig_win_bffr     = win .* sig * 2.* t';
  fft_sig_win          = fft([fft_sig_win_bffr(str_idx,:);zeros(N_fft-N,1);fft_sig_win_bffr(end_idx,:)],N_fft,1);
  fft_sig_mat_bffr     = win_mat .* sig_mat .* mf_ders; % S_t^2w, S_t^3w
  fft_sig_win_der_bffr = win_der .* sig .* mf_ders(:,1); % S_t^2w'
  fft_sig_win_der      = fft([fft_sig_win_der_bffr(str_idx,:);zeros(N_fft-N,1);fft_sig_win_der_bffr(end_idx,:)],N_fft,1);
  A =   fft([fft_sig_mat_bffr(str_idx,:);zeros(N_fft-N,R);fft_sig_mat_bffr(end_idx,:)], N_fft, 1); %zero padded sheezl
  %b = -(-1j*fft_sig_win_der - 1j* fft_sig_win - frqs_fft.* A(:,1));
  b = -(-fft_sig_win_der - 2 * fft_sig_win + 1j*frqs_fft.* A(:,1));
% create the actual matrixes
  A_sys = zeros(Q,R,N_fft-Q+1);
  b_sys = zeros(Q,1,N_fft-Q+1);
  for k=1:Q
    A_sys(k,:,:) = -1j*shiftdim(A(k:N_fft-Q+k,:).',-1);
    b_sys(k,:,:) =     shiftdim(b(k:N_fft-Q+k).'  ,-1);
  end
  sig_fft = A(:,1);
end
