Anti-Alising Filter for PIC ADC

Thread Starter

Rebentadevices

Joined Sep 22, 2016
13
Hi, i'm i've build an circuit, ilustrated in the bellow figure, which its purpose is to sample an Sine Wave of 1kHz sourced by an InAmp (AD8226) with an ADC from a uC (Pic18f26j13) with maximum Fsampling= 40 kHz . This adc has 12 bit and its voltage reference is 3V.
When i designed the following circuit i added an passive anti-aliasing filter but i was reckless and i didn't know very well what i was doing. So i projected with some values that i realize now that were totally wrong and this is where I'm now and a little desperate for some help.

Because first of all, the AD8226 requires that the time constant of this RC filter would be slower than 5uS. I was told if i wanted to achieve the ADC's resolution (12 bits) i would want to achieve a settling time when the filter reaches an magnitude of 74 db (6.02N+1.76 dB) . This means i would need to wait between samples 8.6*RC , which would lead to 23kHz (8.6*5us). Is this correct ?

On the other hand i also read in other discussion forum that with a 23kHz the maximum sampling frequency i would be limited to filtering a signal of half of this frequency , 11.5 kHz. And with a passive filter i should get a -20dB around this 10kHz, thus i should set the corner frequency to 1.15kHz.
But if this is true i would be filtering or very close to filtering my 1kHz signal frequency too, degrading the signal.

I was wondering what would be the cost of letting go the RC filter and just connect the Inamp directly to the adc ?


Its a huge mess, can someone shed some light over this mater, all i want is to try to not compromise the 12 bit resolution of the ADC and keep a minimum 5uS time constant of the filter to not compromise my InAmp Stability.

Thank you
 

Attachments

MrChips

Joined Oct 2, 2009
30,807
An anti-aliasing filter is simply that, to prevent aliasing of higher frequency signals into low frequencies.

For example, if your sampling frequency is 40kHz and you were to sample a 39kHz or 41kHz signal, then both would result in a 1kHz signal.
No filter is perfect, that is, you will still get some signal leaking through unless the unwanted signal is way above the corner frequency.

If your signal is a pure sine-wave at 1kHz then there is no need for an anti-aliasing filter.
Even if the sine-wave has some distortion, how much of its content will be greater than 20kHz (i.e. your Nyquist limit)?

If you still feel better by inserting a filter, a 6dB/octave roll-off with a corner frequency at 5kHz would give -9dB @ 10kHz, -15dB @ 20kHz, -21dB @ 40kHz.
 

crutschow

Joined Mar 14, 2008
34,442
.........
the AD8226 requires that the time constant of this RC filter would be slower than 5uS. I was told if i wanted to achieve the ADC's resolution (12 bits) i would want to achieve a settling time when the filter reaches an magnitude of 74 db (6.02N+1.76 dB) . This means i would need to wait between samples 8.6*RC , which would lead to 23kHz (8.6*5us). Is this correct ?
The filter time-constant would need to be faster, not slower.
For a step function signal change from 0V to maximum at a 40kHz sample rate, the filter time-constant would need to be 1/40kHz/8.3 or 3.0μs, for a corner frequency of 52.8kHz.

But that's not true for a sine-wave input which would change very little in amplitude between samples.
For a sine-wave you want the anti-alias filter rolloff to be as low as possible without degrading the signal amplitude.
Thus for a 1-pole RC rolloff for a 1kHz signal and a 0.1% reduction in amplitude, the corner frequency would be about 23kHz.
Whether that's sufficient or not depends upon how much high frequency noise there may be in the signal.
 

Thread Starter

Rebentadevices

Joined Sep 22, 2016
13
The filter time-constant would need to be faster, not slower.
For a step function signal change from 0V to maximum at a 40kHz sample rate, the filter time-constant would need to be 1/40kHz/8.3 or 3.0μs, for a corner frequency of 52.8kHz.

But that's not true for a sine-wave input which would change very little in amplitude between samples.
For a sine-wave you want the anti-alias filter rolloff to be as low as possible without degrading the signal amplitude.
Thus for a 1-pole RC rolloff for a 1kHz signal and a 0.1% reduction in amplitude, the corner frequency would be about 23kHz.
Whether that's sufficient or not depends upon how much high frequency noise there may be in the signal.
Regarding the 5uS, if you could check the AD8226 datasheet with me ? In the page 24,about adc driving, states " Option 1 shows the minimum configuration required to drive a charge-sampling ADC. The capacitor provides charge to the
ADC sampling capacitor while the resistor shields the AD8226 from the capacitance. To keep the AD8226 stable, the RC time constant of the resistor and capacitor needs to stay above 5 µs. This circuit is mainly useful for lower frequency signals. " And then gives the example of a RC filter with a time constant of 10uS (100*100nF). Am i missing something ?

"Thus for a 1-pole RC rolloff for a 1kHz signal and a 0.1% reduction in amplitude, the corner frequency would be about 23kHz." Can you show me the math how you reached this values ?

Thank you
 

crutschow

Joined Mar 14, 2008
34,442
Regarding the 5uS, if you could check the AD8226 datasheet with me ? In the page 24,about adc driving, states " Option 1 shows the minimum configuration required to drive a charge-sampling ADC. The capacitor provides charge to the
ADC sampling capacitor while the resistor shields the AD8226 from the capacitance. To keep the AD8226 stable, the RC time constant of the resistor and capacitor needs to stay above 5 µs. This circuit is mainly useful for lower frequency signals. " And then gives the example of a RC filter with a time constant of 10uS (100*100nF). Am i missing something ?
No you are not missing anything.
But that's talking about the op amp output and ADC input requirements, not about anti-aliasing requirements.
"Thus for a 1-pole RC rolloff for a 1kHz signal and a 0.1% reduction in amplitude, the corner frequency would be about 23kHz." Can you show me the math how you reached this values ?
You can use the formula
upload_2017-4-17_20-0-34.png
where
upload_2017-4-17_20-1-31.png

I'll leave he calculations as an exercise for the reader. ;)
 
Top