At the bottom, you’ll see that it took 7 taps and the actual ripple figures achieved. The “desired #taps” box should already say “minimum” and that’s almost always what you want unless you are trying to hit a lesser number of taps.Ĭhange the 400 Hz “to” frequency to 100 Hz and press the big red button marked “DESIGN FILTER.” You’ll see seven numbers to the right along with a graph of the filter response. Since the sample rate is 2 kHz, it doesn’t make sense to go past half of that. There’s also a stopband of 500 Hz to 1000 Hz. You’ll wind up with a stock low pass filter that has unity gain at up to 400 Hz and allows 5dB of ripple. The page might ask your permission to continue. You can add passbands or stopbands to the table at the bottom left, but instead, just pick “Low Pass” from the “predefined” dropdown. I’m going to keep the sampling rate low to make our spreadsheets more manageable. The first thing to pick is the sampling frequency. Open the t-filter web site and move to the bottom of the screen. There are plenty of programs that can compute taps and at least one neat web site called t-filter. However, there’s a simple practical answer: ask the computer to solve it for us. Turns out that’s an article all by itself. The other thing is where do we get the value of the taps? One is, a real filter is going to have a lot more taps. To run the calculation you skip over the first two time points (this calculation must have three data points) and start calculating with the third value: FILTERED=DATA*TAPS+DATA*TAPS+DATA*TAPS These values are stored in an array called TAPS and are used along with another array called DATA. The more taps you have, the better filter you can make.Īs a stupid example, suppose you had data and you had 3 taps of values: 1.1, -0.035, 0.336. The weights are known as taps and they are just numbers. The idea is to take a bunch of weights, multiply your data by the weights, and then sum it up. There are plenty of ways to explain it, but here’s the thing: making one is dead simple. About FIRįIR stands for finite impulse response and it is a type of digital filter that might seem like magic. There are several kinds of filters we can have and this post is about the FIR filter. However, for just about any signal processing job we want to do we’ll need filters. By necessity, we need to learn a bit about generating signals mathematically, but since that’s fairly easy, I’m going to put off the details for a future installment. You probably won’t get a lot of practical use out of this - although if you were logging data from a sensor into a spreadsheet and wanted to filter the readings, this might be your go-to technique. This is the first of a series about developing intuition and understanding of signal processing using - mostly - spreadsheets. Of course, if you had a spreadsheet of data from an instrument, this same technique would work, too. In this article I’m going to use Google Sheets - although you could do the same tricks in just about any spreadsheet - to generate some data and apply a finite impulse response (FIR) filter to it. ![]() ![]() In fact, I often do little circuit design spreadsheets or even digital design because it forces me to create a mathematical model which, in turn, helps me understand what’s really going on. Sometimes it is easier to build something in a spreadsheet. But these all have some learning curve and often use clever tricks, abstractions, or library calls to obscure what’s really happening. But if I build something or write some code, I’m more likely to understand how it works and why.Ĭircuit simulation and software workbooks like Matlab and Jupyter are great for being able to build things without a lot of overhead. I’m guilty of this in a big way - I was never much on classroom learning. There’s an old saying: Tell me and I forget, teach me and I may remember, involve me and I learn.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |