I am very new to the concept of Fourier transforms and DFTs so please explain in as simple terms as possible. I am messing around with Fourier transforms in processing. I wanted to determine the average wavelength of an input - trigonometric or otherwise. ```lang-c void generateHeightsCos() { heights = new float[xResolution][yResolution]; for (int y = 0; y < yResolution; y++) { for (int x = 0; x < xResolution; x++) { heights[x][y] = cos(2 * 3 * PI * x / xResolution); } } } ``` I use the above code to generate a cosine curve (I'm also using a 2d input and 2d Fourier transforms which is unshifted but I can shift it). The transform looks like this - I don't think there's any problem here. [![enter image description here][1]][1] [1]: https://i.sstatic.net/QIo29.png So now to get the average frequency (not wavelength I know but its in frequency domain) I used the following code: ```lang-c float GetMeanFrequency(Complex[][] input) { float total = 0; float totalCounts = 0; float count; for (int y = 0; y < yResolution; y++) { for (int x = 0; x < xResolution; x++) { count = input[x][y].magnitude(); total += x * count; totalCounts += count; } } return total / totalCounts; } ``` So the problem with this is the symmetry of Fourier transforms. Because of the symmetry it will return `xResolution / 2` no matter the frequency of the input. I could add a condition so it only checks the left half but then it won't work for higher frequency inputs. All answers are appreciated.