To calculate the phase, you can use GetRe and GetIm methods.
BTW, FFT1024 is open source
--- In ultimaserial_group@yahoogroups.com, "wolbie76" <wolbie76@...>
wrote:
>
> I am using VB6 to capture a 60 Hz sine wave at a sample rate of 12288.
> I am using a 120V outlet (with a DI-730) for testing. The sampled data
> goes through FFT1024 where I get PeakIdx. With multiples of Peak IDX I
> have the targeted hormonic frequencies. Using the PowerPt at these
> indexes I get the FFT value of the frequency. To convert to dB I
> divide by PowerScaler.
>
> V = FFT10241.GetPowerPt(FFT10241.GetPeakIdx * X)/(FFT10241.PowerScaler)
>
> Then I get the actual magnitude of the frequency by unscaling the value
> (But I don't know what this value represents. Does anyone know? Can I
> convert it to volts? )
>
> A = 10^(V/10)
>
> For THD I use the squareroot of the sum of the squares of each of the
> values over the fundamental.
>
> THD% = sqr(A1^2 + A2^2 + A3^3 ...)/A0 * 100
>
> But this seems to be off (by just over 2X), I don't near enough the
> same values as measured on a PQ Meter. I believe I need to compare the
> harmonic magnitudes to the fundamental magnitude to get individual
> harmonic content. I would like to get %, magnitude, and phase of the
> individual harmonics. Am I on the right track? Can anyone help?
>