Some applications require filtering as I alluded to earlier. Interestingly, we don't filter our temperature sensor. We haven't identified a reason or a need to do so, but some sensors in some applications might require filtering, so as we're going to talk about it. It was one of the key learnings for this course. So, we pass Vtherm through a low-pass filter and F sub c is a cutoff frequency in my notation here. This is the minus 3 dB down point. I remember just enough of this when I was at university. I could not do the math right now to create a filter or do any of that. I'm going to demo the TI. I think it's a TI software here in few minutes. It builds the filters for you, but years ago we had to figure it all out by hand and other software and just say what do you want and then it just spits the drawing, schematic up for it. Of course all TI components were naturally, but that's fine. So, this is your attenuation. What did I say? One hertz, it should have been a k in there, one kilohertz. The curve frequency response starts to roll off and there's some steepness to this curve, so areas to the right of the cutoff frequency is called the stopband and areas to the left of the cutoff frequency are known as the passband, and with the half power point being the minus three dB point. So, one of the simplest filters we can build is in RC network. We've got a inline resistor with a capacitor to ground. So, this is shunting high-frequency. I always thought it is trapping high frequencies to ground when I'm built these things. So, the cutoff frequency is given by this equation. It should have been capital F sub c as one over two Pi RC and the answer comes out in hertz. So, if we chose a resistor to be 100 ohms and we wanted the cutoff frequency to be one kilohertz, to munch that equation around and solve for C and it comes out to be 1.6 microfarad capacitor. Very simple, very inexpensive, it has some drawbacks. In the steady state, current out of this thing is zero because we're dealing with a DC. Relatively slow changing DC value and we've got some high-frequency noise that we're trying to filter out of this. So, current out, we want to be zero. So, that's good. But, it doesn't provide any buffering for the low impedance input to the A to D converter. So, we would have to follow this with a unity gain amplifier like a cheap op-amp or something, a relatively inexpensive op-amp. Probably should have drawn that in their, but just imagine that there's one there. I've got one coming up in another slide here. So, here's an example of now moving from a passive set of components to a simple act of filter using TI's filter pro desktop. This is the one I alluded to a minute ago. So, you tell it what you want and it draws a schematic and it shows you the frequency response curve. Here, the frequency is at 183. So, that's one kilohertz right there. We're starting to roll off, you hit the three db down point. Then there's some rate at which that goes out to megahertz. It's at over minus 120 dB out there at megahertz. So, a few more components instead of just a resistor and a capacitor. We've added three resistors and capacitors in our op-amp. So, we got a little more cost, a little more space on your printed circuit board. Another type of filter is a digital finite impulse response filter. Figure that have had signal processing. You know all about this. There is a clock in a digital FIR filter. When I worked for the one year at the local satellite company, I learned about digital FIR filters. I know we synthesize. They wrote the DSP Group at the company who wrote the RTL code and we synthesize that. We gave them area and power and timing information back. They were trying all different kinds of filter approaches to meet the product's requirements. The input comes in. These are flip-flops, there're registers. These are multipliers and these are adders, so the input values come in and get multiplied, and then get shifted, and then multiplied and added, and then shifted, and multiply and added, and shifted and multiplied and added. However, many stages there are in this, eventually you get an output. If you've worked with these digital filters before, you'll notice when we were looking at the analog ones that we had this very nice curve that was very well behaved in a nice gentle slope down. Digital filters have these humps that develop, the order of the filter goes up. You can push these down. Only you and your application and your requirements can tell you if these humps out here at minus 85 dB are an issue for you or not. They might be and they might not be. If they are, then you can increase the order of your filter and you can push these down. I had a free version of the Cypress software I run into on Sunday. The free period ran out and I didn't take the time to renew it, so I can't demo it for you here. But in there, when you run it, you can tell it how many or what order magnitude filter you want. As the order goes up, you can tap down these humps that appear out here. So, here back to our picture. We can't put the filter in the same place because filter operates on digital sample. So, it doesn't matter if we filter prior to the ADC or we filter after the ADC. If you're going the digital route, if your requirements take you down this path where you have to apply digital filtering. Then the filtering has to happen after the analog to digital conversion takes place. So, here we have our thermistor over here, our divider. We've got our analog mux. Here's where we stuck in the unity gain, op-amp. Be able to drive the low impedance input on the ADD converter or voltage reference and our filter sits on the output. So, we got our cut-off frequency. Introduce a new term, FF sub s is the filter. We call it the FIR filter sample frequency. It's clock rate. We have the, there's one other F of s is the sample frequency that we're taking samples at. So, I think I get to this on the next page. While me see what I wrote actually. Okay. We want these two to be the same frequency. So, we're taking A to D samples. We're feeding them into a digital filter. The digital filter is, but with flip-flops and multipliers and adders, so you want these things to be chunking at the same rate. Every time this thing produces an output, we want those stage it into the input stage set of flip-flops on this filter, so those clock frequencies need to be the same. Bad and weird things will happen if they're not running at the same rate. So, Jimmy and I had a vigorous email conversation about this, so what should these frequencies be? So, if we wanted our cut-off frequency to be a 500 hertz for instance, say that was the requirement. Dr. Nyquist says that we need to be sampling and having our FIR filter sample frequency be at one kilohertz which is 2x, our cut-off frequency. Jimmy said, "Yeah, that's true, but it's not a very good implementation." I've done a lot of this over the years. What you should do if you want a really robust solution and noises are real critical issue for you when you're sensing application. You want your sample frequency and the frequency of your FIR filter be running at 10x or better than your cutoff frequency. In both cases, the cutoff frequency is 500 hertz. Are running our digital filter at one kilohertz here, but he says we really want to be up in the five kilohertz range. That's where we want to be. So, here's one I saved. Let me see if I can create a new one here. So, in this case you can pick low pass or band pass filter, notch filter. Pick what type we wanted for our purposes of low pass filter. I work so great on Sunday. All right, in any event. Point is, whoever reads the manual? Clearly, I should have. It punch all this in, all this information in. You hit next, you hit next. Then it draws this schematic of the filter and gives you a parts list, and shows you the frequency response, which is really handy and saves you a lot of time. To build an analogue one to Cyprus, one does the same thing with digital filters. I thought was pretty slick, so. Jimmy uses this software apps in his class. So, in summary. So, examples of how to calibrate filter sample and validate temperature sensors. This was a key skill that our industry advisory board wants to see in our embedded system engineering graduates, so important there. For more in-depth learning, take Jimmy's way. I never say his name. It's why I haves courses.