/// /// <summary> * Create an FFT transformer for a given sample size. This preallocates /// * resources appropriate to that block size. A specified window /// * function will be applied to all input data. /// * </summary> /// * <param name="size"> The number of samples in a block that we will /// * be asked to transform. Must be a power of 2. </param> /// * <param name="window"> Window function to apply to all input data. /// * Its block size must be the same as the size /// * parameter. </param> /// * <exception cref="IllegalArgumentException"> Invalid parameter. </exception> /// public FFTTransformer(int size, Window window) { if (!IsPowerOf2(size)) { throw new System.ArgumentException("size for FFT must" + " be a power of 2 (was " + size + ")"); } windowFunc = window; transformer = new LomontFFT(); blockSize = size; // Allocate working data arrays. xre = new double[blockSize]; }
/// /// <summary> * Create an FFT transformer for a given sample size. This preallocates /// * resources appropriate to that block size. A specified window /// * function will be applied to all input data. /// * </summary> /// * <param name="size"> The number of samples in a block that we will /// * be asked to transform. Must be a power of 2. </param> /// * <param name="winfunc"> Window function to apply to all input data. </param> /// * <exception cref="IllegalArgumentException"> Invalid parameter. </exception> /// public FFTTransformer(int size, Window.Function winfunc) : this(size, new Window(size, winfunc)) { }