Drift compensation – Asynchronous Sample Rate Conversion

This program implements an interpolator used for the compensation of frequency drifts. The technique is based on a first-order recursive filter. There is one input parameter to set the amount of drift to be compensated for. The amount of drift is usually in the range of few percent down to few ppm.

The code is written in fixed-point C using Q15 and Q31 arithmetics. When ported on CortexM4 (LPC54x from NXP running at 12MHz without memory wait-states) the code is processing one sample every 18 cycles. This number is obtained without the need to optimize the critical loops in assembly language.

The technical documentation is located here.

The demonstration files and executable  (BATCH_DRIFT.BAT) are located here