Example usage for org.apache.commons.math.transform FastFourierTransformer isPowerOf2

List of usage examples for org.apache.commons.math.transform FastFourierTransformer isPowerOf2

Introduction

In this page you can find the example usage for org.apache.commons.math.transform FastFourierTransformer isPowerOf2.

Prototype

public static boolean isPowerOf2(long n) 

Source Link

Document

Returns true if the argument is power of 2.

Usage

From source file:ch.slf.FFTRealOneSided.java

public boolean init() {
    try {//w  w w .  j a  va 2s  . c o  m
        fft_size = getPredicateValueAsIntWithException("window-size");
        fft = new FastFourierTransformer();
        if (!FastFourierTransformer.isPowerOf2(fft_size)) {
            logger.error("The window size >" + fft_size + "< is not a power of 2.");
            return false;
        }
    } catch (Exception e) {
        logger.error(e.getMessage(), e);
        return false;
    }
    return true;
}