Ejemplo n.º 1
0
 public SampleAggregator(int fftLength)
 {
     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);
 }
Ejemplo n.º 2
0
        private void SA_FftCalculated(object sender, FftEventArgs e)
        {
            var points = new List <PointF>();

            for (var index = 0; index < 16; index++)
            {
                var avg    = e.Result.Skip(index * 16).Take(1).Average(r => r.Y);
                var newVal = GetYPosLog(new Complex()
                {
                    X = index, Y = avg
                });
                points.Add(new PointF(index, (float)(newVal)));
                var index1 = index;
                RunOnUiThread(() => seekbars[index1].Progress = (int)(0 - newVal));
            }

            //RunOnUiThread(() => seekBar2.Progress = 0-(int)points[10].Y);
            Console.WriteLine((int)points[0].X + "," + (int)points[10].Y);
        }