function out = taylorwinC (m, n_bar, sll)




  out = zeros(1, m);
  fq = zeros(1, n_bar - 1);


  temp = 0; 
  temp_sum = 0;


  b = b_constant (sll);


  a = a_constant (b);


  a_sq = a * a;


  sigma_sq = sigma (n_bar, a_sq);


  for index = 1:n_bar - 1
    fq(index) = f_constant (sigma_sq, a_sq, n_bar, index, a);
  end


  for out_index = 1:1:m


    n = out_index - 1;
    temp_sum = 0;


    for inner_index = 1:n_bar - 1
      temp = fq(inner_index) * cos_arg(m, inner_index, n);
      temp_sum = temp + temp_sum;
    end

    temp_sum = temp_sum * 2;
    out(out_index) = 1 + temp_sum;

  end

end


function a = a_constant (b)

  a = b * b;
  a = a - 1;
  a = sqrt(a);
  a = a + b;
  a = log(a);
  a = a / pi;

end


function b = b_constant (sll)

  b = sll / 20;
  b = b * -1;
  b = 10^b;

end


function sigma_sq = sigma (n_bar, a_sq)

  sigma_sq = n_bar * n_bar;
  temp = n_bar - 0.5;
  temp = temp * temp;
  temp = temp + a_sq;
  sigma_sq = sigma_sq / temp;

end



function fq = f_constant (sigma_sq, a_sq, n_bar, m, a)

  fq = top_multi (a, sigma_sq, m, n_bar, a_sq);
  fq = fq / bottom_multi (m, n_bar);

end



function out = top_multi (a, sigma_sq, m, n_bar, a_sq)

  m_sq = m * m;

  top_frac = m_sq / sigma_sq;
  temp = 0;
  out = 1;

  for index = 1:1:n_bar - 1

    bottom = index - 0.5;
    bottom = bottom * bottom;
    bottom = bottom + a_sq;
    temp = top_frac / bottom;
    temp = 1 - temp;
    out = out * temp;

  end

  if ( mod( (m + 1), 2 ) > 0 )
    out = out * -1;
  end

end



function out = bottom_multi (m, n_bar)

  m_sq = m * m;
  out = 1;
  temp = 0;

  for index = 1:1:n_bar - 1

    if (index == m)
      continue;
    end

    temp = index * index;
    temp = m_sq / temp;
    temp = 1 - temp;
    out = out * temp;

  end

  out = out * 2;

end

function out = cos_arg (n_size, m, n)

  out = n_size * 0.5;
  out = n - out;
  out = out + 0.5;
  out = out * 2 * pi * m;
  out = out / n_size;
  out = cos(out);

end

