Пример #1
0
        /// <summary>
        /// Creates a FFT analyzer.
        /// </summary>
        /// <param name="fft">FFT raw data.</param>
        /// <param name="parameters">Specified bin parameters.</param>
        /// <param name="real"></param>
        public FrequencyBins(FftEventArgs args, BinParameters parameters, bool real = true)
        {
            _realMode = real;
            Complex[] fft = args.Result;
            _parameters        = parameters;
            _relativeFrequency = _parameters.Relative ? real ? _parameters.SamplingRate / 4 : _parameters.SamplingRate / 2 : 0;
            _precision         = _parameters.SamplingRate / (double)fft.Length;

            FillBins(fft, real);
        }
Пример #2
0
        public YepppFrequencyBins(BinParameters parameters, int fftLength, bool real)
            : base(parameters, fftLength, real)
        {
            if (parameters.BinsPerPoint > 1)
            {
                throw new NotSupportedException();
            }

            //_rArr=new double[fftLength/2];
            _iArr      = new double[fftLength / 2];
            _ln10Value = 1 / Math.Log(10, Math.E);
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parameters"></param>
        /// <param name="fftLength"></param>
        /// <param name="real"></param>
        public FastFrequencyBins(BinParameters parameters, int fftLength, bool real)
        {
            RealMode   = real;
            Parameters = parameters;

            A = Parameters.CalibrationAmplitude * 20;
            B = (Parameters.MinimumIntensityDb * (Parameters.CalibrationAmplitude - 1.0)) +
                Parameters.CalibrationOffset;

            RelativeFrequency = Parameters.Relative ? real ? Parameters.SamplingRate / 4 : Parameters.SamplingRate / 2 : 0;
            Precision         = Parameters.SamplingRate / (double)fftLength;

            var bufferLength = real ? fftLength / 2 : fftLength;

            BinsFrequency = new double[bufferLength];
            BinsIntensity = new double[bufferLength];

            FillFrequencies();
        }
Пример #4
0
 /// <summary>
 /// Creates a FFT analyzer.
 /// </summary>
 /// <param name="fft">FFT raw data.</param>
 /// <param name="parameters">Specified bin parameters.</param>
 /// <param name="real"></param>
 public FastFrequencyBins(FftEventArgs args, BinParameters parameters, bool real = true)
     : this(parameters, args.Result.Length, real)
 {
     Update(args);
 }
Пример #5
0
 public ApproximateFrequencyBins(BinParameters parameters, int fftLength, bool real)
     : base(parameters, fftLength, real)
 {
 }
Пример #6
0
 public ApproximateFrequencyBins(FftEventArgs args, BinParameters parameters, bool real = true)
     : base(args, parameters, real)
 {
 }