Programmable digital knock filter?

Ecu Hardware Modifications
User avatar
pman92
Posts: 667
Joined: Thu May 03, 2012 12:50 pm
Location: Castlemaine, Vic

Re: Programmable digital knock filter?

Post by pman92 »

vlad01 wrote: Mon Jun 08, 2026 11:50 pm I tired a few free PCB programs over the years and never got my head around them enough to do anything useful.
I find DipTrace intuitive and easy to use once you get used to it.
But haven't really used much else to compare with
User avatar
vlad01
Posts: 8548
Joined: Mon Oct 08, 2012 8:41 am
cars: VP I S
VP I executive
VP II executive
VP II executive #2
Location: Kyneton, Vic

Re: Programmable digital knock filter?

Post by vlad01 »

That's literally what I have on my old desktop, never really got the hang of it, I did make some basic boards on there, but never good enough to send out for production. Something like this knock filter is 10x more complex than I ever achieved on diptrace.

The one thing I recall being super easy and useful on DXP 2004 was the component creator tool, I used it a lot as at the time, multi die LEDs and many new SMD components were rapidly becoming a new thing in the consumer market and most of the libraries didn't have the right footprints for a few of them.


Anyway, in relation to what Ant said about using a newer CPU, I keep hearings lots of good about the teensy MCUs
Not the cheapest, but specs and features suggest that it probably more than capable of doing all of the audio processing work of the desecrate knock processing IC and it has USB comms and what not all built in.

https://www.pjrc.com/teensy/
User avatar
vlad01
Posts: 8548
Joined: Mon Oct 08, 2012 8:41 am
cars: VP I S
VP I executive
VP II executive
VP II executive #2
Location: Kyneton, Vic

Re: Programmable digital knock filter?

Post by vlad01 »

Found some interesting stuff on the audio processing side of things on the teensy. Looks to have a fair bit of audio processing and analysis capability.

https://www.pjrc.com/teensy/td_libs_Audio.html

Maybe using something like the FFT features would be useful to more definitively pick out knock than just simple filters.

Google seems to suggest using FFT is a good way about it.
Screenshot 2026-06-09 at 17-29-49 using fft to analyze audio from knock sensor to pick out knock on engine - Google Search.png
You do not have the required permissions to view the files attached to this post.
User avatar
antus
Site Admin
Posts: 10012
Joined: Sat Feb 28, 2009 10:34 am
cars: TX Gemini 2L Twincam 8psi
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Subaru WRX 2007

Re: Programmable digital knock filter?

Post by antus »

If you have the CPU power to do an FFT filter in software go for it. The knock will be brief, you'll need confidence that you wont miss knock events if you sample then stop sampling and process then go again. Other option is the analog method to do the bandpass in hardware, then just look for peaks in the analog signal that makes it through which is what earlier designs with limited CPU do.
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
User avatar
vlad01
Posts: 8548
Joined: Mon Oct 08, 2012 8:41 am
cars: VP I S
VP I executive
VP II executive
VP II executive #2
Location: Kyneton, Vic

Re: Programmable digital knock filter?

Post by vlad01 »

The teensy 4.x looks to be pretty powerful. Use cases specify automotive ECU applications, the DSP is apparently built in hardware.
The development board is indeed teensy, only 17x35 mm~, with the chip being far smaller than that. So in theory, it could be made in the same footprint as the factory knock filter and maybe even have a vertical micro usb or at least a header in the memcal viewing window so it can be accessed with the memcal cover installed for neatness.
Screenshot 2026-06-10 at 17-48-26 ARM Cortex-M7 - Google Search.png
You do not have the required permissions to view the files attached to this post.
User avatar
antus
Site Admin
Posts: 10012
Joined: Sat Feb 28, 2009 10:34 am
cars: TX Gemini 2L Twincam 8psi
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Subaru WRX 2007

Re: Programmable digital knock filter?

Post by antus »

Teensy are expensive (and quality). You're probably better off with an ESP or an ST of some sort if you are looking to make something. Then you are in the couple of dollars territory. But the quality and speed of the ADC will matter.

Something like the stm32f103c8t6 is what I would be considering. Less than $10 (maybe $3.50? if it works...) for a board from ebay. And from a 2 second search I see people talking about precision and calibration of the ADC which immediately makes me trust it more than an esp.

https://community.st.com/stm32-mcus-pro ... 8t6-118255
https://www.st.com/resource/en/applicat ... ronics.pdf
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396