Example #1
0
 public SampleAggregator(ISampleProvider source, int fftLength = 1024)
 {
     _channels = source.WaveFormat.Channels;
     if (!IsPowerOfTwo(fftLength))
     {
         throw new ArgumentException("FFT Length must be a power of two");
     }
     _m = (int)Math.Log(fftLength, 2.0);
     _fftLength = fftLength;
     _fftBuffer = new Complex[fftLength];
     _fftArgs = new FftEventArgs(_fftBuffer);
     _source = source;
 }
Example #2
0
 public SampleAggregator(ISampleProvider source, int fftLength = 1024)
 {
     _channels = source.WaveFormat.Channels;
     if (!IsPowerOfTwo(fftLength))
     {
         throw new ArgumentException("FFT Length must be a power of two");
     }
     _m         = (int)Math.Log(fftLength, 2.0);
     _fftLength = fftLength;
     _fftBuffer = new Complex[fftLength];
     _fftArgs   = new FftEventArgs(_fftBuffer);
     _source    = source;
 }