- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
// Devide vector
Tuple<Complex[], Complex[]> DevideVector(Complex[] vector){
Complex[] firstPart = new Complex[vector.Length / 2],
secondPart = new Complex[vector.Length / 2];
for (int index = 0; index < firstPart.Length; index++) { firstPart[index] = vector[index]; }
for (int index = 0, offset = firstPart.Length; index < secondPart.Length; index++) { secondPart[index] = vector[index + offset]; }
return new Tuple<Complex[], Complex[]>(firstPart, secondPart);}
// FFT
public Complex[] Transform(Complex[] vector){
inverse = false;
Complex[] result = Operation(vector);
result = InverceIndexBits(result);
for (int index = 0; index < vector.Length; index++) { result[index] /= result.Length; }
return result;}
// IFFT
public Complex[] InverseTransform(Complex[] vector){
inverse = true;
Complex[] result = Operation(vector);
result = InverceIndexBits(result);
return result;}
}}