当前位置: 首页>>代码示例>>Java>>正文


Java CommonUtils.cftbsub方法代码示例

本文整理汇总了Java中org.jtransforms.utils.CommonUtils.cftbsub方法的典型用法代码示例。如果您正苦于以下问题:Java CommonUtils.cftbsub方法的具体用法?Java CommonUtils.cftbsub怎么用?Java CommonUtils.cftbsub使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jtransforms.utils.CommonUtils的用法示例。


在下文中一共展示了CommonUtils.cftbsub方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: complexForward

import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
/**
 * Computes 1D forward DFT of complex data leaving the result in
 * <code>a</code>. Complex number is stored as two double values in
 * sequence: the real and imaginary part, i.e. the size of the input array
 * must be greater or equal 2*n. The physical layout of the input data has
 * to be as follows:<br>
 *  
 * <pre>
 * a[offa+2*k] = Re[k], 
 * a[offa+2*k+1] = Im[k], 0&lt;=k&lt;n
 * </pre>
 *  
 * @param a    data to transform
 * @param offa index of the first element in array <code>a</code>
 */
public void complexForward(double[] a, int offa)
{
    if (useLargeArrays) {
        complexForward(new DoubleLargeArray(a), offa);
    } else {
        if (n == 1) {
            return;
        }
        switch (plan) {
            case SPLIT_RADIX:
                CommonUtils.cftbsub(2 * n, a, offa, ip, nw, w);
                break;
            case MIXED_RADIX:
                cfftf(a, offa, -1);
                break;
            case BLUESTEIN:
                bluestein_complex(a, offa, -1);
                break;
        }
    }
}
 
开发者ID:wendykierp,项目名称:JTransforms,代码行数:37,代码来源:DoubleFFT_1D.java

示例2: complexForward

import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
/**
 * Computes 1D forward DFT of complex data leaving the result in
 * <code>a</code>. Complex number is stored as two float values in
 * sequence: the real and imaginary part, i.e. the size of the input array
 * must be greater or equal 2*n. The physical layout of the input data has
 * to be as follows:<br>
 *  
 * <pre>
 * a[offa+2*k] = Re[k], 
 * a[offa+2*k+1] = Im[k], 0&lt;=k&lt;n
 * </pre>
 *  
 * @param a    data to transform
 * @param offa index of the first element in array <code>a</code>
 */
public void complexForward(float[] a, int offa)
{
    if (useLargeArrays) {
        complexForward(new FloatLargeArray(a), offa);
    } else {
        if (n == 1) {
            return;
        }
        switch (plan) {
            case SPLIT_RADIX:
                CommonUtils.cftbsub(2 * n, a, offa, ip, nw, w);
                break;
            case MIXED_RADIX:
                cfftf(a, offa, -1);
                break;
            case BLUESTEIN:
                bluestein_complex(a, offa, -1);
                break;
        }
    }
}
 
开发者ID:wendykierp,项目名称:JTransforms,代码行数:37,代码来源:FloatFFT_1D.java

示例3: bluesteini

import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
private void bluesteini()
{
    int k = 0;
    double arg;
    double pi_n = PI / n;
    bk1[0] = 1;
    bk1[1] = 0;
    for (int i = 1; i < n; i++) {
        k += 2 * i - 1;
        if (k >= 2 * n) {
            k -= 2 * n;
        }
        arg = pi_n * k;
        bk1[2 * i] = cos(arg);
        bk1[2 * i + 1] = sin(arg);
    }
    double scale = 1.0 / nBluestein;
    bk2[0] = bk1[0] * scale;
    bk2[1] = bk1[1] * scale;
    for (int i = 2; i < 2 * n; i += 2) {
        bk2[i] = bk1[i] * scale;
        bk2[i + 1] = bk1[i + 1] * scale;
        bk2[2 * nBluestein - i] = bk2[i];
        bk2[2 * nBluestein - i + 1] = bk2[i + 1];
    }
    CommonUtils.cftbsub(2 * nBluestein, bk2, 0, ip, nw, w);
}
 
开发者ID:wendykierp,项目名称:JTransforms,代码行数:28,代码来源:DoubleFFT_1D.java

示例4: bluesteinil

