001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.commons.math3.transform; 018 019/** 020 * This enumeration defines the various types of normalizations that can be 021 * applied to discrete cosine transforms (DCT). The exact definition of these 022 * normalizations is detailed below. 023 * 024 * @see FastCosineTransformer 025 * @since 3.0 026 */ 027public enum DctNormalization { 028 /** 029 * Should be passed to the constructor of {@link FastCosineTransformer} 030 * to use the <em>standard</em> normalization convention. The standard 031 * DCT-I normalization convention is defined as follows 032 * <ul> 033 * <li>forward transform: 034 * y<sub>n</sub> = (1/2) [x<sub>0</sub> + (-1)<sup>n</sup>x<sub>N-1</sub>] 035 * + ∑<sub>k=1</sub><sup>N-2</sup> 036 * x<sub>k</sub> cos[π nk / (N - 1)],</li> 037 * <li>inverse transform: 038 * x<sub>k</sub> = [1 / (N - 1)] [y<sub>0</sub> 039 * + (-1)<sup>k</sup>y<sub>N-1</sub>] 040 * + [2 / (N - 1)] ∑<sub>n=1</sub><sup>N-2</sup> 041 * y<sub>n</sub> cos[π nk / (N - 1)],</li> 042 * </ul> 043 * where N is the size of the data sample. 044 */ 045 STANDARD_DCT_I, 046 047 /** 048 * Should be passed to the constructor of {@link FastCosineTransformer} 049 * to use the <em>orthogonal</em> normalization convention. The orthogonal 050 * DCT-I normalization convention is defined as follows 051 * <ul> 052 * <li>forward transform: 053 * y<sub>n</sub> = [2(N - 1)]<sup>-1/2</sup> [x<sub>0</sub> 054 * + (-1)<sup>n</sup>x<sub>N-1</sub>] 055 * + [2 / (N - 1)]<sup>1/2</sup> ∑<sub>k=1</sub><sup>N-2</sup> 056 * x<sub>k</sub> cos[π nk / (N - 1)],</li> 057 * <li>inverse transform: 058 * x<sub>k</sub> = [2(N - 1)]<sup>-1/2</sup> [y<sub>0</sub> 059 * + (-1)<sup>k</sup>y<sub>N-1</sub>] 060 * + [2 / (N - 1)]<sup>1/2</sup> ∑<sub>n=1</sub><sup>N-2</sup> 061 * y<sub>n</sub> cos[π nk / (N - 1)],</li> 062 * </ul> 063 * which makes the transform orthogonal. N is the size of the data sample. 064 */ 065 ORTHOGONAL_DCT_I; 066}