Fourier Transform

How to use this method:

public static void DFT (Complex[] data, Direction direction) 

if my input array is short[] samples ? I can easily convert short to double to put this value in a Complex struct. But this structure has two fields Im and Re . So, one of these values ​​will be my right pattern? What is the second meaning? Sample number?

Please help me solve this problem, because today I will not sleep.

+4
source share
1 answer

You should fill in the real part of each Complex value with your sample data, that is, using LINQ:

 complexSamples = samples.Select(sample => new Complex((double)sample, 0.0)).ToArray(); 

After DFT your complexSamples will contain non-zero imaginary components ( Im non-zero). Then it depends on what your next actions will be or not, you need to access these imaginary components.

It might also be nice to read a little more about DFT and complex Wikipedia numbers ...

+7
source

All Articles