Signal processing library in Java? [closed]
My first suggestion is to not do your DSP implementation in Java. My second suggestion would be to roll your own simple DSP implementations yourself in Java.
Why not to use Java:
I have lots of experience writing DSP code over the last 10+ years... and almost none of the DSP code is in Java... so forgive me when I am hesitant to read about someone who wants to implement DSP in Java.
If you are going to be doing non-trivial DSP then you shouldn't be using Java. The reason that DSP is so painful to implement in Java is because all the good DSP implementations use low level memory management tricks, pointers (crazy amounts of pointers), large raw data arrays, etc.
Why to use Java:
If you are doing simple DSP stuff roll your own Java implementation. Simple DSP things like PSD and filtering are both relatively easy to implement (easy implementation but they won't be fast) because there is soo many implementation examples and well documented theory online.
In my case I implemented a PSD function in Java once because I was graphing the PSD in a Java GUI so it was easiest to just take the performance hit in Java and have the PSD computed in the java GUI and then plot it.
How to implement a PSD:
The PSD is usually just the magnitude of the FFT displayed in dB. There are many examples from academic, commercial and open-source showing how to compute the magnitude of the FFT in dB. For example Apache has a Java implementation that gives you the FFT output and then you just need to convert to magnitude and dB. Anything after the FFT should be tailored to what you need/want.
How to implement lowpass, bandpass filtering:
The easiest implementation (not the most computationally efficient) would in my opinion be using an FIR filter and doing time domain convolution.
Convolution is very easy to implement it is two nested for loops and there are literally millions of example code on the net.
The FIR filter will be the tricky part if you don't know anything about filter design. The easiest method would be to use Matlab to generate your FIR filter and then copy the coefficents into java. I suggest using firpmord() and firpm() from Matlab. Shoot for -30 to -50 dB attenuation in the stopband and 3 dB ripple in the passband.
I have written a collection of some Java DSP classes, e.g. IIR filters:
Java DSP collection
I found the book Java Digital Signal Processing and its example source code. You might look through the code to see if it fits your needs.
You can also check out DSP Laboratory.
As duffymo and basszero mentioned in the comments, there have been changes to Java since the publication of Java DSP that may impact some of the code examples. In particular, the (relatively) new Concurrency Utilties package might prove useful.
It looks pretty sparse. Try Signalgo or jein or the Intel Signal Processing Library, although I think the last one is just a JNI wrapper.
I saw a lot of those applets you were talking about. I think you may be able to get the JARs for them and use the class APIs inside. May have to use eclipse and jad to decompile and figure out what they do, though, due to lack of documentation. Try the source on this page for example.