View Single Post
Old 07-28-2009, 04:48 AM   #16
Human being with feelings
liteon's Avatar
Join Date: Apr 2008
Posts: 510
Default oversampling with "zero-stuffing" method

"oversampling" in dsp therms is "processing at a higher sample rate, then restoring to the original sample rate" or related to a dsp effect which is "oversampled". The most common use is in cases, where effects produce the reflection like artifact of "aliasing" (or static distortion). Nx oversampling requires execution of the same process Nx times.

a 4x os scheme for a non-recursive [fx]:
usf - up-sample
dsf - down-sample
bl - band-limit (aliasing reduction or anti-aliasing)
            -->- [fx0] [bl] -->-
          /                      \
      [usf]                      [dsf]
      /   \                      /    \
     /      -->- [fx1] [bl] -->-       \
    /                                   \ 
[usf]                                   [dsf]
    \                                   /
     \      -->- [fx2] [bl] -->-       / 
      \   /                      \    /
      [usf]                      [dsf]
          \                      / 
            -->- [fx3] [bl] -->-
the above scheme is only for a non-recursive fx (not using previous sample values) in the lines of y(n)=sin(x(n)).
for a recursive fx in the lines of y(n)=sin((x(n-1)+x(n))*0.5), the following must be done:
one should think of the two outputs of an up-sample filter as a sequence in a discrete signal: out0 is followed by out1, but to make an recursive fx work, you should feed the result of processing of out0 into fx1, since out0 is previous to out1. and then for the next call the processed output of out1 should be fed into fx0.

if we block-diagram this:
       --[out0] ->--------- [fx0] -- [result0] ->- ...
     /    ...(result1) ->----/
       --[out1] ->--------- [fx1] -- [result1] ->- ...
          ...(result0) ->----/
a triangular window filter as an example:

//fxout0 = process -> usout0;
//fxout1 = process -> usout1;

//bandlimit -> fxout0;
//bandlimit -> fxout1;

- up/down sampling introduces aliasing of its own.
- the quality of the up/down sample and band-limit filters is of great importance (high order filters required). the above triangular filter requires "signal restoration" in the form of high-shelf boost or similar since it also affects the audible range.
- oversampling ends up as a resource expensive process, so it is best to be avoided, unless more resources are available.

extended information: (by jos - ccrma @ stanford) (by andrew j - sm)


Last edited by liteon; 08-01-2009 at 08:09 PM.
liteon is offline   Reply With Quote