Esempio n. 1
0
        /// <summary>
        /// Create a bandpass filter with constant skirt gain
        /// </summary>
        public static BiQuadFilter BandPassFilterConstantSkirtGain(float sampleRate, float centreFrequency, float q)
        {
            var filter = new BiQuadFilter();

            filter.SetBandPassFilter(sampleRate, centreFrequency, q);
            return(filter);
        }
Esempio n. 2
0
        public void SetBandpassMode(float cutoffLow, float cutoffHigh)
        {
            Mode       = FrequencyFilterMode.Bandpass;
            CutoffLow  = cutoffLow;
            CutoffHigh = cutoffHigh;
            float center = cutoffLow + ((cutoffHigh - cutoffLow) / 2);
            float q      = center / (cutoffHigh - cutoffLow);

            if (filter != null)
            {
                filter.SetBandPassFilter(Format.SampleRate, center, q);
            }
            else
            {
                filter = BiQuadFilter.BandPassFilterConstantSkirtGain(Format.SampleRate, center, q);
            }
        }