
B U F F E R S A N D S A M P L E R A T E
A P P E N D I X A
Latency Effects
The latency in the system will be at least equal to the minimum of the Audio and DSP Buffer Sizes
divided by the Sample Rate. Because both the DSP Buffer and the Sample Rate also determine the
minimum filter width, setting the Audio Buffer as small as your computer system will tolerate is
preferable. That way, latency will not be unnecessarily long. If latency is an issue with your computer
system, you may have to resort to a smaller Buffer Size and/or a higher Sample Rate than you would
otherwise prefer based on filter shapes.
Underlying Theory
To transform signals from the time domain to the frequency domain we start with the Discrete Fourier
Transform (DFT), which is the Fourier Transform for time sampled signals (The FFT or Fast Fourier
Transform is an efficient algorithm to calculate the DFT). It is important to realize that the result of the
DFT is a continuous function of the frequency, from –infinity to +infinity. The annoying thing about this
transform, however, is that it needs to “know” the temporal signal over a time domain of ±infinity.
Needless to say, this is not practical.
We can limit the time domain T to a limited number of samples (equal to the “slice” of time represented
by the
DSP Buffer
) if we assume the temporal signal to repeat continuously, with a period T. The
result is, however, no longer a continuous function of the frequency, but a discrete function, that is, the
power spectrum is only calculated at frequency intervals equal to 1/T. These discrete frequencies are
called
bins.
These bins can be envisioned as a series of 1/T Hz wide parallel filters, spaced every 1/T
Hz. Each bin “fills” with the average power at its center frequency and averaged over 1/T Hz. The
frequency resolution is therefore limited to 1/T Hz.
Because we assume the time domain signal at hand to repeat with period T, any discontinuity
between the last sample in a buffer and the first sample in the next buffer will violate this
condition. To understand this, it helps to know that the result of an FFT is complex, including
magnitude and phase information (this is even true if the temporal signal is real). In other
words, rather than on a straight line, the FFT writes the data on a circle in the complex plane,
where one revolution represents N/T Hz (N being the number of samples in the DSP Buffer).
When the last sample in the DSP Buffer meets the first sample in the next DSP Buffer, chances
are they will not meet in a continuous fashion. Any discontinuity will lead to a wide associated
spectrum across multiple bins, a phenomenon known as “bleed-through”.
Another way of looking at this is that a signal with period T (and any harmonic thereof), can be
represented as a combination of its fundamental frequency 1/T Hz and higher order harmonics,
all spaced at multiples of its fundamental frequency. These spectral components are therefore
at the center of each FFT bin. If on the other hand, the temporal signal does not have a
periodicity equal to (an integer multiple of )the fundamental frequency, it's spectral components
will not be centered on each bin and bleed through will occur from one bin to the next, resulting
in a loss of frequency resolution.
To avoid this happening, the samples in the DSP Buffer are first multiplied by a window function
(see page 102 and Appendix D), such that the spectral smearing is limited, but it is not
completely eliminated. Each window function has advantages and disadvantages depending on
the situation at hand. For our purposes, the Blackman-Harris window offers the best trade-off
between loss of frequency resolution and stop-band characteristics.
204
2003-2008 FlexRadio Systems