Example #1
0
 public SampleAggregator(ISampleProvider source, int fftLength = 1024)
 {
     channels = source.WaveFormat.Channels;
     if (!IsPowerOfTwo(fftLength))
     {
         throw new ArgumentException("FFT 长度必须为2的次方");
     }
     m = (int)Math.Log(fftLength, 2.0);
     this.fftLength = fftLength;
     fftBuffer      = new Complex[fftLength];
     fftArgs        = new FftEventArgs(fftBuffer);
     this.source    = source;
 }
Example #2
0
 private void Aggregator_FFTCalculated(object sender, FftEventArgs e)
 {
     OnFFTCalculated?.Invoke(sender, e);
 }