Beispiel #1
0
        public FilterOrderSpec(FilterOrderSpec spec)
        {
            if (spec == null)
                return;

            spec.CopyTo(this);
            return;
        }
Beispiel #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="cornerFreqs">The corner frequencies in radians/sample.  Only the first element is used in a low/high pass filter.</param>
        /// <param name="order"></param>
        /// <param name="bandType"></param>
        /// <returns></returns>
        public static FilterOrderSpec CreateButterworthSpec(Pair<double,double> cornerFreqs, int order, BandType bandType)
        {
            FilterOrderSpec spec = new FilterOrderSpec();
            spec.CornerFreqs = cornerFreqs;
            spec.Order = order;
            spec.Ripple = 0.0;
            spec.BandType = bandType;
            spec.FilterType = IirFilterType.Butterworth;

            return spec;
        }
Beispiel #3
0
 public void CopyTo(FilterOrderSpec spec)
 {
     spec.CornerFreqs = new Pair<double,double>(CornerFreqs);
     spec.Order = Order;
     spec.Ripple = Ripple;
     spec.BandType = BandType;
     spec.FilterType = FilterType;
     return;
 }
Beispiel #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="cornerFreqs">The corner frequencies in radians/sample.  Only the first element is used in a low/high pass filter.</param>
        /// <param name="order"></param>
        /// <param name="ripple"></param>
        /// <param name="bandType"></param>
        /// <returns></returns>
        public static FilterOrderSpec CreateChebyshevType2Spec(Pair<double, double> cornerFreqs, int order, double ripple, BandType bandType)
        {
            FilterOrderSpec spec = new FilterOrderSpec();
            spec.CornerFreqs = cornerFreqs;
            spec.Order = order;
            spec.Ripple = ripple;
            spec.BandType = bandType;
            spec.FilterType = IirFilterType.ChebyshevType2;

            return spec;
        }