On Dec 6, 3:57 pm, Mark <
[email protected]> wrote:
> On Dec 6, 6:32 pm, "dsavio" <
[email protected]> wrote:
>
>
>
> > >>On Dec 6, 5:21 am, "dsavio" <
[email protected]> wrote:
> > >>> Hi Everybody,
>
> > >>> I have been attempting to implement an FFT-based spectrum analyzer
> > >using a
> > >>> digitizer card, the reason being: I need (relative) phase information.
> > >I
> > >>> have a 100 MS/s digitizer card and I use Matlab to control it.
>
> > >>> I am using an Agilent I/Q signal generator which, for simplicity, I
> > am
> > >>> loading with 3 cosine tones in the I channel: one at 14.0 MHz, one
> > at
> > >>> 14.5 MHz, and one at 15.0 MHz. I give each of these tones some
> > phase,
> > >>> such as 30 degrees, 70 degrees, and -20 degrees, respectively.
>
> > >>> I acquire the signal and take the FFT in Matlab. The magnitude of
> > the
> > >FFT
> > >>> looks good: I can see the peaks at the appropriate frequencies (and a
> > >peak
> > >>> at 60 Hz, lol).
>
> > >>> The phase is a problem. I cannot get any good phase information out.
> > >I
> > >>> have tried sophisticated peak-detection algorithms, even 9th order
> > >>> polynomial interpolation in the vicinity of the peak, and calculate
> > >the
> > >>> DFT at a non-integer bin value corresponding to the peak. The
> > >magnitudes
> > >>> are great, but the angles seem like garbage. I don't care about
> > >absolute
> > >>> phase, but I should be seeing the phase differences between the tones
> > >>> being close to what I set them at, but I'm not seeing this at all.
> > >>> Unwrapping the phase doesn't work.
>
> > >>> Does anybody have any suggestions for me? I am pulling my hair out
> > >>> here!!
>
> > >>Unless your fft sample windows are offset by integer multiples
> > >>of all of the periods of your 3 cosine waves, the relative
> > >>phases will be different in every window. Why? Because
> > >>frequency is the rate of change of phase. Since your phases
> > >>are changing at 3 different rates, you will only see them
> > >>sync up when all 3 exact period multiples align with the
> > >>offset between your fft window and your phase reference
> > >>point in time.
>
> > >Thanks to everyone for your responses! I actually have been through the
> > >thought processes you have all suggested. I understand that the phases
> > of
> > >each tone will change at different rates over time, but I propose that
> > this
> > >is not the issue.
>
> > >Think about what the FFT tells us: For each tone, use this frequency at
> > >this phase to reproduce the original signal. Depending on the time
> > >instant that you start acquiring will give a different phase result for
> > >each tone, which I don't care about. The phases should, however, track
> > >eachother: ie. whatever the phases of the tones are should still differ
> > by
> > >the same amount when compared to eachother, since those are the phases
> > that
> > >you would need to reproduce the input signal.
>
> > >I DID run some Matlab simulations to test this stuff out with "ideal"
> > >signals, and what I discovered was that if you are not EXACT in your
> > >frequency peak detection, your phase information quickly becomes garbage.
> > >Even if you are off by like 20 Hz, that is enough to make your phase
> > >information garbage. But how does one detect the peak to within that
> > >accuracy? I have tried acquiring a huge number of samples to improve
> > >resolution bandwidth, and taking huge FFTs, but i still can't get good
> > >answers.
>
> > >I know that FFT spectrum analyzers are implemented successfully in
> > >practice, so there has to be something I'm missing here...!
>
> > I appologize for my previous reply: After thinking about it, I agree,
> > unless I am completely time synced, the phases will vary. How does one
> > usually accomplish the time syncing?
>
> > My comment above about the need to pick a peak with extreme accuracy
> > remains true, though. How is this kind of accuracy achieved with a
> > non-ideal signal?- Hide quoted text -
>
> > - Show quoted text -
>
> Hello,
> OK I had the same thought, phase relationship only makes sense when
> the frequencies are the same. The phase between two different
> frequencies is constaly changing. OK I agree with that... but
> then...... what is the meaning of the phase result in an FFT?
The the phase result of an FFT reports whether each bin's
component sinusoid is even (symmetric), odd, or some mixed
ratio of evenness/oddness, with respect to the center of
the FFT aperture. The even portion will be represented by
the real component, and the odd portion will appear in the
imaginary component of each bin.
If you try to reference to the beginning of your window,
then the even/oddness about the center of your data only
applies to input sinusoids which are exactly periodic in the
FFT aperture. If you have known or suspected periodicities
which are not clipped to exact period length boundaries
by an FFT, it might be easier to look at the phases with
respect to the center of the FFT aperture (or rotate the
input data halfway, using something like FFTShift, so that
the center of the data vector aligns with the start of
the FFT aperture). Then reference cosines will stay real
and reference sines imaginary, no matter what the frequency
(useful for phase interpolation).
IMHO. YMMV.
--
rhn A.T nicholson d.0.t C-o-M
http://www.nicholson.com/rhn/dsp.html