예제 #1
0
        /// <summary>
        /// Gets the column frequencies. Here, the column frequency of zero is located in the center of the matrix.
        /// </summary>
        /// <param name="numberOfResultColumnFrequencies">The number of resulting column frequencies. Use the value <see cref="NumberOfColumns"/> to get all frequencies, or a value less than that to get only a part of the frequencies.</param>
        /// <returns>Vector that accomodates the column frequencies.</returns>
        /// <exception cref="System.ArgumentOutOfRangeException">NumberOfResultRows has to be less than or equal to the existing number of rows.</exception>
        public IROVector <double> GetColumnFrequenciesCentered(int numberOfResultColumnFrequencies)
        {
            if (numberOfResultColumnFrequencies > NumberOfColumns)
            {
                throw new ArgumentOutOfRangeException(string.Format("numberOfResultRows has to be less than or equal to the existing number of rows"));
            }
            int    colsNegative  = (NumberOfColumns - 1) / 2;
            double stepFrequency = 0.5 / (NumberOfColumns * (_columnSpacing.HasValue ? _columnSpacing.Value : 1));
            int    columnOffset  = (NumberOfColumns - numberOfResultColumnFrequencies) / 2;

            return(VectorMath.CreateEquidistantSequencyByStartAtOffsetStepLength(0, colsNegative - columnOffset, stepFrequency, numberOfResultColumnFrequencies));
        }