本文整理匯總了Java中org.jtransforms.utils.CommonUtils.cftfsub方法的典型用法代碼示例。如果您正苦於以下問題:Java CommonUtils.cftfsub方法的具體用法?Java CommonUtils.cftfsub怎麽用?Java CommonUtils.cftfsub使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jtransforms.utils.CommonUtils
的用法示例。
在下文中一共展示了CommonUtils.cftfsub方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: complexInverse
import org.jtransforms.utils.CommonUtils; //導入方法依賴的package包/類
/**
* Computes 1D inverse 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<=k<n
* </pre>
*
* @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 complexInverse(double[] a, int offa, boolean scale)
{
if (useLargeArrays) {
complexInverse(new DoubleLargeArray(a), offa, scale);
} else {
if (n == 1) {
return;
}
switch (plan) {
case SPLIT_RADIX:
CommonUtils.cftfsub(2 * n, a, offa, ip, nw, w);
break;
case MIXED_RADIX:
cfftf(a, offa, +1);
break;
case BLUESTEIN:
bluestein_complex(a, offa, 1);
break;
}
if (scale) {
CommonUtils.scale(n, 1.0 / (double) n, a, offa, true);
}
}
}
示例2: complexInverse
import org.jtransforms.utils.CommonUtils; //導入方法依賴的package包/類
/**
* Computes 1D inverse 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<=k<n
* </pre>
*
* @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 complexInverse(float[] a, int offa, boolean scale)
{
if (useLargeArrays) {
complexInverse(new FloatLargeArray(a), offa, scale);
} else {
if (n == 1) {
return;
}
switch (plan) {
case SPLIT_RADIX:
CommonUtils.cftfsub(2 * n, a, offa, ip, nw, w);
break;
case MIXED_RADIX:
cfftf(a, offa, +1);
break;
case BLUESTEIN:
bluestein_complex(a, offa, 1);
break;
}
if (scale) {
CommonUtils.scale(n, 1.0f / (float) n, a, offa, true);
}
}
}
示例3: inverse
import org.jtransforms.utils.CommonUtils; //導入方法依賴的package包/類
/**
* Computes 1D inverse DCT (DCT-III) leaving the result in <code>a</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 inverse(final float[] a, final int offa, boolean scale)
{
if (n == 1)
return;
if (isPowerOfTwo) {
float xr;
if (scale) {
CommonUtils.scale(n, (float) sqrt(2.0 / n), a, offa, false);
a[offa] = a[offa] / (float) sqrt(2.0);
}
CommonUtils.dctsub(n, a, offa, nc, w, nw);
if (n > 4) {
CommonUtils.cftfsub(n, a, offa, ip, nw, w);
rftfsub(n, a, offa, nc, w, nw);
} else if (n == 4) {
CommonUtils.cftfsub(n, a, offa, ip, nw, w);
}
xr = a[offa] - a[offa + 1];
a[offa] += a[offa + 1];
for (int j = 2; j < n; j += 2) {
a[offa + j - 1] = a[offa + j] - a[offa + j + 1];
a[offa + j] += a[offa + j + 1];
}
a[offa + n - 1] = xr;
} else {
throw new IllegalStateException();
}
}
示例4: realForward
import org.jtransforms.utils.CommonUtils; //導入方法依賴的package包/類
/**
* Computes 1D forward DFT of real data leaving the result in <code>a</code>
* . The physical layout of the output data is as follows:<br>
*
* if n is even then
*
* <pre>
* a[offa+2*k] = Re[k], 0<=k<n/2
* a[offa+2*k+1] = Im[k], 0<k<n/2
* a[offa+1] = Re[n/2]
* </pre>
*
* if n is odd then
*
* <pre>
* a[offa+2*k] = Re[k], 0<=k<(n+1)/2
* a[offa+2*k+1] = Im[k], 0<k<(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
* forward transform, use <code>realForwardFull</code>. To get back the
* original data, use <code>realInverse</code> on the output of this method.
*
* @param a data to transform
* @param offa index of the first element in array <code>a</code>
*/
public void realForward(double[] a, int offa)
{
if (useLargeArrays) {
realForward(new DoubleLargeArray(a), offa);
} else {
if (n == 1) {
return;
}
switch (plan) {
case SPLIT_RADIX:
double xi;
if (n > 4) {
CommonUtils.cftfsub(n, a, offa, ip, nw, w);
CommonUtils.rftfsub(n, a, offa, nc, w, nw);
} else if (n == 4) {
CommonUtils.cftx020(a, offa);
}
xi = a[offa] - a[offa + 1];
a[offa] += a[offa + 1];
a[offa + 1] = xi;
break;
case MIXED_RADIX:
rfftf(a, offa);
for (int k = n - 1; k >= 2; k--) {
int idx = offa + k;
double tmp = a[idx];
a[idx] = a[idx - 1];
a[idx - 1] = tmp;
}
break;
case BLUESTEIN:
bluestein_real_forward(a, offa);
break;
}
}
}
示例5: realForward
import org.jtransforms.utils.CommonUtils; //導入方法依賴的package包/類
/**
* Computes 1D forward DFT of real data leaving the result in <code>a</code>
* . The physical layout of the output data is as follows:<br>
*
* if n is even then
*
* <pre>
* a[offa+2*k] = Re[k], 0<=k<n/2
* a[offa+2*k+1] = Im[k], 0<k<n/2
* a[offa+1] = Re[n/2]
* </pre>
*
* if n is odd then
*
* <pre>
* a[offa+2*k] = Re[k], 0<=k<(n+1)/2
* a[offa+2*k+1] = Im[k], 0<k<(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
* forward transform, use <code>realForwardFull</code>. To get back the
* original data, use <code>realInverse</code> on the output of this method.
*
* @param a data to transform
* @param offa index of the first element in array <code>a</code>
*/
public void realForward(float[] a, int offa)
{
if (useLargeArrays) {
realForward(new FloatLargeArray(a), offa);
} else {
if (n == 1) {
return;
}
switch (plan) {
case SPLIT_RADIX:
float xi;
if (n > 4) {
CommonUtils.cftfsub(n, a, offa, ip, nw, w);
CommonUtils.rftfsub(n, a, offa, nc, w, nw);
} else if (n == 4) {
CommonUtils.cftx020(a, offa);
}
xi = a[offa] - a[offa + 1];
a[offa] += a[offa + 1];
a[offa + 1] = xi;
break;
case MIXED_RADIX:
rfftf(a, offa);
for (int k = n - 1; k >= 2; k--) {
int idx = offa + k;
float tmp = a[idx];
a[idx] = a[idx - 1];
a[idx - 1] = tmp;
}
break;
case BLUESTEIN:
bluestein_real_forward(a, offa);
break;
}
}
}