# Low Pass Filter calculation

I am designing a circuit which reads a analog signal(DC - Response from a photo-diode exposed to tungsten lamp) to a 12 bit ADC. The ADC is MCP3202 running at 1Mhz speed and uses 16 input bits to get one sample of the result.

As per my calculations, I have calculated the response time of the low pass filter as shown below:

Chip Speed (Mhz)    1
Period(us : microSecond)    1
No of Process Cycles    16
Response time required (us) 16
Response time required (ns : NanoSeconds)   16000
Response time required (ms : MilliSeconds)  0.016
Response time required (Seconds)    0.000016 or 1.6E-5


I believe that if my RC circuit is slower than the above response time, then I will see a delayed response, which I should avoid. Therefore, I choose the following Resistance and Capacitor values for my RC low pass filter.

R = 1 K
C = 5 nF


The cut-off frequency is calculated as :

 fc = 31830.9886184[Hz]


The response time is calculated as:

1.1512925465E-5


Does all of the above sounds OK or am I off track here?

## 1 Answer

You have not thought this through. You have not specified exactly what sort of signal you expect to see, or how accurately you need to know it. But let's say it's a step function, and since you're using a 12-bit A/D, you need to know its' amplitude to 1 lsb. So, for a full-scale input step, your filter must settle to one part in 4096 in 16 msec. For a simple RC lowpass, the response to a step is an inverse exponential with a response proportional to e^-t/RC. For this to settle to 1/4096 will take about 9 time constants, so the 1/RC = 16 usec/9. In other words, you need C at about 560 pF rather than 5 nF.

But all of this assumes that the signal behaves as a step, AND that you need perfect accuracy from the A/D. Note, for instance, that if the step occurs 8 usec before an A/D sample, your filter will not permit a perfect sample for 16 usec, but that sample will not occur until 24 usec after the step (8 usec to the first, inaccurate sample, then another 16 usec until the correct value is available). So you need to figure out exactly what accuracy you need, and when you need it. Only then can you design your filter.

• Thanks for the response. I am trying to get a DC value from photo-diode exposed to a tungsten lamp (12V DC). I don't think it is a step function. Does this give some more detail? – Anuj Purohit Apr 6 '15 at 4:35
• OK. But incandescent lamps have response times in the 10s of milliseconds. So why do you need to respond in microseconds? – WhatRoughBeast Apr 6 '15 at 12:34
• I am currently capturing 100 samples from ADC and then do some filtering to return one value. This is with no low pass filter. This has led to overall slow speed of my application as the ADC return function itself takes around 100 milliseconds to complete which is not acceptable for my application. Therefore, I need to introduce a low(est) pass filter so that I can do minimum digital filtering and speed up as well. Hope this is clear. Can I have a low pass filter with high speed? – Anuj Purohit Apr 6 '15 at 13:08
• Some more details are posted here (related to what I am trying to do) [link]electronics.stackexchange.com/questions/159589/… – Anuj Purohit Apr 6 '15 at 13:14
• In the above comment, I mean that I am currently capturing 100 samples from ADC and then performing digital filtering to return one value (sort and return average of top 10 values). – Anuj Purohit Apr 6 '15 at 17:27