Chris@25
|
1
|
Chris@25
|
2 Decimation
|
Chris@25
|
3 ==========
|
Chris@25
|
4
|
Chris@25
|
5 The aim of this little project is to compare a few different methods
|
Chris@25
|
6 of signal decimation for relative speed and quality. "Decimation"
|
Chris@27
|
7 refers here to downsampling a signal by a power-of-two factor.
|
Chris@25
|
8
|
Chris@25
|
9 The principle is to use a low-pass filter to reduce the bandwidth of
|
Chris@25
|
10 the signal to below the Nyquist frequency at the target sample rate
|
Chris@25
|
11 (i.e. with the maximum frequency content being below the original rate
|
Chris@25
|
12 divided by twice N, for a decimation factor N) and then to pick every
|
Chris@25
|
13 Nth sample.
|
Chris@25
|
14
|
Chris@25
|
15 This is simple enough, but we have a few different implementations
|
Chris@25
|
16 available with different quality and performance tradeoffs. Here we
|
Chris@25
|
17 compare:
|
Chris@25
|
18
|
Chris@25
|
19 * "decimate": the Decimator implementation in the qm-dsp library,
|
Chris@25
|
20 which uses an 8-tap IIR lowpass filter;
|
Chris@25
|
21
|
Chris@25
|
22 * "resample_hq", "resample_mq", "resample_lq": the Resampler
|
Chris@25
|
23 implementation in the qm-dsp library, which uses a lengthy
|
Chris@25
|
24 Kaiser-windowed sinc filter, at three different quality settings;
|
Chris@25
|
25
|
Chris@25
|
26 * "src": the sndfile-resample program which uses libsamplerate, a
|
Chris@25
|
27 well trusted resampler also using a Kaiser-windowed sinc
|
Chris@25
|
28 implementation, at its default quality setting;
|
Chris@25
|
29
|
Chris@25
|
30 * "zoh": the sndfile-resample zero-order hold resampler, which just
|
Chris@25
|
31 takes every Nth sample without any filtering, serving as a
|
Chris@25
|
32 baseline.
|
Chris@25
|
33
|
Chris@25
|
34 Run "make" (caution: only tested on Linux with GNU make and bash) to
|
Chris@25
|
35 build and run the tests.
|
Chris@25
|
36
|
Chris@25
|
37 Author: Chris Cannam (cannam@all-day-breakfast.com)
|
Chris@25
|
38
|