Пример #1
0
        public override PcmFormat Setup(PcmFormat inputFormat)
        {
            SampleRate     = inputFormat.SampleRate;
            mFilterFreq    = ButterworthFilter.Design(SampleRate, CutoffFrequency, FFT_LEN, FilterSlopeDbOct);
            mIfftAddBuffer = null;
            mFirstFilterDo = true;

            return(new PcmFormat(inputFormat));
        }
Пример #2
0
        private void DesignFreqFilter()
        {
            var filter = ButterworthFilter.Design(mInputPcmFormat.SampleRate, mInputPcmFormat.SampleRate * 0.465, FftLength, 600);

            mFreqFilter    = new double[UpsampleFftLength];
            mFreqFilter[0] = filter[0].Magnitude();
            for (int i = 1; i < mFreqFilter.Length; ++i)
            {
                if (i <= FftLength / 2)
                {
                    mFreqFilter[i] = filter[i].Magnitude();
                    mFreqFilter[UpsampleFftLength - i] = mFreqFilter[i];
                }
            }
        }