## A Further Note on Half-Band Filters

In This Posting, I mentioned “Half-Band Filters”, which are a special case of the “Sinc Filter”, that are faster to compute than typical sinc filters, because in this case, half the coefficients are equal to zero, which means that half the samples which are usually multiplied by coefficients, do not need to be.

Even though this is easy to say, there is one consideration in coding the principle, essential to make it work.

A tight loop would need to dereference half the samples in the input stream, in a pattern which also skips the center sample, which is usually multiplied by the coefficient (+1) as an exception. After this loop has finished, the central input sample would be added to the accumulated, weighted sum, to arrive at the final value for the output sample.

Dirk

(Edit 03/21/2017 : )

There is an additional observation to offer, on half-band filters. Their direct use for playback would suffer from a problem I have yet to characterize. If used directly as input / output filters, this kind of filter assumes that an analog filter is capable of passing an intended signal-frequency, while suppressing a frequency adequately, which is only twice as high – i.e. one octave higher.

The problem with this is the fact that realistic analog low-pass filters never bring down the amplitude completely to zero. And if they are given only one octave to work with, then they will effectively be reducing the signal energy at the oversampled Nyquist Frequency to -50db. While this might sound adequate, for many purposes it is not.

This parasitic energy which is passed will simply show up in critiques of the technology as noise. And if it is either the goal or the achievement, that the noise-level be as low as -90db, and yet that the frequency-response curve be very clean, then the analog filters need to be given 2 or 3 octaves to work with. And this will mean that the digital system needs to be oversampled 4x or maybe even 8x.

This can be accomplished, if several half-band filters are put in a dyadic chain, but then something else cannot be accomplished.

## A Note on Sample-Rate Conversion Filters

One type of (low-pass) filter which I had learned about some time ago, is a Sinc Filter. And by now, I have forgiven the audio industry, for placing the cutoff frequencies of various sinc filters, directly equal to a relevant Nyquist Frequency. Apparently, it does not bother them that a sinc filter will pass the cutoff frequency itself, at an amplitude of 1/2, and that therefore a sampled audio stream can result, with signal energy directly at its Nyquist Frequency.

There are more details about sinc filters to know, that are relevant to the Digital Audio Workstation named ‘QTractor‘, as well as to other DAWs. Apparently, if we want to resample an audio stream from 44.1 kHz to 48 kHz, in theory this corresponds to a “Rational” filter of 147:160, which means that if our Low-Pass Filter is supposed to be a sinc filter, it would need to have 160 * (n) coefficients in order to work ideally.

But, since no audio experts are usually serious about devising such a filter, what they will try next in such a case, is just to oversample the original stream by some reasonable factor, such as by a factor of 4 or 8, then to apply the sinc filter to this sample-rate, and after that to achieve a down-sampling, by just picking samples out, the sample-numbers of which have been rounded down. This is also referred to as an “Arbitrary Sample-Rate Conversion”.

Because 1 oversampled interval then corresponds to only 1/4 or 1/8 the real sampling interval of the source, the artifacts can be reduced in this way. Yet, this use of a sinc filter is known to produce some loss of accuracy, due to the oversampling, which sets a limit in quality.

Now, I have read that a type of filter also exists, which is called a “Farrow Filter”. But personally, I know nothing about Farrow Filters.

As an alternative to cherry-picking samples in rounded-down positions, it is possible to perform a polynomial smoothing of the oversampled stream (after applying a sinc filter if set to the highest quality), and then to ‘pick’ points along the (now continuous) polynomial that correspond to the output sampling rate. This can be simplified into a system of linear equations, where the exponents of the input-stream positions conversely become the constants, multipliers of which reflect the input stream. At some computational penalty, it should be possible to reduce output artifacts greatly.