Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working implementation of a Biquad filter for the fixed-point CPU of the ESP8266 #370

Merged
merged 1 commit into from
Feb 13, 2021

Conversation

wberube
Copy link
Contributor

@wberube wberube commented Feb 11, 2021

Based off the work of Nigel Redmon (http://www.earlevel.com/main/2012/11/26/biquad-c-source-code/), seems to work A1 with my setup, though it might need some polishing to lower the resources needed for operation. I am currently dividing by two the input sample value to avoid any clipping, but I'm looking for a cleaner solution to this as well!

I have a webradio player build around TFT_eSPI, an ST7735 (128x160 LCD), a rotary encoder and a WeMos D1 Mini for testing, and it crashes after I add a second Biquad filter in the audio pipeline. Is this CPU or RAM-related, that's what I am wondering!
149175496_938572560013674_4938067597051380920_n

@earlephilhower
Copy link
Owner

Very nice PR, thanks. I'm not sure you need 64-bits for the actual computation, but the little extra math involved probably isn't a big deal compared to the rest of the decode pipeline.

As to your problem, I don't see anything in this specific object which could cause memory corruption (no allocations, no array indexing). You may want to look at the host emulation part of the library, thanks to @d-a-v, which can let you run your code on the PC and use tools like valgrind to check for memory issues.

@wberube
Copy link
Contributor Author

wberube commented Feb 11, 2021

Thanks a lot for your time, that's really appreciated! I would also like to warmly thank you for ESP8266Audio. Audio codecs have became a true hobby to me for at least the past two years thanks to your project!

I have more of an integrator than a programmer from my studies, so the code has great chances of having room for optimization, I'll trying pushing updates on my repository as I am making changes and keep this pull request up to date. And I'm taking good note of the emulation part, this could surely help me a lot in the future!

@earlephilhower earlephilhower merged commit 714e8cf into earlephilhower:master Feb 13, 2021
@wberube wberube deleted the biquad branch February 15, 2021 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants