Beispiel #1
0
        public uint GetFramesCountForFrequencyRegion(long lowerFrequency, long upperFrequency, BinDataMode mode)
        {
            BufferFramesObject zoomedOutBufferObject = mainForm.bufferFramesArray.GetBufferFramesObject(0);

            long lowerIndex = (long)((lowerFrequency - zoomedOutBufferObject.lowerFrequency) / zoomedOutBufferObject.binSize);
            long upperIndex = (long)((upperFrequency - zoomedOutBufferObject.lowerFrequency) / zoomedOutBufferObject.binSize);

            uint frames = 0;

            for (long i = lowerIndex; i < upperIndex; i++)
            {
                if (bufferFramesArray[(int)i].mode == mode)
                {
                    frames++;
                }
            }

            return(frames);
        }
Beispiel #2
0
        public TransitionGradient GetTransitionsGradient()
        {
            if (bufferFramesArray.Count > 0)
            {
                Gradient gradient;

                double[] transitionsStrengthArray;

                TransitionGradient transitionGradient;

                transitionsStrengthArray = GetAveragedStrengthOverTimeForRange(0, bufferFramesArray[0].bufferArray.Length);
                gradient = SignalDataUtilities.SeriesTransitionGradient(transitionsStrengthArray, Gradient.divisionsCount);

                double gradientStrength = gradient.CalculateTransitionGradient();

                long index = bufferFramesArray[0].bufferArray.Length / 2;

                long frequency = Utilities.GetFrequencyFromIndex((long)(index), parent.lowerFrequency, mainForm.binSize);


                BufferFramesObject zoomedOutBufferObject = mainForm.bufferFramesArray.GetBufferFramesObject(0);

                Utilities.FrequencyRange frequencyRange = Utilities.GetIndicesForFrequencyRange(frequency, frequency, zoomedOutBufferObject.lowerFrequency, zoomedOutBufferObject.binSize);


                long width = bufferFramesArray[0].bufferArray.Length / 2;


                ////transitionGradient = new TransitionGradient(frequency, (long) frequencyRange.lower, gradientStrength, this.transitions,gradient,width, Utilities.GetFrequencyFromIndex((long)(index-width), parent.lowerFrequency, mainForm.binSize), Utilities.GetFrequencyFromIndex((long)(index+width), parent.lowerFrequency, mainForm.binSize));

                transitionGradient = new TransitionGradient(frequency, index, gradientStrength, this.transitions, gradient, width, Utilities.GetFrequencyFromIndex((long)(index - width), parent.lowerFrequency, mainForm.binSize), Utilities.GetFrequencyFromIndex((long)(index + width), parent.lowerFrequency, mainForm.binSize));

                return(transitionGradient);
            }

            return(null);
        }
Beispiel #3
0
 public BufferFrames(Form1 mainForm, BufferFramesObject parent)
 {
     this.mainForm = mainForm;
     this.parent   = parent;
 }
Beispiel #4
0
        public void Flush(BinData farSeries, BinData nearSeries, BinData indeterminateSeries)
        {
            if (farSeries != null || nearSeries != null || indeterminateSeries != null)
            {
                BinData targetBinData;

                if (farSeries.totalBinArray.Length == 0)
                {
                    farSeries.totalBinArray = new float[nearSeries.totalBinArray.Length];
                    farSeries.totalBinArrayNumberOfFrames = new float[nearSeries.totalBinArrayNumberOfFrames.Length];
                }

                minFrameIndex = bufferFramesArray.Count;

                BufferFramesObject zoomedOutBufferObject = mainForm.bufferFramesArray.GetBufferFramesObject(0);

                long lowerIndex = (long)((parent.lowerFrequency - zoomedOutBufferObject.lowerFrequency) / zoomedOutBufferObject.binSize);
                long upperIndex = (long)((parent.upperFrequency - zoomedOutBufferObject.lowerFrequency) / zoomedOutBufferObject.binSize);

                for (int i = 0; i < bufferFramesArray.Count; i++)
                {
                    bufferFramesArray[i].stackedFrames = 0;

                    if (bufferFramesArray[i].mode == BinDataMode.Far)
                    {
                        targetBinData = farSeries;
                    }
                    else
                    if (bufferFramesArray[i].mode == BinDataMode.Near)
                    {
                        targetBinData = nearSeries;
                    }
                    else
                    if (bufferFramesArray[i].mode == BinDataMode.Indeterminate)
                    {
                        targetBinData = indeterminateSeries;
                    }
                    else
                    {
                        targetBinData = null;
                    }

                    if (targetBinData != null)
                    {
                        int k = 0;

                        for (long j = lowerIndex; j < upperIndex; j++)
                        {
                            targetBinData.totalBinArray[j] += bufferFramesArray[i].bufferArray[k];
                            targetBinData.totalBinArrayNumberOfFrames[j]++;

                            k++;
                        }

                        targetBinData.bufferFrames--;
                    }
                }
            }

            bufferFramesArray.Clear();

            currentBufferIndex = -1;
            ////currentBufferIndex = 0;
            startBufferIndex = 1;

            transitions = 0;

            minFrameIndex = -1;

            bufferFilled = false;
        }
Beispiel #5
0
        public TransitionGradient GetRangeTransitionsGradientForFrequency(long frequency)
        {
            BufferFramesObject bufferFramesObjectForFrequency = GetBufferFramesObjectForFrequency(frequency);

            return(bufferFramesObjectForFrequency.transitionBufferFrames.GetTransitionsGradient());
        }
Beispiel #6
0
        public bool EvaluateWhetherReradiatedFrequency(long frequency)
        {
            BufferFramesObject bufferFramesObjectForFrequency = GetBufferFramesObjectForFrequency(frequency);

            return(bufferFramesObjectForFrequency.EvaluateWhetherReradiatedFrequency(frequency));
        }
Beispiel #7
0
        public long AddBufferFramesObject(BufferFramesObject bufferObject)
        {
            bufferFramesObjects.Add(bufferObject);

            return(bufferFramesObjects.Count);
        }
Beispiel #8
0
        public AnalysisOption(int leaderBoardSignalIndex, BufferFramesObject bufferFramesObject)
        {
            this.leaderBoardSignalIndex = leaderBoardSignalIndex;

            this.bufferFramesObject = bufferFramesObject;
        }