Re: Interpretation of FFT phase
- From: "Dave Robinson" <dave.robinson@xxxxxxxxxxxxx>
- Date: Thu, 11 Aug 2005 04:58:55 -0400
François Bouffard wrote:
>
>
>> The angle is arctan(imag(y)./real(y)). In the case of your y,
the
>> imag
>> part looks to be numerical junk (eg. if fft has some roundoff
>> error).
>
> Well, the signal is a sine wave: its spectrum is zero almost
> everywhere (except for two spectral bins). The phase of zero is in
> fact undetermined... The output of angle is thus random here
> (because
> of numerical precision limitations on the real and imaginary values
> of the zero-valued bins), and unwrap(angle) is simply a random
> walk.
>
> François
Phase calculation will always return an angle between 0 and 2*pi (or
-pi and pi). So the stunt I use is to check if both real AND
imaginary parts of each spectral sample is less than a small
threshold, if so I set the output phase to a daft angle (e.g. 5*pi)
or even NaN, so that it can be detected post processing. Don't be
tempted just to set it to zero as this is of course a possible valid
phase measurement.
Regards
Dave Robinson
.
- References:
- Interpretation of FFT phase
- From: TWago
- Re: Interpretation of FFT phase
- From: spasmous
- Re: Interpretation of FFT phase
- From: François Bouffard
- Interpretation of FFT phase
- Prev by Date: Enable options for the .mdl file to generate code
- Next by Date: Defining own dateform
- Previous by thread: Re: Interpretation of FFT phase
- Next by thread: Multiple Integration(more than 3)
- Index(es):
Relevant Pages
|