コード例 #1
0
        /// <summary>
        /// Create a Peaking EQ
        /// </summary>
        public static BiQuadFilter PeakingEQ(float sampleRate, float centreFrequency, float q, float dbGain)
        {
            var filter = new BiQuadFilter();

            filter.SetPeakingEq(sampleRate, centreFrequency, q, dbGain);
            return(filter);
        }
コード例 #2
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);
        }
コード例 #3
0
        /// <summary>
        /// Create a High pass filter
        /// </summary>
        public static BiQuadFilter HighPassFilter(float sampleRate, float cutoffFrequency, float q)
        {
            var filter = new BiQuadFilter();

            filter.SetHighPassFilter(sampleRate, cutoffFrequency, q);
            return(filter);
        }
コード例 #4
0
        public void SetHighpassMode(float cutoff)
        {
            Mode       = FrequencyFilterMode.Highpass;
            CutoffHigh = cutoff;

            if (filter != null)
            {
                filter.SetHighPassFilter(Format.SampleRate, cutoff, 1);
            }
            else
            {
                filter = BiQuadFilter.HighPassFilter(Format.SampleRate, cutoff, 1);
            }
        }
コード例 #5
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);
            }
        }
コード例 #6
0
 public void Disable()
 {
     Mode   = FrequencyFilterMode.Disable;
     filter = null;
 }