|
On 9 Nov, 13:35, "Ben Price" <bpr...@medphys.ucl.ac.uk> wrote:
> Hi
>
> I am trying to perform an fft on some data but have been
> having trouble with the scaling of the frequency axis. I
> started testing things with gaussians. If one starts with
> a gaussian of full width half maximum of 1.386a then the
> resulting gaussian on transform is expected to have width
> 0.44/a. This is a well known mathematical result.
Try sinusoidals instead. They are easier to troubleshoot.
> I defined a number of gaussians of various widths and then
> took the fft of each. Each gaussian is defined over 32,768
> points (2^15) and thus the fft returned equally has 2^15
> points. For example define a gaussian with mean 0,
> standard deviation 1 over the range x = (-
> 16.384:0.001:16.383). When plotting the fft values returned
> against the original time axis (x) of the input gaussian
> one would expect to find that a common scaling factor is
> required to scale the x-axis in order to give the gaussians
> the correct widths - indeed it is...21.625
>
> When I repeat this using box functions of various widths
> however the scaling factor required changes depending on
> the box function and is certainly never equal to 21.625 as
> before. For a box function of width 'a' one expects that
> the fft is a sinc function with first minima at 1/a.
What reference are you comparing against? The Fourier
integral or the DFT? Again, the troubleshooting is
significantly easier with sinusoidals.
> So why does the scaling factor change in different cases?
> This should be the same for ANY 32,768 point function.
I can see two possible causes:
The first is that your refernce is the Fourier integral
of a countinuous-time Gaussian. The second is that the
DFT as implemented by matlab is not unitary, you need to
divide by a factor sqrt(N) to make Parseval's equation
work.
Provided, of course, that I have understodd the test
you did, which by no means is certain.
Try to compute the DFT of a sinusoidal, and reformulate
the question from those results. Troubleshooting becomes
a lot easier.
Rune
|