[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FFT1 Resolution Bandwidth - back to basics

Hi Guy,

> > If you ask for 200 Hz you should get a bandwidth
> > around 200 Hz. Usually it will be a bit smaller, but sometimes
> > it could be a bit larger.
> It would be good if this were so, but it does not seem to be the case.
> I can only give you an example with a sample rate of 111.111kHz.
> At this rate and a sine^3 window, the possible bandwidths are:
> 260.6Hz for 1024 points,
> 130.3Hz for 2048 points,
> 65.2Hz for 4096 points.
> Ask for 261Hz, you get 260.6Hz (and 1024 points),
> ask for 260Hz, you get 130.3Hz (and 2048 points),
> ask for 200Hz, you get 130.3Hz (and 2048 points),
> ask for 131Hz, you get 130.3Hz (and 2048 points),
> ask for 130Hz, you get 65.2Hz (and 4096 points).
> You NEVER get more than you ask!
This could be true. The code is very old and
I do not remember exactly what it does.

> I have not looked at the code,
> but this makes me think of a calculation of the power of 2 for
> the FFT length from the asked bandwidth (and window power),
> which is then type converted from floating point to integer
> to give an exact power of 2.
> As you know, such type conversions simply truncate to the
> integer below the floating point value.
> If you want correct rounding to the nearest integer above or below,
> then you have to add 0.5 to the floating point value before the
> conversion.
> I think it would be best if you made it happen this way,
> but it does not currently do this, in v2.39 at least.

I changed it for 02-41 with the following result:
Ask for 200Hz, you get 225.2
Ask for 160Hz, you get 225.2
Ask for 159Hz, you get 112.6
Ask for 318Hz, you get 225.2
Ask for 319Hz, you get 450.4

All with 48 kHz and a power 3 window. The idea is that the
ratio between what you ask for and what you get should not
be larger than sqrt(2) or smaller than 1/sqrt(2).


Leif / SM5BSZ

You received this message because you are subscribed to the Google Groups "Linrad" group.
To post to this group, send email to linrad@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to linrad-unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at http://groups.google.com/group/linrad