Try this, it's probably buggy as I haven't played with it. To keep things simple and retain the full inverse transform capability I didn't generate imaginary internal values. Dimming a new array initialised to zeroes is just as cheap in Basic4pc code as in C#.
void Transform(double[] real, double[]imag)
void Inverse(double[] real, double[] imag)
double[] CopyArray(double[] array)
double[] ToAmplitude(double[] real, double[] imag, double scale)
double[] ToPhase(double[] real, double[] imag)
ToAmpAndPhase(double[] real, double[] imag, double scale) ' half and half
double[] ToReal(double[] amplitude, double[] phase, double scale)
double[] ToImaginary(double[] amplitude, double[] phase, double scale)
EDIT :- It doesn't work. I don't understand the indexing (k) in the bitreverse method so can't get it right for separate Real and Image arrays and theres a similar problem (b) in the actual transform. I'm going back to the original algorithm but will make it accept and return separate arrays.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Last edited by agraham : 03-16-2010 at 04:42 PM.
|