Hi @Christian_Tischer

I’m glad you got the code running. Yes you are correct, the frequency is 0 in y, and 0.1 cycles per sample in z. The highest frequency you can capture (nyquist) is 0.5 cycles per sample.

I changed the formula to use cos and removed the ‘+1’ dc frequency

```
// use ops to create a cos pattern
formula = "Math.cos((0.1)*2*Math.PI*p[0])"
cosImg = ops.image().equation(blank, formula)
```

I also added a line plot of the fourier transform. Here are my plots for an image size of 90,90 (a nice peak at 9) and 91,91 (peak still at 10, but many other frequencies are present). Do you get similar results??

The complete script is below.

```
// @OpService ops
// @UIService ui
import net.imglib2.FinalDimensions
import net.imglib2.type.numeric.real.FloatType
import net.imglib2.img.display.imagej.ImageJFunctions
import ij.IJ
// define an xSize and ySize, feel free to try different sizes, most sizes will be padded, however 90, 90 is not padded
// TRY THIS: After running script change size to 91, 91 and notice the differences in 'paddedSize' and final output.
xSize=90
ySize=90
// define arrays for the padded size and fft size
origSize=[xSize, ySize] as long[]
paddedSize=new long[2]
fftSize=new long[2]
// use ops to get the padded size and fft size for the original size
ops.filter().fftSize(origSize,paddedSize, fftSize, true, true)
// print out the resuts and check if extra padding will be done inside the fft
println "Original size: "+xSize+" "+ySize
println "Padded size: "+paddedSize[0]+" "+paddedSize[1]
// note the fft size will be n/2+1 the original size in the x dimension...
// this is due to the fact the fft is an array of complex numbers,
// and known to be symmetrical for a real signal, thus only n/2+1 of the coefficients
// are needed (the others are redundant).
println "FFT size: "+fftSize[0]+" "+fftSize[1]
// now use ops to create an empty image
blank=ops.create().img(new FinalDimensions(xSize,ySize),new FloatType())
// use ops to create a cos pattern
formula = "Math.cos((0.1)*2*Math.PI*p[0])"
cosImg = ops.image().equation(blank, formula)
ui.show(cosImg)
// perform fft and display using ImageJFunctions
fft=ops.filter().fft(cosImg)
// ImageJFunctions displays the power spectrum of our complex signal
ImageJFunctions.show(fft).setTitle("fft power spectrum")
IJ.resetMinAndMax();
IJ.makeLine(0, 0, xSize/2+1, 0);
IJ.run("Plot Profile");
```