import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
private void bluesteinil()
{
    long k = 0;
    double arg;
    double pi_n = PI / nl;
    bk1l.setDouble(0, 1);
    bk1l.setDouble(1, 0);
    for (int i = 1; i < nl; i++) {
        k += 2 * i - 1;
        if (k >= 2 * nl) {
            k -= 2 * nl;
        }
        arg = pi_n * k;
        bk1l.setDouble(2 * i, cos(arg));
        bk1l.setDouble(2 * i + 1, sin(arg));
    }
    double scale = 1.0 / nBluesteinl;
    bk2l.setDouble(0, bk1l.getDouble(0) * scale);
    bk2l.setDouble(1, bk1l.getDouble(1) * scale);
    for (int i = 2; i < 2 * nl; i += 2) {
        bk2l.setDouble(i, bk1l.getDouble(i) * scale);
        bk2l.setDouble(i + 1, bk1l.getDouble(i + 1) * scale);
        bk2l.setDouble(2 * nBluesteinl - i, bk2l.getDouble(i));
        bk2l.setDouble(2 * nBluesteinl - i + 1, bk2l.getDouble(i + 1));
    }
    CommonUtils.cftbsub(2 * nBluesteinl, bk2l, 0, ipl, nwl, wl);
}
 
开发者ID:wendykierp,项目名称:JTransforms,代码行数:28,代码来源:DoubleFFT_1D.java

示例5: bluesteini

import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
private void bluesteini()
{
    int k = 0;
    float arg;
    float pi_n = PI / n;
    bk1[0] = 1;
    bk1[1] = 0;
    for (int i = 1; i < n; i++) {
        k += 2 * i - 1;
        if (k >= 2 * n) {
            k -= 2 * n;
        }
        arg = pi_n * k;
        bk1[2 * i] = (float) cos(arg);
        bk1[2 * i + 1] = (float) sin(arg);
    }
    float scale = 1.0f / nBluestein;
    bk2[0] = bk1[0] * scale;
    bk2[1] = bk1[1] * scale;
    for (int i = 2; i < 2 * n; i += 2) {
        bk2[i] = bk1[i] * scale;
        bk2[i + 1] = bk1[i + 1] * scale;
        bk2[2 * nBluestein - i] = bk2[i];
        bk2[2 * nBluestein - i + 1] = bk2[i + 1];
    }
    CommonUtils.cftbsub(2 * nBluestein, bk2, 0, ip, nw, w);
}
 
开发者ID:wendykierp,项目名称:JTransforms,代码行数:28,代码来源:FloatFFT_1D.java

示例6: bluesteinil

import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
private void bluesteinil()
{
    long k = 0;
    float arg;
    float pi_n = PI / nl;
    bk1l.setFloat(0, 1);
    bk1l.setFloat(1, 0);
    for (int i = 1; i < nl; i++) {
        k += 2 * i - 1;
        if (k >= 2 * nl) {
            k -= 2 * nl;
        }
        arg = pi_n * k;
        bk1l.setFloat(2 * i, (float) cos(arg));
        bk1l.setFloat(2 * i + 1, (float) sin(arg));
    }
    float scale = 1.0f / nBluesteinl;
    bk2l.setFloat(0, bk1l.getFloat(0) * scale);
    bk2l.setFloat(1, bk1l.getFloat(1) * scale);
    for (int i = 2; i < 2 * nl; i += 2) {
        bk2l.setFloat(i, bk1l.getFloat(i) * scale);
        bk2l.setFloat(i + 1, bk1l.getFloat(i + 1) * scale);
        bk2l.setFloat(2 * nBluesteinl - i, bk2l.getFloat(i));
        bk2l.setFloat(2 * nBluesteinl - i + 1, bk2l.getFloat(i + 1));
    }
    CommonUtils.cftbsub(2 * nBluesteinl, bk2l, 0, ipl, nwl, wl);
}
 
开发者ID:wendykierp,项目名称:JTransforms,代码行数:28,代码来源:FloatFFT_1D.java

示例7: realInverse

import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
/**
 * Computes 1D inverse DFT of real data leaving the result in <code>a</code>
 * . The physical layout of the input data has to be as follows:<br>
 *  
 * if n is even then
 *  
 * <pre>
 * a[offa+2*k] = Re[k], 0&lt;=k&lt;n/2 
 * a[offa+2*k+1] = Im[k], 0&lt;k&lt;n/2
 * a[offa+1] = Re[n/2]
 * </pre>
 *  
 * if n is odd then
 *  
 * <pre>
 * a[offa+2*k] = Re[k], 0&lt;=k&lt;(n+1)/2 
 * a[offa+2*k+1] = Im[k], 0&lt;k&lt;(n-1)/2 
 * a[offa+1] = Im[(n-1)/2]
 * </pre>
 *  
 * This method computes only half of the elements of the real transform. The
 * other half satisfies the symmetry condition. If you want the full real
 * inverse transform, use <code>realInverseFull</code>.
 *  
 * @param a     data to transform
 * @param offa  index of the first element in array <code>a</code>
 * @param scale if true then scaling is performed
 */
