← All boards
Educational › Basic Principles

Polyphase Versus Direct Downsampling Educational Example1

Plays on the mobile app
The Polyphase Versus Direct Downsampling Educational Example1 board in the WaveWarp DrawingBoard
Polyphase Versus Direct Downsampling Educational Example1 — the board as it opens in the WaveWarp DrawingBoard.

What it does

Polyphase versus direct implementation of a downsampler: direct case

Demonstrates how to build an anti-aliasing downsampler in the "direct" (straightforward) implementation. In this example, the sample rate is reduced by a factor of 4 (via the Simple DownSampler). An FIR anti-aliasing low-pass filter is included before the downsampler, in order to suppress aliasing. The filter is imported from an off-line design (created using the MATLAB code in the script-file "wwxmpl12.m" located in the wwmatlab directory). Observe that the frequency response of the filter has a cut-off frequency at a fourth of the Nyquist frequency, as required for a 4-factor downsampler.

Play the DrawingBoard and note that the audio sounds reasonable, despite the significant degree of downsampling. The "high frequencies" have, however, been attenuated as expected from the low-pass filtering (compare with the original by temporarily bypassing the entire downsampling chain to appreciate the difference).

An important point about this direct implementation, i.e. with the anti-alias filtering performed before the downsampling, is that the filter is executed at the high sample rate. This is wasteful bearing in mind that the 4-factor downsampler "throws away" 3 out of 4 samples! There is, in fact, a considerably more efficient implementation which gives identical results. It is known as the polyphase implementation, and is demonstrated in the companion ExampleDrawingBoard "PolyphaseVersusDirectDownsamplingEducationalExample2.dwb" .

For a thorough discussion on polyphase filtering, see "Wavelets and Filter Banks" by Gilbert Strang and Truong Nguyen, Wellesley-Cambridge Press, 1996, and "Multirate Digital Signal Processing" by Ronald E Crochiere and Lawrence R Rabiner, Prentice Hall, 1983.

This DrawingBoard nicely illustrates the power and versatility of WaveWarp's sample-by-sample multirate audio engine.

(WaveWarp 3.0, node 1: this "FIR low-pass" loaded 139 coefficients from an off-line design file ("dec4.txt") that this version cannot reproduce tap for tap. It runs an equivalent filter instead - a 139-tap Blackman-windowed low-pass at the same 5510 Hz cutoff, matching the original's passband and its 6 dB point; an octave above the cutoff it is 111 dB down, where the 1998 filter was 66 dB down.)

Effects used

6 blocks 3 connections