# Analog and Digital Conversion/Interpolation

## Down SamplingEdit

There are occasions when the sampler is producing samples too fast, or too slow for the rest of your circuit. When the sampler is producing too many samples, we need to remove some through a process called **Down-Sampling**. In a down-sampler, certain samples are removed from the digital signal, and the remainder of the samples may be altered to appear more "spread out".

Down-sampling is usually performed according to a fractional rule. An example would be a 2:1 down-sampler, which removes every second sample to decrease the bitrate in half.

## Up SamplingEdit

If the sampler isn't producing samples fast enough, we need to create more samples. The process of creating more samples is called **Up-Sampling**. In the most basic up-sampling scheme, additional samples with a value of zero are added beween the existing samples. This method is called "Zero Padding", but other methods, such as interpolation can also be used.

- Zero Padding
- Adding samples with a 0 value in between given samples to increase the bitrate
- Interpolation
- Using some mathematical rule to create new samples
*a*between two existing samples*n*and*m*, where*a = f(n, m)*.

## Linear InterpolationEdit

In linear interpolation, a straight-line is drawn between the two samples on either side of the new sample. The new sample value, then is considered to be a point on this straight line, or the average value. This is called linear interpolation, because the new samples will be on this line formed by the old samples.

As an example, consider that we want to double the sample rate by inserting linearly-interpolated samples between every two existing samples. In a linear system, the value of the new sample *a* between existing samples *n* and *m* would be:

## Non-Linear InterpolationsEdit

Analog signals rarely have straight lines in them, and therefore linear interpolation doesn't always produce a good approximation. Nonlinear techniques can be used, taking the surrounding points to produce a new point that isn't just an average value. these methods are called "non-linear interpolation", and there are too many of them for us to give a good example of each.