I don’t know if Xojo can do FFT, in fact, to be honest, I barely understand FFT myself!
I am trying to port some code, it would look something like this, if it worked in Xojo…
For i As Integer = 0 To Ubound(frequency)
Dim w As Double = 2.0 * 3.14159 * frequency(i)
Dim z As Double = Complex.Conjugate(Complex.Conjugate(resistance) + Complex.Imaginary(inductance * w))
Dim y As Double = Complex.Inverse(z)
magnitude(i) = magnitude(i) + 20.0 * Log10(Abs(1.0 / z))
phase(i) = phase(i) + (180.0 / 3.14159) * Arg(y)
Next
Is there anyway to make something like this work in Xojo?
Select your code including an empty line before it and click in the ’</> icon (in write mode…).
Another good thing to do is no not use FFT as is: define what it is, and place FFT inside parents;, then you can use the acronym. TIA (for those who do not know what is FFT: French Federation of Tennis players, for example…)