src/share/classes/com/sun/media/sound/FFT.java
Print this page
*** 66,76 ****
public void transform(double[] data) {
bitreversal(data);
calc(fftFrameSize, data, sign, w);
}
! private final static double[] computeTwiddleFactors(int fftFrameSize,
int sign) {
int imax = (int) (Math.log(fftFrameSize) / Math.log(2.));
double[] warray = new double[(fftFrameSize - 1) * 4];
--- 66,76 ----
public void transform(double[] data) {
bitreversal(data);
calc(fftFrameSize, data, sign, w);
}
! private static double[] computeTwiddleFactors(int fftFrameSize,
int sign) {
int imax = (int) (Math.log(fftFrameSize) / Math.log(2.));
double[] warray = new double[(fftFrameSize - 1) * 4];
*** 120,130 ****
}
return warray;
}
! private final static void calc(int fftFrameSize, double[] data, int sign,
double[] w) {
final int fftFrameSize2 = fftFrameSize << 1;
int nstep = 2;
--- 120,130 ----
}
return warray;
}
! private static void calc(int fftFrameSize, double[] data, int sign,
double[] w) {
final int fftFrameSize2 = fftFrameSize << 1;
int nstep = 2;
*** 137,147 ****
else
calcF4I(fftFrameSize, data, i, nstep, w);
}
! private final static void calcF2E(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
int jmax = nstep;
for (int n = 0; n < jmax; n += 2) {
double wr = w[i++];
double wi = w[i++];
--- 137,147 ----
else
calcF4I(fftFrameSize, data, i, nstep, w);
}
! private static void calcF2E(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
int jmax = nstep;
for (int n = 0; n < jmax; n += 2) {
double wr = w[i++];
double wi = w[i++];
*** 161,171 ****
}
// Perform Factor-4 Decomposition with 3 * complex operators and 8 +/-
// complex operators
! private final static void calcF4F(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
final int fftFrameSize2 = fftFrameSize << 1; // 2*fftFrameSize;
// Factor-4 Decomposition
int w_len = w.length >> 1;
--- 161,171 ----
}
// Perform Factor-4 Decomposition with 3 * complex operators and 8 +/-
// complex operators
! private static void calcF4F(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
final int fftFrameSize2 = fftFrameSize << 1; // 2*fftFrameSize;
// Factor-4 Decomposition
int w_len = w.length >> 1;
*** 329,339 ****
}
// Perform Factor-4 Decomposition with 3 * complex operators and 8 +/-
// complex operators
! private final static void calcF4I(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
final int fftFrameSize2 = fftFrameSize << 1; // 2*fftFrameSize;
// Factor-4 Decomposition
int w_len = w.length >> 1;
--- 329,339 ----
}
// Perform Factor-4 Decomposition with 3 * complex operators and 8 +/-
// complex operators
! private static void calcF4I(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
final int fftFrameSize2 = fftFrameSize << 1; // 2*fftFrameSize;
// Factor-4 Decomposition
int w_len = w.length >> 1;
*** 497,507 ****
}
// Perform Factor-4 Decomposition with 3 * complex operators and 8 +/-
// complex operators
! private final static void calcF4FE(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
final int fftFrameSize2 = fftFrameSize << 1; // 2*fftFrameSize;
// Factor-4 Decomposition
int w_len = w.length >> 1;
--- 497,507 ----
}
// Perform Factor-4 Decomposition with 3 * complex operators and 8 +/-
// complex operators
! private static void calcF4FE(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
final int fftFrameSize2 = fftFrameSize << 1; // 2*fftFrameSize;
// Factor-4 Decomposition
int w_len = w.length >> 1;
*** 591,601 ****
}
// Perform Factor-4 Decomposition with 3 * complex operators and 8 +/-
// complex operators
! private final static void calcF4IE(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
final int fftFrameSize2 = fftFrameSize << 1; // 2*fftFrameSize;
// Factor-4 Decomposition
int w_len = w.length >> 1;
--- 591,601 ----
}
// Perform Factor-4 Decomposition with 3 * complex operators and 8 +/-
// complex operators
! private static void calcF4IE(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
final int fftFrameSize2 = fftFrameSize << 1; // 2*fftFrameSize;
// Factor-4 Decomposition
int w_len = w.length >> 1;
*** 683,693 ****
}
}
! private final void bitreversal(double[] data) {
if (fftFrameSize < 4)
return;
int inverse = fftFrameSize2 - 2;
for (int i = 0; i < fftFrameSize; i += 4) {
--- 683,693 ----
}
}
! private void bitreversal(double[] data) {
if (fftFrameSize < 4)
return;
int inverse = fftFrameSize2 - 2;
for (int i = 0; i < fftFrameSize; i += 4) {