JTransforms

113 views
Skip to first unread message

Glen Rubin

unread,
Jul 20, 2010, 2:44:10 PM7/20/10
to Incanter
Hi!

I am trying to do some Fourier transforms using the library in
Parallel Colt. It seems that the method accepts a java array type as
argument, so I first convert my sequence into a java array as follows:

(def rp (to-array my-data))

(BTW: my data is an integer sequence of 640 points)

I then try transforming it as follows:

(.realForward rp)


but get the following error:

java.lang.IllegalArgumentException: No matching field found:
realForward for class [Ljava.lang.Object; (NO_SOURCE_FILE:0)

David Edgar Liebke

unread,
Jul 20, 2010, 3:00:30 PM7/20/10
to inca...@googlegroups.com
Try using int-array instead of to-array, which returns an object array.

David

Glen Rubin

unread,
Jul 20, 2010, 3:37:45 PM7/20/10
to Incanter
That doesn't quite do it. It seems the method takes a float [] a, so
I tried float-array, and floats as well as the two combined e.g.
(floats (float-array my-data)), but I get a similar error:

java.lang.IllegalArgumentException: No matching field found:
realForward for class [F (NO_SOURCE_FILE:0)

am i not calling the method correctly?

On Jul 20, 3:00 pm, David Edgar Liebke <lie...@gmail.com> wrote:
> Try using int-array instead of to-array, which returns an object array.
>
> David
>

David Edgar Liebke

unread,
Jul 20, 2010, 6:15:07 PM7/20/10
to inca...@googlegroups.com
If you're using the DoubleFFT_1D class, the realForward method
requires an array of doubles, so use double-array

(.realForward (DoubleFFT_1D. n) (double-array a))

http://incanter.org/docs/parallelcolt/api/edu/emory/mathcs/jtransforms/fft/DoubleFFT_1D.html

David

Glen Rubin

unread,
Jul 21, 2010, 10:18:44 AM7/21/10
to Incanter
OK, I got it to work, but first had to do the following:
(import (edu.emory.mathcs.jtransforms.fft FloatFFT_1D))

i guess that's b/c it's not part of incanter's core? sorry i'm not
very knowledgeable about namespaces and all that sort of stuff yet.

On Jul 20, 6:15 pm, David Edgar Liebke <lie...@gmail.com> wrote:
> If you're using the DoubleFFT_1D class, the realForward method
> requires an array of doubles, so use double-array
>
> (.realForward (DoubleFFT_1D. n) (double-array a))
>
> http://incanter.org/docs/parallelcolt/api/edu/emory/mathcs/jtransform...

Glen Rubin

unread,
Jul 20, 2010, 6:52:38 PM7/20/10
to Incanter
Ok, I did not know I needed to call the constructor method as
well...sorry David my Java skills are limited. Ok, I did as you said,
but am still getting an error as follows:

java.lang.IllegalArgumentException: Unable to resolve classname:
DoubleFFT_1D (NO_SOURCE_FILE:7)

Is there something else I need to import before attempting these
transforms??

thx!

On Jul 20, 6:15 pm, David Edgar Liebke <lie...@gmail.com> wrote:
> If you're using the DoubleFFT_1D class, the realForward method
> requires an array of doubles, so use double-array
>
> (.realForward (DoubleFFT_1D. n) (double-array a))
>
> http://incanter.org/docs/parallelcolt/api/edu/emory/mathcs/jtransform...

Glen Rubin

unread,
Jul 20, 2010, 7:57:57 PM7/20/10
to Incanter
that gives me the following error:
java.lang.IllegalArgumentException: Unable to resolve classname:
DoubleFFT_1D (NO_SOURCE_FILE:7)

is there some other lib i need?? thx!

On Jul 20, 6:15 pm, David Edgar Liebke <lie...@gmail.com> wrote:
> If you're using the DoubleFFT_1D class, the realForward method
> requires an array of doubles, so use double-array
>
> (.realForward (DoubleFFT_1D. n) (double-array a))
>
> http://incanter.org/docs/parallelcolt/api/edu/emory/mathcs/jtransform...
Reply all
Reply to author
Forward
0 new messages