View Single Post
  #47 (permalink)  
Old 03-16-2010, 02:05 PM
agraham's Avatar
agraham agraham is offline
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

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.
Attached Files
File Type: zip FFT1.2.zip (4.5 KB, 5 views)
__________________
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.
Reply With Quote