Exemple #1
0
        protected virtual void OnFftCalculated(FftEventArgs e)
        {
            EventHandler <FftEventArgs> handler = FftCalculated;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemple #2
0
        public SampleAggregator(ISampleProvider source, int fftLength = 2048)
        {
            channels = source.WaveFormat.Channels;
            if (!IsPowerOfTwo(fftLength))
            {
                throw new ArgumentException("FFT Length must be a power of two");
            }
            this.m            = (int)Math.Log(fftLength, 2.0);
            this.fftLength    = fftLength;
            this.fftBuffer[0] = new Complex[fftLength];
            this.fftBuffer[1] = new Complex[fftLength];
            this.fftBuffer[2] = new Complex[fftLength];
            this.fftArgs      = new FftEventArgs(fftBuffer[0]);
            this.source       = source;


            // moje zmiany
            filters    = new BiQuadFilter[3];
            filters[0] = BiQuadFilter.LowPassFilter(44100, 500, 1);
            filters[1] = BiQuadFilter.BandPassFilterConstantPeakGain(44100, 1750, 1);
            filters[2] = BiQuadFilter.HighPassFilter(44100, 3000, 1);
        }
Exemple #3
0
 void audioGraph_FftCalculated(object sender, FftEventArgs e)
 {
     spectrumAnalyser.Update(e.Result, e.currentFilterIndex);
 }