Sample multiple channels 'simultaneously' with a single ADC

September 16, 2011 // By Kendall Castor-Perry
Kendall Castor-Perry (aka The Filter Wizard) explains that despite its title, this is indeed an article about a filtering technique. Using it, you can sample a number of analog input channels sequentially with a single ADC in such a way that the data appears to have been acquired at the same instant in time on every channel. It sounds like magic – but it's just Wizardry!

So: sequential sampling, what’s the problem? After all, if you’ve got, let us say, four
channels that you need to sample at some rate Fs, and an ADC that’ll sample fully at 4Fs and that can be driven through a 4-way multiplexer, then isn’t that a nice economical way of getting the job done?

Here’s the catch. If you need to do any sample-by-sample processing involving data from more than one channel, you’re going to have to ‘pretend’ that readings you took from different channels at different times actually happened at the same time, so that you can combine them in a calculation.

Say you want to calculate the instantaneous energy being absorbed in an AC power circuit. You sample the voltage and the current, and multiply those readings together. The result gives you the energy, when multiplied by the length of time you assumed the samples were valid over – essentially, the sample period. Integrate these readings over time and you accumulate the total energy. Hey Presto, it’s an electricity meter!

But! If you use a multiplexed ADC, you didn’t take the voltage and the current readings at the same time. By pretending that you did, you’ve introduced a time delay between the voltage and the current sequences. This is equivalent to a small phase shift, which really messes up any calculation that’s sensitive to the phase difference between voltage and current.

The error doesn’t come from the sampling process itself, but from our choice of how to interpret and manipulate the sample values. Let’s set up an example with four channels; much of this material is taken from a real project I architected for a super-precise electricity meter built with PSoC3. Let’s refer to the four channels by the letters W through Z, and with sample number i written as W(i), and so on. With our ADC multiplexing round the four channels in order, it’s pretty clear

Design category: