How to resample a signal without aliasing
To put this another way: in order to avoid aliasing, you must take at least twice as many output samples as the finest detail in your input signal.
That leaves us with basically just two ways to avoid aliasing:
- Take more output samples
- Or have less fine detail in the input signal
- Smooth (aka. blur) the input data to remove fine detail
- Or smooth (aka. filter) on the fly as we read our sample values
Option 2.2 can dynamically adjust to different sampling frequencies, but tends to be expensive to implement, as it must average many different samples from slightly different locations in the input.
A third option is to declare this whole digital sampling business a mug's game and refuse to play at all. In some situations it is possible to work entirely with mathematical equations, transforming one signal into another by applying mathematical transformations to the equations which describe them. This approach inherently avoids digital approximation, so will not produce any aliasing, but the math tends to get very complex. It is not widely used in realtime computer graphics, but many offline renderers (eg. RenderMan) work this way.
Ok, that's enough theory. Next, let's get practical...