Giter VIP home page Giter VIP logo

jtransforms's People

Contributors

blacklion avatar carandraug avatar dependabot[bot] avatar mpeltonen avatar wendykierp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jtransforms's Issues

java.lang.NoClassDefFoundError

I'm not sure if this is the right venue to post this question, but though I would start here before going to StackOverflow.
I am attempting to use JTransforms to compute a DoubleFFT_1D.
The full error message is this:

09-07 17:30:11.369 E/JavaBinder: *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)
                                 java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jtransforms/fft/DoubleFFT_1D;
                                     at com.algoint.libzante.AutoCorrelation.compute(AutoCorrelation.java:66)
                                     at com.algoint.libzante.EstimateACF.estimateInSamplePeriods(EstimateACF.java:104)
                                     at <snip>
com.algoint.zante.BluetoothLeService.broadcastUpdate(BluetoothLeService.java:348)
                                     at com.algoint.zante.BluetoothLeService.access$700(BluetoothLeService.java:50)
                                     at com.algoint.zante.BluetoothLeService$1.onCharacteristicChanged(BluetoothLeService.java:243)
                                     at android.bluetooth.BluetoothGatt$1.onNotify(BluetoothGatt.java:438)
                                     at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:399)
                                     at android.os.Binder.execTransact(Binder.java:453)
                                  Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jtransforms.fft.DoubleFFT_1D" on path: DexPathList[[dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-json_simple-1.1_9ec115b071c72fb6edf2028f7a57e4ae60bb5a65-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-dropbox-android-sdk-1.5.4_74a0c4010a6328c8c6443241412fa9c5c398a9ab-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-achartengine-1.1.0_0238cc7eb0f70b6065b267fb6df8a8f6b48a5319-classes.dex"],nativeLibraryDirectories=[/data/app/com.algoint.zante-2/lib/arm64, /vendor/lib64, /system/lib64]]
                                     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                     at com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader.findClass(IncrementalClassLoader.java:90)
                                     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
                                     at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
                                     at com.algoint.libzante.AutoCorrelation.compute(AutoCorrelation.java:66) 
                                     at com.algoint.libzante.EstimateACF.estimateInSamplePeriods(EstimateACF.java:104) 
                                     at <snip>
com.algoint.zante.BluetoothLeService.broadcastUpdate(BluetoothLeService.java:348) 
                                     at com.algoint.zante.BluetoothLeService.access$700(BluetoothLeService.java:50) 
                                     at com.algoint.zante.BluetoothLeService$1.onCharacteristicChanged(BluetoothLeService.java:243) 
                                     at android.bluetooth.BluetoothGatt$1.onNotify(BluetoothGatt.java:438) 
                                     at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:399) 
                                     at android.os.Binder.execTransact(Binder.java:453) 
                                    Suppressed: java.lang.ClassNotFoundException: Didn't find class "org.jtransforms.fft.DoubleFFT_1D" on path: DexPathList[[zip file "/data/app/com.algoint.zante-2/base.apk"],nativeLibraryDirectories=[/data/app/com.algoint.zante-2/lib/arm64, /vendor/lib64, /system/lib64]]
                                     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
                                     at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                                            ... 12 more
                                        Suppressed: java.lang.ClassNotFoundException: Didn't find class "org.jtransforms.fft.DoubleFFT_1D" on path: DexPathList[[dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.algoint.zante/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.

I have imported jtransforms as follows in the source file:
import org.jtransforms.fft.DoubleFFT_1D;
with the proper gradle entry:

apply plugin: 'java'
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile files('libs/JTransforms-3.1-with-dependencies.jar')
}

And corresponding Android Studio dependency setting:
image

The project compiles without an error and throws and error at the following line:

       // An array of length 4 will yield n = 8.
        // This is necessary for the computation to be correct.
        int n = 2 * nextPow2(x.length);
        // Twice the number of elements are required: real and imaginary parts of the FFT are stored consecutively
        double[] f = new double[2 * n];   
        System.arraycopy(x, 0, f, 0, x.length);
        // FFT
        DoubleFFT_1D fft = new DoubleFFT_1D((long) n);  // ERROR ON THIS LINE
        // Use "full" to avoid more machinations with symmetry
        fft.realForwardFull(f);

The value of n when the error is thrown is 1024 and the length of x is 500.
I have found this error with both: "JTransforms-2.4.jar" and "JTransforms-3.1-with-dependencies.jar".
Can you recommend any solutions?
Thank you.

Properly handle InterruptedException

