예제 #1
0
        /// <summary>
        /// Return tonic statistic.
        /// </summary>
        ///
        /// <param name="tonicCoordinates">List of SCL tonic signal values.</param>
        /// <param name="numberOfAffectedPoints">Number of affected points.</param>
        ///
        /// <returns>
        /// Tonic statistic for a specified lst of SCL tonic signal values.
        /// </returns>
        public TonicStatistics GetTonicStatistic(List <SignalDataByTime> tonicCoordinates, int numberOfAffectedPoints)
        {
            InflectionLine         inflectionLinesHandler = new InflectionLine();
            List <InflectionPoint> inflectionPoints       = inflectionLinesHandler.GetInflectionPoints(AffectedCoordinatePoints(tonicCoordinates, numberOfAffectedPoints), "lowPass");

            return(GetTonicStatisticsForPoints(inflectionPoints));
        }
예제 #2
0
        /// <summary>
        /// Calculate arousal statistics for the passed time window.
        /// </summary>
        ///
        /// <param name="highPassCoordinates">List of all signal values stored in the cache.</param>
        /// <param name="numberOfAffectedPoints">Number of affected points.</param>
        /// <param name="timeWindow">Time wondow.</param>
        ///
        /// <returns>
        /// Arousal statistics for the passed time window.
        /// </returns>
        private ArousalStatistics GetArousalInfoForCoordinates(List <SignalDataByTime> highPassCoordinates, int numberOfAffectedPoints, double timeWindow)
        {
            InflectionLine          inflectionLinesHandler          = new InflectionLine();
            List <SignalDataByTime> highPassCoordinatesByTimeWindow = AffectedCoordinatePoints(highPassCoordinates, numberOfAffectedPoints);
            List <InflectionPoint>  inflectionPoints = inflectionLinesHandler.GetInflectionPoints(highPassCoordinatesByTimeWindow, "highPass");
            ArousalStatistics       result           = new ArousalStatistics();

            result = GetArousalInfoForInflectionPoints(inflectionPoints, timeWindow);
            result.SCRArousalArea          = GetArousalArea(highPassCoordinatesByTimeWindow, timeWindow);
            result.MovingAverage           = GetMovingAverage(signalValues, numberOfAffectedPoints);
            result.GeneralArousalLevel     = GetGeneralArousalLevel(result.MovingAverage);
            result.SCRAchievedArousalLevel = GetPhasicLevel(result.SCRArousalArea);
            result.LastValue          = highPassCoordinates.ElementAt(highPassCoordinates.Count - 1).HighPassValue;
            result.LastRawSignalValue = signalValues.ElementAt(signalValues.Length - 1).SignalValue;

            return(result);
        }