function spect_coeffs = lpc_spect(pred_coeffs, lpc_order, num_samples, gain)

  % loop over all spectrum components
  %
  for i = 0:num_samples-1

    % initialize the real and imaginary portions of the spectrum
    %
    real_part = 1.0;
    imag_part = 0.0;

    % loop over each of the predictor values
    %
    for j = 1:lpc_order
      k=j+1;
      real_part = real_part - (pred_coeffs(k)* ...
                  cos((2*pi/num_samples)*mod(i*j,num_samples)));
      imag_part = imag_part + (pred_coeffs(k)* ...
                  sin((2*pi/num_samples)*mod(i*j,num_samples)));

    end

    % save the magnitude of the spectrum
    %
    spect_coeffs(i+1) = sqrt(gain / ((real_part^2) + (imag_part^2)));

  end