The recent change 98159b6 addressed the major issue with InterruptedException. However there are still several things to improve:

  • log InterruptedException is not necessary, since user's code can't resolve it anyhow. Just found in production logs:
null
java.lang.InterruptedException
        at java.base/java.util.concurrent.FutureTask.awaitDone(FutureTask.java:418)
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:190)
        at pl.edu.icm.jlargearrays.ConcurrencyUtils.waitForCompletion(ConcurrencyUtils.java:188)
        at org.jtransforms.utils.CommonUtils.cftrec4_th(CommonUtils.java:8985)

Just raising this issue to start discussion and get some feedback. I would fix it in the following manner:

  • do not log InterruptedException at all. I.e. remove Logger.getLogger(CommonUtils.class.getName()).log(Level.SEVERE, null, ex); from everywhere.
  • immediately return on InterruptedException. This would leave input data partially changed. With the current approach the input data might still be partially computed
  • with the 98159b6 the caller can check interrupted flag and abort the computation.

Strange freeze in FloatFFT_2D.realForwardFull when array reaches certain size

I am experiencing a very strange "freeze". Originally in a larger application, I have reduced my test case to the code below. The "freeze" occurred with JTransforms-3.1-with-dependencies. To pinpoint where the freeze occurs, I downloaded the source of both JTransforms and JLargeArrays from github / gitlab on January 9th and created fresh jars. I added a couple of "println"s to JTransforms and JLargeArrays. Aside from pinpointing the location of the freeze, these also confirm that these jars are being used instead of another version potentially lurking in my classpath (to the best of my knowledge I removed all versions of JTransforms/JLargeArrays from the classpath).

The test code is:

 import pl.edu.icm.jlargearrays.*;
 import org.jtransforms.fft.*;
 import java.util.Arrays;

 public class Jttest {

  public static void main(String[] args) {
    test();
  }

  public static void test() {
    int dims[] = { 4097, 4097 };

    FloatLargeArray extra[] = new FloatLargeArray[3];

    int ix=0;
    while( true ) {
      int nel = 2*dims[0]*dims[1];
      FloatLargeArray data = new FloatLargeArray(nel);
      // allocate a few extra arrays to show that we have not run out of memory.
      // the behaviour is the same with the following lines in place or not
      for ( int ii=0; ii<extra.length; ii++ ){
        extra[ii] = new FloatLargeArray(nel);
      }
      // this is the size that is reported just before the code hangs.
      // I allocated a same-size array here to verify it is not the specific
      // size that is the issue
      FloatLargeArray dummy = new FloatLargeArray(16793604);
      System.out.format("data length=%d   dims=%s\n",data.length(),Arrays.toString(dims));
  
      FloatFFT_2D dft2d = new FloatFFT_2D( dims[0], dims[1] );
      System.out.println("Invoking dft2d");
      dft2d.realForwardFull( data );
      System.out.println("Done");
      // alternatingly increase the x- or y-size of the 2D array
      dims[ix]+=1;
      ix=1-ix;
    }
  }
}

On my machine, this code freezes as soon as dims reaches [4098,4097]. Suspiciously close to the nice power-of-two size [4096,4096] of course, but nothing indicates that this in fact has anything to do with it. The output is:

...
allocating 16789506
new FloatLargeArray done
allocated pl.edu.icm.jlargearrays.FloatLargeArray@7023090a
Done
...

data length=33579012   dims=[4098, 4097]
Invoking dft2d
JT: RFF
JT: RFF (mixed)
allocating 16793604
new FloatLargeArray done

Interestingly, I am pretty sure the process was shown as idle before ("0% cpu") one every attemp yesterday, but as I tried it just now it shows "100% cpu". Top also states "12.1% memory", so again the process cannot be running out of memory.

The key "print" statements are in:

