Understanding jtransform

I want to make fft of accelerometer data from android phone. I chose jtransform as the fft library. Now I need a simple code to understand jtranform for writing code to find fft from the accelerometer data. thanks in advance

+4
source share
1 answer

Since you have real data, you must pass these values ​​to the realForward function, as indicated here . When you pass an array of values ​​to this function, it returns results by overwriting that array using FFT coefficients.

 array = new double[arraySize]; ... DoubleFFT_1D dfft = new DoubleFFT_1D(arraySize); dfft.realForward(array); 

You should also consider the fact that the output contains both real and imaginary parts:

if arraySize even then

  array[2*k] = Re[k], 0 <= k < arraySize/2 array[2*k+1] = Im[k], 0 < k < arraySize/2 array[1] = Re[arraySize/2] 

if arraySize is odd then

  array[2*k] = Re[k], 0 <= k < (arraySize+1)/2 array[2*k+1] = Im[k], 0 < k < (arraySize-1)/2 array[1] = Im[(arraySize-1)/2] 
+1
source

Source: https://habr.com/ru/post/1399718/


All Articles