DSPRelated.com
Forums

FFT on a square wave

Started by Klaus Vestergaard Kragelund January 18, 2004
Hi

I have an application where I'm using a functiongenerator and a scope to do
network analysis. The function generator is programmed at various sine
frequencies and the scope captures an image per freq. and this image is
download to the PC for analysis. For both A and B channel on the scope the
magnitude and phase relationship is found and the gain is found by (A/B),
the phase by A-B

However I use a function to find the zero crossing point to get the phase
and that is not so elegant. (I hopping around to locate a zero value)

I was wondering about using FFT instead. So both waveforms (A and B) was run
through a FFT analysis and the Gain/Phase result would be found by dividing
and subtracting the FFT spectrum of the Gain and Phase respectively

But due to speed concerns I was thinking about using a squarewave instead
(today I sweep with about 4-5 frequencies per decade to get satisfiable
accuracy). The squarewave has a fundamental and some harmonics (3rd, 5th and
so on). But then I could measure a frequency decade with one frequency. The
harmonics will be attenuated, but anyway I would do the FFT and get the
results for 1xFreq, 3xFreq, 5xFreq....

But what about the phase - will that work on that too? Subtracting the FFT
on the channel A waveform from the FFT on the channel B waveform by
subtracting "1xFreq_A - 1xFreq_B" and "3xFreq_A - 3xFreq_B" and so on.....

Thanks

Klaus


Hi!

> But what about the phase - will that work on that too? Subtracting the FFT > on the channel A waveform from the FFT on the channel B waveform by > subtracting "1xFreq_A - 1xFreq_B" and "3xFreq_A - 3xFreq_B" and so on.....
The phase will work to. But just the difference. The absolute would still be wrong. Regards! Atmapuri.