Forums

JAVA & FFT + Sound Processing & Latency in JAVA

Started by QWERTY December 2, 2005
Hello all!

I'm new on this group.
I started following it because I need help for project I'm working on
at my faculty.

I need to include an FFT algorithm in my project in order to manage
sound signal. Can anyone recommend me a good implementation of FFT in
JAVA, because, as I have read about it, there is many of
implementations which are not optimised.

Code examples about mnaging sound with FFT are wellcome :)


Another problem I encountered on is latency due to JAVA buffering.

My project should work in real time, so it is big challenge to avoid
the latency.
With Pentium IV, 2.8GHz, 768MB of RAM, I have latency of about 1
sec!!!!

Can anyone suggest how to solve theese, for me - very big, problems?

Thanks in advance!

You can contact me at igor_igor@vipTHIS.hr (remove THIS)

"QWERTY" <igor_igor@vip.hr> wrote in message
news:1133516631.727139.49570@g47g2000cwa.googlegroups.com...
> I need to include an FFT algorithm in my project in order to manage > sound signal. Can anyone recommend me a good implementation of FFT in > JAVA, because, as I have read about it, there is many of > implementations which are not optimised.
I am a C, not a Java developer, but this is quite a good complex FFT demo http://sepwww.stanford.edu/oldsep/hale/FftLab.html although having looked at the code it's hardly optimised.
> Code examples about mnaging sound with FFT are wellcome :) > > Another problem I encountered on is latency due to JAVA buffering.
I am not sure what OS you are on, but latency in Windows, depending on the API and drivers in use, can be awful. Generally speaking latency using the MME (Multimedia extensions) API is usually worse than DirectSound. DirectSound latency is generally worse than using ASIO. Regards, Howard
QWERTY wrote:
> Hello all! > > I'm new on this group. > I started following it because I need help for project I'm working on > at my faculty. > > I need to include an FFT algorithm in my project in order to manage > sound signal. Can anyone recommend me a good implementation of FFT in > JAVA, because, as I have read about it, there is many of > implementations which are not optimised.
I'm not sure if optimized JAVA code is not in fact an oxymoron.
> Code examples about mnaging sound with FFT are wellcome :)
Try FFTW, it's the standard for GPLed FFT source codes. Another one is KISSFFT. Both are in C/C++.
> > Another problem I encountered on is latency due to JAVA buffering. > > My project should work in real time, so it is big challenge to avoid > the latency. > With Pentium IV, 2.8GHz, 768MB of RAM, I have latency of about 1 > sec!!!!
1 sec latency is still real-time. (Definition of real-time: the latency is bounded). State your requirements more precisely.
> Can anyone suggest how to solve theese, for me - very big, problems? > > Thanks in advance!
Regards, Andor
I'm currently doing some "stuff" with the fftw3 library which is
written in C. You can access C (and other native) code from Java using
the JNI interface. When I put "fftw Java JNI" into Google there were a
lot of hits suggesting that people are doing this already. I don't have
time to sort through the links to find out which of them is best.

Cheers,

Ross-c