Пример #1
0
        private void AnalyzeFloat(FloatArgs e)
        {
            if (_real)
            {
                for (var n = 0; n < e.DataLength; n += _channels)
                {
                    var f = e.RawData[n];
                    Add(f, 0);
                }
            }
            else // NetRadio.Devices.G3XDdc.Signal.G3XDdcDdc2StreamProvider
            {
                for (var n = 0; n < e.DataLength; n += _channels * 2)
                {
                    var r = e.RawData[n];
                    var i = e.RawData[n + 1];
                    Add(r, i);
                }
            }

            if (ForceInstantFft)
            {
                CalculateFft();
            }
        }
Пример #2
0
 private void FloatChunkRecieved(object sender, FloatArgs e)
 {
     logger.Debug(string.Format("FLOAT CHUNK RECIEVED - {7,7} : Source: {0,-55} Real: {1} Step: {2} Bits: {3} Sample rate: {4,-10} Data length: {5,-7} Fft Length: {6,-6}", sender.ToString(), _real, _step, _converter.BitRate, e.SamplingRate, e.RawData.Length, _fftLength, _pushCount + 1));
     lock (_bufferLock)
     {
         _pushCount++;
         _floatArgs = e;
     }
 }
Пример #3
0
        private void AnalyzeFloat(FloatArgs e)
        {
            _in.Initialize();
            _out.Initialize();

            Buffer.BlockCopy(e.RawData, 0, _in, 0, e.DataLength);

            fftwf.execute(_handlePlan);

            if (FftCalculated != null)
            {
                FftCalculated(this, _args);
            }
        }
Пример #4
0
 private void FloatChunkRecieved(object sender, FloatArgs e)
 {
     if (SameContext)
     {
         AnalyzeFloat(e);
     }
     else
     {
         lock (_bufferLock)
         {
             _pushCount++;
             _floatArgs = e;
         }
     }
 }