コード例 #1
0
        /// <devdoc>
        /// Evaluates the transfer function of a Bessel filter. The gain is normalized to 1 for DC.
        /// It returns a complex number that corresponds to the gain and phase of the filter output.
        /// </devdoc>
        private static Complex TransferFunction(double[] besselPolynomialCoefficients, Complex frequency)
        {
            var f = new Polynomials.RationalFraction
            {
                Top    = new double[] { besselPolynomialCoefficients[besselPolynomialCoefficients.Length - 1] }, // to normalize gain at DC
                Bottom = besselPolynomialCoefficients
            };

            return(Polynomials.Evaluate(f, frequency));
        }
コード例 #2
0
 private static double ComputeGainAt(Polynomials.RationalFraction tf, Complex w)
 {
     return Complex.Abs(Polynomials.Evaluate(tf, w));
 }