Benefits of oversampling in a realtime noise-cancellation system When sampling a signal, it is standard practice to use a sampling rate that is greater than two times the bandwidth of the signal in order to avoid aliasing. The result is then low-pass filtered (and sometimes upsampled prior to this) in order to get rid of the harmonics.

Unfortunately, in control systems applications preventing aliasing in not enough. The system also needs to respond quickly enough to the input (as determined by a spec), and a low sampling rate will limit this performance. Specifically, if the system samples a signal at time t, then any event that occurs immediately afterwards will be ignored until one sampling period later.  Thus, there are clear performance advantages to having a sampling rate much greater than two times the signal bandwidth. I'm looking to quantify this performance improvement.

Consider an open-loop control system that attempts to cancel out an incoming signal by outputting an inverted version of this same signal. In other words, active compensation through destructive interference. If the system has infinite magnitude resolution (both the ADC and DAC have infinite bits) and an infinite sampling time, then the inverted output signal will be a perfect inverse of the original and the signals will cancel out completely. But if the system has a finite sampling rate, then the output signal will not be a perfect inverse of the original and the two will not cancel completely. The lower the sampling rate, the worse the cancellation will be (even if no aliasing occurs).

Q: Assuming the following:


The input signal is a  sinusoid of frequency $f_0$ and magnitude $A$
The system has an ADC with a sampling rate of $f_s$ where $f_s &gt; 2 f_0$
The system uses sample-and-hold (ZOH) interpolation to output an inverted sinusoid and add it to the original signal
The system has zero time delay between an ADC sample and the corresponding DAC output (ADC settling time, DSP calculations, etc. are instantaneous)


How do I calculate the frequency and magnitude of the resulting frequency components?
The system has zero time delay (sampling, calculations, etc. are instantaneous)


This is an invalid assumption. Almost every digital system has at least one sample delay. DAC and ADC or clocked off the same master clock. So at sample time n, the ADC is acquiring sample n while at the same time the DAC is outputting sample n-1. The only way around this is using a much higher master clock, donwsampling that clock and clocking the A/D and D/A on different phases. However that's equivalent to running at a higher sample rate in the first place.

So your ability to cancel is given by how much the amplitude of the sine wave changes during 1 sample. The residual signal is simply given by $$e(t) = \sin(f_0 \cdot t) - \sin(f_0 \cdot (t-T_s)) = 2 \cdot \cos(f_0 \cdot (t- T_s/2)) \cdot \sin(f_0 \cdot T_s/2)$$
 where $T_s = 1/f_s$ is the sample time. The error is simply a function of the ratio of signal frequency and sample rate. For $f_0 &lt;&lt; f_s$ the error is very small.

The only way to get around this is to crank up the sample rate or use some a priori knowledge of the signal to do some prediction and speculative cancellation.