FloatFFT2D.java:

    private void mixedRadixRealForwardFull(final FloatLargeArray a)
    {
        final long rowStride = 2 * columnsl;
        final long n2d2 = columnsl / 2 + 1;
        System.out.format("allocating %d\n",n2d2 * 2 * rowsl);
        final FloatLargeArray temp = new FloatLargeArray(n2d2 * 2 * rowsl);
        System.out.format("allocated %s\n",temp.toString());

If successful, the last line outputs something like allocated pl.edu.icm.jlargearrays.FloatLargeArray@7023090a. However, when the code freezes, it does so before reaching the second System.out.format statement.

In FloatLargeArray.java:

   public FloatLargeArray(long length)
    {
        this(length, true);
        System.out.println("new FloatLargeArray done");
    }

Checking the output of the code, it appears that the FloatLargeArray constructor works up to and including the println I added, but the code then freezes.

Finally, system details, Fedora 27 64bit Linux, 8Gb memory, with:

java -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
  • Any idea what might be going on?
  • Can anyone reproduce this behaviour?
  • Let me know if any extra information is required

Regards, Michael

[RQ] general FFT interface?

I'm using the FFT in various dimensions, however I have boilerplate code that is copied over for each dimension because the FFT classes (*_1D, *_2D, *_3D) don't have a common interface.

Could it be possible to add an interface (called, perhaps "FFT") that all FFT classes could implement, so as to give generic access to the 1D versions of the methods, i.e.
{real|complex}{Forward|Inverse}({type}[] out) ?

If pull request needed, sure can do.
Cheers

jtransforms running after proceeding.

Hello wendykierp, thanks for you brilliant work! But I have came across some nasty problems, can you give me some advice?
it seems that after all jobs has been done, sometime the jtransforms fails to end..
I have to manually stop the program most of time.
why is this happening?
Does it have something about the multi-threading?
or the size of input images matters?

the program outputs:

Encrypt Completed!
Decrypt Completed!

then never ends.

here is the attached code..

import org.jtransforms.fft.DoubleFFT_2D;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

import static java.lang.Math.min;
import static java.lang.Math.rint;

/**
 * Project: blindwatermark
 * Created by longx on 2016/11/3.
 */
public class Parser {
    private static int[] hmap,wmap;
    private static double alpha=10;
    private static int defaultSeed=666666;
    private final  boolean DEBUG=false;
    public static double[][][] getImageRGB(String filename)throws Exception{
        BufferedImage im= ImageIO.read(new File(filename));
        int[] image;
        int h=im.getHeight(), w=im.getWidth(), type=im.getType(),cnt=0,tmp;
        image=im.getRGB(0,0,w,h,null,0,w);
        double[][][] ret=new double[3][h][2*w];
        for(int i=0;i<h;i++)
            for(int j=0;j<w;j++){
                tmp=image[cnt++];
                ret[0][i][2*j]=(tmp&0xFF);            //B
                ret[1][i][2*j]=((tmp&0xFF00)>>8);    //G
                ret[2][i][2*j]=((tmp&0xFF0000)>>16);  //R
            }
       return ret;
    }
    public static void setImageRGB(double[][][] im, String filename)throws Exception{
        File file=new File(filename);
        if(!file.exists()) file.createNewFile();
        int h=im[0].length,w=im[0][0].length/2,cnt=0,r,g,b;
        BufferedImage bim =new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
        int[] out=new int[h*w];
        for(int i=0;i<h;i++)
            for(int j=0;j<w;j++){
                b=min(new Double(rint(im[0][i][2*j])).intValue(),255);
                g=min(new Double(rint(im[1][i][2*j])).intValue(),255);
                r=min(new Double(rint(im[2][i][2*j])).intValue(),255);
                out[cnt++]=(r<<16)|(g<<8)|(b);
            }
        bim.setRGB(0,0,w,h,out,0,w);
        ImageIO.write(bim,"PNG",file);
    }
    public static void setAlpha(double x){
        if(x<=0)System.out.println("Set Fail: The alpha must be positive");
        else if(x>=100)System.out.println("Set Fail: The alpha must be smaller than 100");
        else{
            System.out.println("Set Success!");
            alpha=x;
        }
    }
    public static void setDefaultSeed(int s){
        System.out.println("Set Success!");
        defaultSeed=s;
    }
    private static int[] setMap(int seed,int len){
        int[] save=new int[len];
        ArrayList<Integer> sh=new ArrayList<>();
        for(int i=0;i<len;i++)sh.add(i);
        Collections.shuffle(sh,new Random(seed));
        for(int i=0;i<len;i++)save[i]=sh.get(i);
        return save;
    }
    private static double[][][] encode(double[][][] input,int h,int w,int seed){
        hmap=setMap(seed,h/2);wmap=setMap(seed+1,w/2);
        double[][][] ret=new double[input.length][h][w];
        for(int ch=0;ch<input.length;ch++){
            for(int i=0;i<input[0].length;i++)
                for(int j=0;j<input[0][0].length/2;j++)
                    ret[ch][hmap[i]][2*wmap[j]]=input[ch][i][2*j];
            for(int i=0;i<h/2;i++)
                for(int j=0;j<w/2;j++)
                    ret[ch][h-1-i][w-2*(j+1)]=ret[ch][i][2*j];
        }
        return ret;
    }
    private static double[][][] decode(double[][][] input,int h,int w,int seed){
        hmap=setMap(seed,h/2);wmap=setMap(seed+1,w/2);
        double[][][] wm=new double[3][h][w];
        for(int ch=0;ch<3;ch++){
            for(int j=0;j<h/2;j++)
                for(int k=0;k<w/2;k++)
                    wm[ch][j][2*k]=input[ch][hmap[j]][2*wmap[k]];
            for(int j=0;j<h/2;j++)
                for(int k=0;k<w;k+=2)
                    wm[ch][h-1-j][w-2-k]=wm[ch][j][k];
        }
        return wm;
    }
    private static void cpxfft(double[][] input){
        DoubleFFT_2D f2d=new DoubleFFT_2D(input.length,input[0].length/2);
        f2d.complexForward(input);
    }
    private static void cpxifft(double[][] input){
        DoubleFFT_2D f2d=new DoubleFFT_2D(input.length,input[0].length/2);
        f2d.complexInverse(input,true);
    }
    public static void encrypt(String fn1,String fn2,String output)throws Exception{
        double[][][] im=getImageRGB(fn1);
        double[][][] wm=getImageRGB(fn2);
        assert(im[0].length>2*wm[0].length&&im[0][0].length>=wm[0][0].length);
        double[][][] rwm=encode(wm,im[0].length,im[0][0].length,defaultSeed);
        for(int i=0;i<im.length;i++){
            cpxfft(im[i]);
            for(int j=0;j<im[0].length;j++)
                for(int k=0;k<im[0][0].length;k++)
                    im[i][j][k]+=rwm[i][j][k]*alpha;
            cpxifft(im[i]);
        }
        setImageRGB(im,output);
        System.out.println("Encrypt Completed!");
    }
    public static void decrypt(String fn1,String fn2,String output)throws Exception{
        double[][][] im=getImageRGB(fn1);
        double[][][] src=getImageRGB(fn2);
        assert( src.length==im.length&&
                src[0].length==im[0].length&&
                src[0][0].length==im[0][0].length);
        int ch=src.length,h=src[0].length,w=src[0][0].length;
        double[][][] dwm=new `double[ch][h][w];`
        for(int i=0;i<ch;i++){
            cpxfft(src[i]);
            cpxfft(im[i]);
            for(int j=0;j<h;j++)
                for(int k=0;k<w;k+=2)
                    dwm[i][j][k]=(im[i][j][k]-src[i][j][k])/alpha;
        }
        double[][][] wm=decode(dwm,h,w,defaultSeed);
        setImageRGB(wm,output);
        System.out.println("Decrypt Completed!");
    }
}`

the class calling the Parser is like:

public class Check {
    static final boolean showDiff=true;
    public static void main(String[] args)throws Exception{
        Parser.encrypt("res//Kato_Megumi.jpg","res//wm2.bmp","TestOutput.jpg");
        Parser.decrypt("res//Kato_Megumi.jpg","TestOutput.jpg","decoded.png");
        if(showDiff){
            double[][][] src=Parser.getImageRGB("res//Kato_Megumi.jpg");
            double[][][] cdx=Parser.getImageRGB("TestOutput.jpg");
            double[][][] diff=new double[src.length][src[0].length][src[0][0].length];
            for(int i=0;i<src.length;i++)
                for(int j=0;j<src[0].length;j++)
                    for(int k=0;k<src[0][0].length;k+=2)
                        diff[i][j][k]=cdx[i][j][k]-src[i][j][k];
            Parser.setImageRGB(diff,"diff.jpg");
        }
    }
}

Thank you very much.

Need an example

An example of generating a signal, running fft and retrieve parameters would be welcome.

I try to make a unit test, but I need help to retrieve the expected value.

Would expect to find such help http://fr.mathworks.com/help/matlab/ref/fft.html

        // Make 50 Hz signal
        final int sampleRate = 44100;
        final int signalFrequency = 50;
        float[] signal = new float[sampleRate];
        for(int s = 0; s < sampleRate; s++) {
            double t = s * (1 / (double)sampleRate);
            signal[s] = (float)Math.sin(2 * Math.PI * signalFrequency  * t);
        }


        // Execute FFT
        FloatFFT_1D floatFFT_1D = new FloatFFT_1D(sampleRate);
        floatFFT_1D.realForward(signal);

        // Recover expected 50 Hz frequency with value 1
       ...

thank you

Request for Unbiased and Bias Crosscorrelation

Hi,

I'm having trouble matching 1-to-1 the CrossCorrelation class in JTransform with MATLAB's version because JTransform only returns the unbiased version. Is there any intent to add the option of being able to switch between the two (bias and unbias) in "getCCF" in a future version of JTransform?

Thanks
K

Pre-factor inverse 2D FFT

Are there any pre-factors when using a 2D-FFT?

I am currently using the inverse 2D-FFT to analyze an image and I need to measure a distance after the FFT. Does the scale change after performing the inverse 2D-FFT?

JTransforms starts non-daemon threads, can't seem to stop them

I'm trying JTransforms and it appears to work, but hangs my JVM with non-daemon threads that it has started. I can't seem to find a way to tell JTransforms that I'm done.

I got JTransforms-3.0 from the binary download link here https://sites.google.com/site/piotrwendykier/software/jtransforms

I am only using DoubleFFT_1D.realForward().

I found something online about this:

ConcurrencyUtils.setThreadsBeginN_1D_FFT_2Threads(Integer.MAX_VALUE);
ConcurrencyUtils.setThreadsBeginN_1D_FFT_4Threads(Integer.MAX_VALUE);

but I can't seem to get either Eclipse or javac to see any of the methods under ConcurrencyUtils so it will not compile.

OOM on Android.

Thanks for your fantastic work. but i have encountered an issue in using the Jtransform lib on Android. while the program is calculating the fft. the App crashes and gives warnings of OOM. i've tried to add the calculating process as a service. but doesn't work out. Do you have any solutions about this? thx

What exact mathematical DFT formula is being used in DoubleFFT_1D ?

Hello,

I need to compute some data to the classic formula described here:
https://en.wikipedia.org/wiki/Discrete_Fourier_transform

However when I enter the complex numbers 1 + 0i, 2 - 1i, 0 - 1i, -1 + 2i into the complexForward method, then I get a return result of 3 - 2i, 0 - 0.7320508075688774i, 0.0 + 2.7320508075688776i, -1.0 + 2.0i, which is different from the expected result of 2 + 0i, -2 - 2i, 0 - 2i, 4 + 4i.

What kind of mathematical formula does the DoubleFFT_1D class go by. Is it same for all 3 plans? What do I need to do with the end results to achieve the described results?

Erik Soekov

DoubleFFT_1D creating non-daemon threads causes return from main() to wait

I am doing the following (deep down in my main())

  DoubleFFT_1D doubleFFT = new DoubleFFT_1D(dataInWindow.length);
  double[] resultsFFT = Arrays.copyOf(dataInWindow, dataInWindow.length);
  doubleFFT.realForward(resultsFFT);

and when my main() returns it hangs for about 60 seconds before actually exiting the JVM. If I comment out the last line, the problem goes away. I think this is because ConcurrencyUtils uses Executors default thread factory which creates non-daemon threads.

    @Override
    public Thread newThread(Runnable r)
    {
        Thread t = DEFAULT_FACTORY.newThread(r);
        t.setUncaughtExceptionHandler(handler);
        return t;
    }

Should you be using daemon threads.

Javadoc issue ? (realForward output)

Hello,

I found a somewhat confusing function description in DoubleFFT_1D.java

Is the realForward function really returning a[1] = Re[n/2] ? A real unrelated to the (also real) 0th element instead of the imaginary part of the 0th element ? (that's the even case, but same question for the odd case, I'd expect the last element to be lonely, but the 0th and 1st values to be related to each other)

Relevant description:

/**
             * 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[2*k] = Re[k], 0&lt;=k&lt;n/2
             * a[2*k+1] = Im[k], 0&lt;k&lt;n/2
             * a[1] = Re[n/2]
             * </pre>
             *
             * if n is odd then
             *
             * <pre>
             * a[2*k] = Re[k], 0&lt;=k&lt;(n+1)/2
             * a[2*k+1] = Im[k], 0&lt;k&lt;(n-1)/2
             * a[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
             */
            public void realForward(double[] a) {

Thank you !

Is this project still alive?

I'm reviving an old android app, that relies on this library, but keep getting the following message:

..\android-app\app\libs\JTransforms-3.1-with-dependencies.jar: D8: Type `sun.misc.Cleaner` was not found, it is required for default or static interface methods desugaring
  • Any updates to more recent builds?
  • Are there any good alternatives to this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.