public void realInverse(double[] a, int offa, boolean scale)
{
    if (useLargeArrays) {
        realInverse(new DoubleLargeArray(a), offa, scale);
    } else {
        if (n == 1) {
            return;
        }
        switch (plan) {
            case SPLIT_RADIX:
                a[offa + 1] = 0.5 * (a[offa] - a[offa + 1]);
                a[offa] -= a[offa + 1];
                if (n > 4) {
                    CommonUtils.rftfsub(n, a, offa, nc, w, nw);
                    CommonUtils.cftbsub(n, a, offa, ip, nw, w);
                } else if (n == 4) {
                    CommonUtils.cftxc020(a, offa);
                }
                if (scale) {
                    CommonUtils.scale(n, 1.0 / (n / 2.0), a, offa, false);
                }
                break;
            case MIXED_RADIX:
                for (int k = 2; k < n; k++) {
                    int idx = offa + k;
                    double tmp = a[idx - 1];
                    a[idx - 1] = a[idx];
                    a[idx] = tmp;
                }
                rfftb(a, offa);
                if (scale) {
                    CommonUtils.scale(n, 1.0 / n, a, offa, false);
                }
                break;
            case BLUESTEIN:
                bluestein_real_inverse(a, offa);
                if (scale) {
                    CommonUtils.scale(n, 1.0 / n, a, offa, false);
                }
                break;
        }
    }

}
 
开发者ID:wendykierp,项目名称:JTransforms,代码行数:73,代码来源:DoubleFFT_1D.java

示例8: realInverse

import org.jtransforms.utils.CommonUtils; //导入方法依赖的package包/类
/**
 * Computes 1D inverse DFT of real data leaving the result in <code>a</code>
 * . The physical layout of the input data has to be as follows:<br>
 *  
 * if n is even then
 *  
 * <pre>
 * a[offa+2*k] = Re[k], 0&lt;=k&lt;n/2 
 * a[offa+2*k+1] = Im[k], 0&lt;k&lt;n/2
 * a[offa+1] = Re[n/2]
 * </pre>
 *  
 * if n is odd then
 *  
 * <pre>
 * a[offa+2*k] = Re[k], 0&lt;=k&lt;(n+1)/2 
 * a[offa+2*k+1] = Im[k], 0&lt;k&lt;(n-1)/2 
 * a[offa+1] = Im[(n-1)/2]
 * </pre>
 *  
 * This method computes only half of the elements of the real transform. The
 * other half satisfies the symmetry condition. If you want the full real
 * inverse transform, use <code>realInverseFull</code>.
 *  
 * @param a     data to transform
 * @param offa  index of the first element in array <code>a</code>
 * @param scale if true then scaling is performed
 *  
 */
public void realInverse(float[] a, int offa, boolean scale)
{
    if (useLargeArrays) {
        realInverse(new FloatLargeArray(a), offa, scale);
    } else {
        if (n == 1) {
            return;
        }
        switch (plan) {
            case SPLIT_RADIX:
                a[offa + 1] = 0.5f * (a[offa] - a[offa + 1]);
                a[offa] -= a[offa + 1];
                if (n > 4) {
                    CommonUtils.rftfsub(n, a, offa, nc, w, nw);
                    CommonUtils.cftbsub(n, a, offa, ip, nw, w);
                } else if (n == 4) {
                    CommonUtils.cftxc020(a, offa);
                }
                if (scale) {
                    CommonUtils.scale(n, 1.0f / (n / 2.0f), a, offa, false);
                }
                break;
            case MIXED_RADIX:
                for (int k = 2; k < n; k++) {
                    int idx = offa + k;
                    float tmp = a[idx - 1];
                    a[idx - 1] = a[idx];
                    a[idx] = tmp;
                }
                rfftb(a, offa);
                if (scale) {
                    CommonUtils.scale(n, 1.0f / n, a, offa, false);
                }
                break;
            case BLUESTEIN:
                bluestein_real_inverse(a, offa);
                if (scale) {
                    CommonUtils.scale(n, 1.0f / n, a, offa, false);
                }
                break;
        }
    }

}
 
开发者ID:wendykierp,项目名称:JTransforms,代码行数:74,代码来源:FloatFFT_1D.java


注:本文中的org.jtransforms.utils.CommonUtils.cftbsub方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。