# Quantization of bands in frequency domain?

Started by September 22, 2011
```Hi all -

Apologies for what is probably a horribly naive question - but Google has
been no help and I'm extraordinarily rusty with this stuff at the moment.
Say I have a signal sampled at a depth of 8bits, 10kHz, and I take an
N-Point FFT.

I understand there will be N/2 bands, each representing a width of 10000/N
Hz, but what will be the quantization/depth of the levels represented by
each bin? Is it just the same as the input bit depth? Is it dependent on N?
Both? Neither?

Best!
Scott

```
```>Hi all -
>
>Apologies for what is probably a horribly naive question - but Google has
>been no help and I'm extraordinarily rusty with this stuff at the moment.
>Say I have a signal sampled at a depth of 8bits, 10kHz, and I take an
>N-Point FFT.
>
>I understand there will be N/2 bands, each representing a width of
10000/N
>Hz, but what will be the quantization/depth of the levels represented by
>each bin? Is it just the same as the input bit depth? Is it dependent on
N?
>Both? Neither?
>
>Best!
>Scott
>
>
>

Figured it out playing with Matlab. # of possible levels for each bin seems
to be about N/2 and dynamic range about ~0.5 (if signal is normalized) -
independent of quantization or sampling rate (which makes sense)
```
```sno <boomtechnology@n_o_s_p_a_m.gmail.com> wrote:

> Apologies for what is probably a horribly naive question - but Google has
> been no help and I'm extraordinarily rusty with this stuff at the moment.
> Say I have a signal sampled at a depth of 8bits, 10kHz, and I take an
> N-Point FFT.

Actually, this is a good question.  Not at all obvious.

> I understand there will be N/2 bands, each representing a width of 10000/N
> Hz, but what will be the quantization/depth of the levels represented by
> each bin? Is it just the same as the input bit depth? Is it dependent on N?
> Both? Neither?

Consider first the DC, or 0Hz bin.  It can be zero, or, in the unlikely
case that all input samples are of maximum value, N times the
maximum input value.  With the appropriate input values, other
bins can be almost as large.  If done in floating point, one trusts
the floating point arithmetic rounding to give a reasonable result.

In fixed point, one can do the transform with additional depth,
and adjust, as needed, at the end.  That requires one additional
bit for each base 2 transform stage, or log2(N) additional bits.

For typical data, that is more bits than are needed.  Adding one
bit for each two transform stages, or log2(N)/2, might not be
so far off.  If one wants to keep a fixed depth, that can be done
by dividing by two every two transform stages.  The DC level,
average of all the input points, can be computed separately.

More generally, the more you know about your data the better
you can choose where to place the bits.

-- glen
```
```Hi,

maybe it helps to look at the noise (or maybe not, it depends on what
you're trying to achieve)

For a fullscale sine wave, the quantization noise in n bit resolution is
6.02n+1.77 dB below the power of the sine wave.
Often you can assume that quantization noise is white. In that case, it
distributes evenly over all bins. For example, for 8 bits and 10000 bins,
the noise in each bin should be 6.02 * 8 + 1.77 + 10 log10(10000) = 90 dB
below the value of the sine wave in its assigned bin.

Things get messy, when quantization noise is _not_ white anymore. For
example, listen to a piano note that slowly decays into the noise floor.
When the amplitude reaches the level of the final bit, the noise is
anything but white, it gets "attracted" to bins near the sine wave
frequency.

```
```>Hi all -
>
>Apologies for what is probably a horribly naive question - but Google has
>been no help and I'm extraordinarily rusty with this stuff at the moment.
>Say I have a signal sampled at a depth of 8bits, 10kHz, and I take an
>N-Point FFT.
>
>I understand there will be N/2 bands, each representing a width of
10000/N
>Hz, but what will be the quantization/depth of the levels represented by
>each bin? Is it just the same as the input bit depth? Is it dependent on
N?
>Both? Neither?
>
>Best!
>Scott
>
>
>

Hi,

If I get your question correctly,

I think it will depend both on the input quantization and the number of
FFTs you select.Unless, you take care of the scaling during FFT.

If your data is quanitized at 8 bit level with some amplitude, your FFT of

the data will change in scale by nFFT. If you use the same quantization
level, your specturm will have higher quantization error. To avoid this,
you need to scale your FFT to the level where it fits 8 Bits for low
quantization noise. So, your dependency is on the scaling which inturn
depends on nFFT.

Regards
Hozefa

```