Pitfalls in filter design
Pitfalls in filter design
(OP)
So this is my first stab at designing and building a bandpass filter. TI has a filter building tool that determines component values. I am creating a 4-pole Chebyshev band-pass filter with a uni-polar power supply (5 volts) and a LM324 as the op amp.
How spot on do I have to be with component tolerances? It is easy and cost effective enough to get 1% resistors. The capacitors are a little harder. Will a 5% tolerance be fine for the filter?

How spot on do I have to be with component tolerances? It is easy and cost effective enough to get 1% resistors. The capacitors are a little harder. Will a 5% tolerance be fine for the filter?






RE: Pitfalls in filter design
RE: Pitfalls in filter design
RE: Pitfalls in filter design
----------------------------------
If we learn from our mistakes I'm getting a great education!
RE: Pitfalls in filter design
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Pitfalls in filter design
Is this signal for time-domain signals or frequency-domain signals (yes, it does matter). Chebyshev filters have amazing frequency response, but you may not recognize the signal that comes out the other end due to the phase response (although this is typically more for low pass filters).
"easier said than done" - other tools from other manufacturers (Linear Tech, Analog Devices) may make that easier (although it really isn't that hard). Are you familiar with four-corners testing?
John D
RE: Pitfalls in filter design
The bandpass of the filter is 5.0 kHz to 6.4 kHz. I am looking at a knock signal of an engine. I am using the filter to only look at the knock signal and filter out all the other noise not in the bandpass region. I am looking at the amplitude of the knock so phase and time delay won't be a factor. Since I have never designed this complicated a filter before, I was asking for some pointers in regards to component choice and tolerance.
Here is a spectrograph of the engine knock
Here is a spectrograph of the engine knock with a digital fitler
RE: Pitfalls in filter design
Can you explain the 'beating' across the time domain? the amplitude appear to be pulsing about 5 times per division, or at about 25 Hz.
Do you hear a 5-6.4 KHz whine and that is why you say it has this bandwidth? If that pulses then the lower end of your spectrum is much lower, and you won't accurately measure the pulses unless your filter bandwidth includes 1/period of the pulse duration (25 Hz?).
and if that's the case,
"I am looking at the amplitude of the knock so phase and time delay won't be a factor." - yes they will. Unless your knock signal is a pure sinewave you need linear phase across your filter or all the harmonics needed to create your signal will show up at the wrong time and thus won't add up properly and your signal will come out of the filter severely distorted (i.e. a very different amplitude). A high order Butterworth filter is your best bet for passing a pulse.
Does your scope have an FFT function (most do these days, and the latest firmware upgrade for the TEK TDS family now includes it as a standard feature)? That might give you a better view of your required bandwidth.
John D
RE: Pitfalls in filter design
I based the design of the filter on this equation.
Knock Frequency (in kHz) = 1800 / (pi * d) where d = piston diameter
The test engine is a 4 cylinder and has 100 mm pistons so 5.73 kHz is the calculated frequency. If you look at the unfiltered plot, there is always some "knock energy" present around that frequency. As for the other bands of frequencies, I don't care about them getting filtered out.
In the bandpass region of the filter the engine is relatively quite, so that was another reason to design a filter in that region.
There was an additional 30 dB added to the digital filter to get more "filtering" onto the signal.
The beating across the time domain of the plot is certain combustion events within the engine. The knock sensor is physically located closer to one of the pistons (H4 engine design). This test was at ~3000 RPMs or 50 RPS. There are 2 ignition events for each revolution or 100 sparks per second. The knock detector is picking up every forth combustion event.
I chose a Chebyshev filter because of it's steep rolloff. I am only interested in those peaks in the 5.0 to 6.4 kHz range.
Here is a plot for the above Chebyshev filter
Here is a plot for the Butterworth filter
So the phase change is the same for both filters. There is about 200 µs of delay in the Butterworth and ~300 µs of delay in the Chebyshev. With the knock events spaced apart at 10 ms apart (6000 RPM), I don't believe that 100 µs would mess up the knock signal in the bandpass that much between the two filters.
Here is a spectral plot of the engine with no knock, the engine is ramped up from 3000 to about 5500 RPMs.
RE: Pitfalls in filter design
Dan - Owner

http://www.Hi-TecDesigns.com
RE: Pitfalls in filter design
I have a text back from my university days which describes how to choose the optimum component values to achive the lowest possible sensitivity to tolerances. With the MFB type of filters, you can always achive sensitivities below 1, meaning that if a resistor is 1% out of tolerance, the effect on Wo, Ho and Q is lower than 1%.
I can mail you a scan, if you like.
Regards,
Benta.
RE: Pitfalls in filter design
RE: Pitfalls in filter design
Interesting. Makes sense once I thought about it as bore size would affect resonant frequency just like a pipe organ (you'd think after looking at details for Helmholtz resonators in exhausts I would have made the connection).
Dan - Owner

http://www.Hi-TecDesigns.com
RE: Pitfalls in filter design
Playing with the FilterPro and knowing the spectrograph, would using a narrow bandpass filter at 5.9k be a better choice? Here is a two pole narrow bandpass filter with a Q of 5. Simpler circuit, repeat of components, steep attenuation outside the frequency of interest.
*Replace the earth symbol with 2.5 V
RE: Pitfalls in filter design
I misspoke - both Chebyshev and Butterworth filters have odd phase responses; only Bessel filters have flat group delay. From "RF Circuit Design" by Bowick:
"Chebyshev and Butterworth filters have extremely non-linear phase response over the filter's passband. This phase nonlinearity results in distortion of wideband signals (i.e. pulses) due to the widely varying time delays associated with the different spectral components (i.e. harmonics) of the signal. Bessel filters... with their maximially flat (constant) group delay are able to pass wideband signals with a minimum of distortion."
So if you are really only interested in the fundamental frequency then this may be a moot point.
As you already have your spectrograph, can you process the data with a digital filter? A lot of the tools have a nice setup where it is only a few button clicks to select your filter type and order. That lets you try a lot of different filter settings quickly, as long as your A/D can handle the unfiltered bandwidth.
John D
RE: Pitfalls in filter design
Low RPM no knock
Max RPM no knock
Light knock
Heavy knock
So if I am looking for engine knock at low RPMs, it should be pretty easy to find it at 5900 Hz. At max RPMs it may tricky to pick out a light knock. It appears that a narrow bandpass filter should fit the ticket. Anything wrong with using a narrow filter?
RE: Pitfalls in filter design
I also wonder why your 5.9 kHz has no higher harmonics.
Have you looked at how commercail knock sensors are made?
Benta.
RE: Pitfalls in filter design
RE: Pitfalls in filter design
Dan - Owner

http://www.Hi-TecDesigns.com
RE: Pitfalls in filter design
RE: Pitfalls in filter design
Here is frequency response of the output of the circuit. Engine speed varied from 2500 PRM to 6000 RPM.
Here is a snapshot at 2500 RPM
Here is a snapshot at 6000 RPM
So the notch filter is doing its job. There is some DC and low frequency getting through. The circuit when added to a compare op-amp and 555 timer will trigger when there is an engine knock.
The next "thing" to go after is the compare op-amp. Right now I am comparing engine knock "loudness" to a fixed value. It would be better to compare to relative engine noise. I am not sure on how to quantify the variable spectrum of the sound of the engine into a single value.
RE: Pitfalls in filter design
John D
RE: Pitfalls in filter design
I designed the knock circuit for an after market engine management system (UTEC) for the WRX.