4

I am working on a Java project in which I need to achieve a FFT transformation in 65 micro seconds. the input of FFT is 2^14 real numbers. I have tried evey Java FFT library which I can find from Internet, like JTransforms and Apache Common Math, but none of them can get this speed. The fastest library is JTransforms, but it still take about 1 milli second. So could someone tell me whether it is possible to achieve such speed (65 micro seconds) in JAVA? As I know, C library FFTW can be quick enough in this case but I can not use JNI here and I need a pure Java implementation because it will be deployed as Applet in website.

P.S. my work is to transfer 2^14 audio frames into frequency domain with FFT, and then apply an acoustic echo cancellation algorithm (MDF) on them. 2^14 is decided by the standard echo delay in a normal room.

Thanks!!!

Jie
  • 89
  • 4

2 Answers2

2

Execution time is highly dependent on host computer configuration and applets are executed on client computers. That means different clients are likely to observe different performances. And it is not very likely to get FFT of 2^14 numbers in 65 microsecond on a moderate configuration.

Here you can see these benchmarks of best libraries like FFTW. Even using FFTW, it takes more than 50 microseconds to compute 2^13 point FFT on a machine with 2.80 Ghz, Intel Core i7 CPU with 4Gb of memory.

mostar
  • 4,723
  • 2
  • 28
  • 45
1

Have you tried repeated execution of the transformation? Java usually starts optimizing after the runtime could collect information about the code's hot-spots. The first (few) executions will take longer. You can also try to use the server VM (see Real differences between "java -server" and "java -client"?)

Before you try JNI, research about it's overhead, as this may actually take longer than 65µs.

1ms vs. 65µs seems too big of a difference, thus I suspect the code is not optimized by the VM .

Community
  • 1
  • 1
Mene
  • 3,739
  • 21
  • 40
  • your are right, the first time of running is about 2ms, and then decrease to 1 ms. also because my code will be wrapped into an Applet in a website, I donot think I can change the VM on every client site even if server VM works. – Jie Aug 30 '12 at 10:43