+ Post New Thread
Results 1 to 12 of 12

8th September 2016, 15:48 #1
 Join Date
 Apr 2011
 Posts
 550
 Helped
 24 / 24
 Points
 4,099
 Level
 15
How can I create a digital filter in practice?
I have created and "experienced" analogue filters made using passive components and opamps. I also created a 6th order buuterworth low pass filter using OPA series opamps. It was immense fun.
I now want to create digital filter and by doing so experience and understand how digital filter creation works and see one in practice (havne't done so in life yet :( ).
Lets take an example. I want to create a LPF with 40kHz cutoff frequency. Now I decide to create it using FIR filter topology. Where do I go next?

Advertisement

8th September 2016, 16:40 #2
 Join Date
 Nov 2006
 Location
 Brazil
 Posts
 8,858
 Helped
 1114 / 1114
 Points
 29,619
 Level
 41
 Blog Entries
 9
Re: How can I create a digital filter in practice?
Nowardays, except if the goal is to learn the concept step by step, we no longer have to deal with the theory behind how this is done to implement digital filters in practice, but we just insert the performance parameters in one of the available online tools on the web and take the C code there, ready to use. The main thing you need to know is that the sampling frequency must be exactly the same with which the filter will work, once it was considered when its parameters were calculated.

Part of the world that you live in, You are the part that you're giving ( Renaissance )
1 members found this post helpful.

14th September 2016, 16:11 #3
 Join Date
 Apr 2011
 Posts
 550
 Helped
 24 / 24
 Points
 4,099
 Level
 15
Re: How can I create a digital filter in practice?
Actually the goal in my case actually is to experience the process step by step

Advertisement

14th September 2016, 16:20 #4
 Join Date
 Nov 2006
 Location
 Brazil
 Posts
 8,858
 Helped
 1114 / 1114
 Points
 29,619
 Level
 41
 Blog Entries
 9
Re: How can I create a digital filter in practice?
I think that MATLAB/Scilab are nice tools to get you introduced to the funamentals.
There are a lot of functions, aswell toolboxes related to that subject there.
Anyway, this don't release you from reading online tutorials covering the subject in deep.
Part of the world that you live in, You are the part that you're giving ( Renaissance )

Advertisement

14th September 2016, 20:46 #5
Re: How can I create a digital filter in practice?
There are two types of digital filters. So start by googling two terms:
Finite Impulse Response filters. Also called nonrecursive filters.
Infinite Impulse Response filters. Also called recursive filters.
But before you do that............are you familiar with sampling theory, aliasing and the Ztransform?My batteries are recharged by "Helpful Post" ratings.
If you feel that I've helped you, please indicate it as a Helpful Post

15th September 2016, 00:02 #6
Awards:
 Join Date
 Apr 2014
 Posts
 15,729
 Helped
 3586 / 3586
 Points
 77,645
 Level
 67
Re: How can I create a digital filter in practice?
Hi,
Before you can use a digital filter, you need digital data.
Where do you get it from?
Do you use an ADC? Are there analog filters used, or oversampling...maybe undersampling...
What data rate, what bit width?
And what after the filter?
Do you know about biquads? If not, then read about them.
*******
Digital filters are everywhere. Sometimes you don't recognize them as filters.
Audio, delay, echo, sound.....
Oversampling in an UART. Debouncing of digital inputs. Averaging of any values. PID regulation loops.
Changing brightness, contrast, or anything other in a picture
Once you know how they work you will use them many times..
Klaus

15th September 2016, 03:05 #7
 Join Date
 Feb 2014
 Posts
 824
 Helped
 271 / 271
 Points
 5,789
 Level
 18
Re: How can I create a digital filter in practice?
An analog LPF is equivalent to a digital IIR filter. In some ways it may be easier to start there. Here is a specific example of a single pole digital RC filter equivalent:
y = a*x[n] + (1a)*y[n1]
Or in words: [next output] = a*[incoming sample] + (1a) * [previous output]
Where a is a constant ranging from 01 that sets your time constant:
Tc = RC = [clock period]*(1a)/a
You can see that if a is small the impact of the incoming sample is small compared to the previous state, this creates a low cutoff frequency.
As other people have said in regards to your original question there are many types of digital filters. Even a simple average is a form of FIR filter. It's a very deep subject but it's not hard to get a grasp on some of the pieces.
1 members found this post helpful.

15th September 2016, 13:46 #8
 Join Date
 Apr 2011
 Posts
 550
 Helped
 24 / 24
 Points
 4,099
 Level
 15
Re: How can I create a digital filter in practice?
asdf44, I am confused when looking into DSP books. They talk of Fourier Series, Fourier Transform then FFT and then go into filters and filters are of FIR and IIR type and then there are so many topologies and then there are these enigmatic things called windows and then there are so many ways to design filters so so so many ways. I am lost.
I took a dip but getting no where I posted this question.

15th September 2016, 14:08 #9
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 45,436
 Helped
 13823 / 13823
 Points
 260,175
 Level
 100
Re: How can I create a digital filter in practice?
They talk of Fourier Series, Fourier Transform then FFT and then go into filters and filters are of FIR and IIR type and then there are so many topologies and then there are these enigmatic things called windows
asdf44 however suggests a simple problem to start with, designing the digital equivalent of a first order analog filter. Try to follow his considerations, simulate the behavior of the simple filter with pencil and paper method or in a spreadsheet calculator. If you see how it works, you may continue with second order IIR. Or small FIR.

15th September 2016, 14:39 #10
 Join Date
 Feb 2014
 Posts
 824
 Helped
 271 / 271
 Points
 5,789
 Level
 18
Re: How can I create a digital filter in practice?
Yes well it's a very deep subject. So that's to be expected.
If you want more help it would be useful to know what platform and application you have in mind. For example FIR, which you cited tend to be computationally more intensive and tend to add time delay. So you're less likely to find them on microcontrollers or FPGAs in many common realtime applications.
Second your strategy should be to become familiar with one type of filter and one implementation and learn a set of tools to manipulate that. If we know the application we can point you to examples for that.
When I was starting I got a lot of use out of PSIM which is a spicelike circuit simulator that also crosses over into control and signal processing. They have a free version.
When I started I literally dropped down an R and C in PSIM. Then I put their single pole filter block next to that and verified it was the same. Then an Sdomain block (after calculating the coefficients). Then a zdomain IIR block. Then I constructed my own IIR implementation with discrete additions and multiplies. Having that progression all in one place was extremely useful and no single step was particularly large.

15th September 2016, 18:33 #11
Re: How can I create a digital filter in practice?
Yes, digital filter theory can be quite deep.
That is the reason that myself and other posters have stated, you must be thoroughly acquainted with sampling theory, and be comfortable with the equations required to express the signals and systems used in the sampled domain.
Many years ago, I was introduced to the subject by a book called "DSP without tears" if I remember the title correctly.
It provided a basic overview which allowed one to become conversant with sampled systems. It also came with a 5 1/4" floppy, which would install a simple DOSbased program, which would allow you to actually write and evaluate different DSP functions.
Once that you master it, you can then plunge deep into the heavy stuff.
But the real thrill is when one actually writes some simple code, feeds it into an actual evaluation board and watching it to work. I can still remember the elation of creating a simple, low tap count FIR low pass filter. Then speaking to a microphone, and listening to the change in the response on a speaker!!!My batteries are recharged by "Helpful Post" ratings.
If you feel that I've helped you, please indicate it as a Helpful Post
1 members found this post helpful.

Advertisement

15th September 2016, 20:44 #12
 Join Date
 Jun 2008
 Posts
 116
 Helped
 2 / 2
 Points
 2,527
 Level
 11
Re: How can I create a digital filter in practice?
Hi,
You can use Mathlab digital filter package. Result will be better if you familiar with filter theory. However reviewing help and examples you can achieve appropriated result as well
Thank you
1 members found this post helpful.
+ Post New Thread
Please login