Beispiel #1
0
 public RMSdetector(int __fs, double __tau)
 {
     _fs    = __fs;
     _tau   = __tau;
     rmsdet = new BiQuad(_fs, BiQuad.BiQuadOrder.Second, BiQuad.BiQuadMode.LowPass, 1.0 / (2.0 * Math.PI * _tau), Math.Sqrt(2.0));
     dcFilt = new BiQuad(_fs, BiQuad.BiQuadOrder.Second, BiQuad.BiQuadMode.LowPass, 1.0 / (2.0 * Math.PI * 10.0 * _tau), Math.Sqrt(2.0));
     updateTau();
 }
Beispiel #2
0
        public Averager(int _sampleRate, int __len, AveragerCallback _callback)
        {
            averager     = null;
            averagerName = "";
            callback     = _callback;
            sampleRate   = _sampleRate;
            _len         = __len;

            removeDC   = false;
            DCStripper = new BiQuad(sampleRate, BiQuad.BiQuadOrder.Second, BiQuad.BiQuadMode.LowPass, 10.0, 0.71);
        }
        public SimplePulseDetector(List <float[]> monoBuffers, bool lfeProvided,
                                   BiQuad biQuadFilter = null, double alpha = 0.7, double margin = 3.5, double noiseThreshold = -40)
        {
            this.alpha          = alpha;
            this.biQuadFilter   = biQuadFilter;
            this.lfeProvided    = lfeProvided;
            this.margin         = margin;
            this.monoBuffers    = monoBuffers;
            this.noiseThreshold = noiseThreshold;
            stopwatch.Start();

            mixedMonoLevel = new double[monoBuffers[0].Length];
            filterBuffer   = new float[mixedMonoLevel.Length];
        }