Audio EQ Software Implementation (STM32) - Phil's Lab #89

  Рет қаралды 33,397

Phil’s Lab

Phil’s Lab

Күн бұрын

Peaking filter theory and real-time implementation on an STM32 microcontroller. Useful for audio equalizers (EQ) and situations where frequency response adjustments are required. PCBs by PCBWay www.pcbway.com
[SUPPORT]
Free trial of Altium Designer: www.altium.com/yt/philslab
PCBs manufactured and assembled by PCBWay: www.pcbway.com
Tag-Connect: www.tag-connect.com/solutions...
Patreon: / phils94
Mixed-signal hardware design course: phils-lab-shop.fedevel.education
Advanced Hardware Design Course Survey
forms.gle/X4jwvtZeJ1jTXh7r9
[GIT]
github.com/pms67
[TIMESTAMPS]
00:00 Introduction
01:19 Hardware Overview + Tag-Connect
03:15 Altium Designer Free Trial
03:37 PCBWay
04:01 Peaking Equaliser Filter Basics
06:59 Transfer Function (Analogue Prototype)
09:12 Matlab Demo (Varying Parameters)
10:56 Discretisation (Analogue to Digital)
13:23 Filter Difference Equation
14:24 Filter Coefficients
15:19 Pre-Warping
16:41 Implementation Tips
18:03 Software Implementation (STM32)
25:08 Test Set-Up
26:17 Frequency Response Tests (Varying Parameters)
28:56 Audio Demo
29:13 Outro

Пікірлер: 102
@Thats_Mr_Random_Person_to_you
@Thats_Mr_Random_Person_to_you Жыл бұрын
Is there NO topic/discussion you don't know?!? Putting theory into practice is always the most interesting as it actually allows people to USE the knowledge. Ps. New Patreon just as a way to help support more free educational content!
@PhilsLab
@PhilsLab Жыл бұрын
Haha thanks, but there are definitely many things I have no clue about. Thank you very much for your support!
@UncleWalter1
@UncleWalter1 Жыл бұрын
This is exactly what I've been looking for for ages. Everyone's always talking about lowpass and hipass filters and SOMETIMES shelving filters. But specifically I've been struggling to get my head around digiital peak filters and this has helped a lot. I'm going to try and implement this in Rust and see how I go. Thanks, Phil! You're a gem!
@PhilsLab
@PhilsLab Жыл бұрын
Thanks you! Glad to hear it's been helpful - do let me know how your Rust implementation works out :)
@isaacclark9825
@isaacclark9825 Жыл бұрын
Yes. More great content!! The pace that you turn out videos is simply amazing!
@PhilsLab
@PhilsLab Жыл бұрын
Thanks a lot, Isaac!
@anuragmahajan5919
@anuragmahajan5919 Жыл бұрын
Great video and thanks for making one! In grad school they didn't teach us practical implementations of the filters only the theory.
@PCBWay
@PCBWay Жыл бұрын
Happy new year, Phil🌆🌇! Thanks a ton for these fantastic jobs you did in the past year! Together let's do something bigggerrr in the new 2023! 🤩🤩
@PhilsLab
@PhilsLab Жыл бұрын
Happy new year to everyone at PCBWay! Thank you very much for your support - looking forward to everything to come in 2023 :)
@PCBWay
@PCBWay Жыл бұрын
@@PhilsLab 🥂🥂
@R2AUK
@R2AUK 9 ай бұрын
Thanks for the video. It worth mentioning that one multiplication per IIR filter output can be saved as well by multiplying a0..a2 and b1..b2 by 1/b0.
@Andy-ph1qj
@Andy-ph1qj Жыл бұрын
I look forward to every video about DSP and implementation on a microcontroller. Thx Phil and happy holidays!
@PhilsLab
@PhilsLab Жыл бұрын
Thank you, Andy - happy holidays!
@nielspaulin2647
@nielspaulin2647 Жыл бұрын
Wit many years as an (IT) university lecturer, My big compliments to you! Thanks a lot.
@PhilsLab
@PhilsLab Жыл бұрын
Thank you very much, Niels!
@kewalnaik7002
@kewalnaik7002 Жыл бұрын
Hi Phil, Great video. Thanks for sharing such important tips.
@PhilsLab
@PhilsLab Жыл бұрын
Thanks for watching, Kewal!
@_a_x_s_
@_a_x_s_ Жыл бұрын
Wow, I need to pick up my knowledge of DSP. I was quite good at it before but forgot it after nearly 2 or 3 years. Your video gives me some inspiration not only for my own interest but also my job. ❤
@PhilsLab
@PhilsLab Жыл бұрын
Very glad to hear that - thank you!
@carstenneuhaus6090
@carstenneuhaus6090 29 күн бұрын
great work and super explained!
@andrew2004sydney
@andrew2004sydney Жыл бұрын
THANK YOU! This is an awesome video. You are a master!
@1over137
@1over137 Жыл бұрын
A few things I can share now. An STM32H743 @ 480Mhz will process a single sample (or a stereo pair) through 7 or 8 of these filters in realtime with no buffers. No DMA either. Just interrupts on the FIFO fill levels. When a stereo pair is available on the input it's moved to a holding buffer. When room for a stereo pair is available in the output FIFO you can process the holding buffer through the EQ filters and write it to the output. When -O3 or -Ofast is applied at build time 7 or 8 filters are possible at 16bit (extended) 96kHz. This technique with the holding buffer effectively makes the system an inherent "resampler" or asynchronous "reclocker" and will happily cross sample rates and with a little work bit depths. Do note.... you need a struct/filter per stereo channel or they will cross talk. I have 14 filters currently, 7 left, 7 right. Subject to further testing.... I actually want to try for 2 separate EQs with 5 bands each at 48kHz. I don't need 96kHz.
@1over137
@1over137 Жыл бұрын
Out of interest... The Rx and Tx portion of the code is so minute in terms of "time" you can easily, receive as many I2S/SAI Rx streams as you want, mix them together and write them to as many out puts as you like. 99% of the processing is the EQ.
@petergagliano3756
@petergagliano3756 Жыл бұрын
Great content as always Phil!
@PhilsLab
@PhilsLab Жыл бұрын
Thanks, Pietro :)
@bartek153
@bartek153 Жыл бұрын
Beautifully presented Phil. This takes me back to uni times..:D Nicely done!
@PhilsLab
@PhilsLab Жыл бұрын
Thank you, Bart!
@myetis1990
@myetis1990 Жыл бұрын
great job Phil! step by step towards making a tiny spectrum analyzer :)
@maxhouseman3129
@maxhouseman3129 Жыл бұрын
Thanks! I implemented such a filter once at an fpga, in C it looks much simpler. Reminds me of my signal processing course in study.
@PhilsLab
@PhilsLab Жыл бұрын
Yeah, definitely a lot easier implementing this in C on an MCU!
@pantelisEVs
@pantelisEVs Жыл бұрын
Hope you're doing well Phil! Happy holidays and thanks for the Vid!
@PhilsLab
@PhilsLab Жыл бұрын
Thank you, happy holidays!
@1over137
@1over137 Жыл бұрын
Thanks Phil. This is what I was after. It is a real struggle learning this stuff. It took me a while to even realise there are two parts. Calculating the coeffients and then using those to process the samples. It was the former part that I kept finding people pre-calculating them and storing them in big binary tables, very frustrating. I got myself an STM32H743 (like hens teeth in december). Hopefully I can implement these peak filters their easily enough. 3 Peak + 2 Shelf should be fine. Other than receiving 4 or 5 stereo I2S payloads over SPI, mixing them together (add) and running said EQ filters... I think I'll be fine at 480Mhz even without going the next step of optimising it into BiQuads for the ARM DSP extensions. If I could get it to mix and EQ 2 sets of channels it would save me another MCU in parallel.
@SquadQuiz
@SquadQuiz Жыл бұрын
Thanks for your videos Phil's, this gives me the inspiration to make my own digital pedal box :D
@PhilsLab
@PhilsLab Жыл бұрын
Thanks for watching, glad to hear that! :)
@bryanst.martin7134
@bryanst.martin7134 Жыл бұрын
"Dammit Mate!" I'm going to have to do some upgrading to my acoustic science! 3 decades later, it has improved, and I haven't kept up. It seems my best bet is digging into your channel and improve my odds. ;-) Did get a bunch 1st visit.
@a.villegas3414
@a.villegas3414 Жыл бұрын
You're genius! Amazing video as always
@PhilsLab
@PhilsLab Жыл бұрын
Thank you very much!
@uav.project8022
@uav.project8022 Жыл бұрын
Great topic and video
@PhilsLab
@PhilsLab Жыл бұрын
Thank you!
@paulemi2709
@paulemi2709 Жыл бұрын
With appropiate values in cascade you could use this to enhance the sound on headphones based on measurements with rigs like the ones from oratory1990.
@imoldovan
@imoldovan Жыл бұрын
Good stuff... Happy New Year!!!
@PhilsLab
@PhilsLab Жыл бұрын
Thanks, John!
@piotrcurious1131
@piotrcurious1131 Жыл бұрын
Take a look into quadrature mirror filters. They use wavelets instead of fft, and so they eliminate problems with unpredictable phase shifts, resonance and ringing. Also much faster on STM32.
@ekenedilichukwuekeh4647
@ekenedilichukwuekeh4647 Жыл бұрын
“Watch video no. 78”. I just think numbering your vids is great in cases like this
@mrlazda
@mrlazda Жыл бұрын
If someone want only end formulas and is not interested how to get it for different audio EQ (Biquad Filter Formula) then there is Audio-EQ-Cookbook.
@arlenalem
@arlenalem Жыл бұрын
Could you recommend a book about how the formulas was obtained and more theory?
@hansdietrich83
@hansdietrich83 Жыл бұрын
I know this ins't the topic of this video, but ARM offers many math and DSP libraries that are optimized for the ARM Coretex Hardware under the CMSIS name. The also have complete filter implementations
@FeyzSHB
@FeyzSHB Жыл бұрын
Hey Phil, amazing video as always. Do you plan to do a macropad using an STM32 in future? Would be very interesting! PS: I wish you and your family a happy & healthy new year
@PhilsLab
@PhilsLab Жыл бұрын
Happy new year! I'm afraid I don't have anything planned in that area - but who knows what 2023 will bring!
@sarbog1
@sarbog1 Жыл бұрын
Very Cool!
@PhilsLab
@PhilsLab Жыл бұрын
Thanks, Stephen!
@DJ_norenome
@DJ_norenome Жыл бұрын
Thank you for the mixed signal fedevel course. It helped me create a first prototype PCB. Quick question: How did you implement the drivers for CS4270 codec? Did you write it from scratch using experience and the spec sheet, or did you find it someplace (ie. linux kernel). A tutorial on CODEC drivers would be greatly appreciated.
@nistakmahmud
@nistakmahmud Жыл бұрын
You're awesome
@PhilsLab
@PhilsLab Жыл бұрын
Thanks, Nistak :)
@eleclab4244
@eleclab4244 Жыл бұрын
Niceeeeeeeeeeeee! I love it!
@PhilsLab
@PhilsLab Жыл бұрын
Thanks!
@Pellemolle
@Pellemolle Жыл бұрын
Very interesting! How much of the CPU's capacity does the filter use at the sample rate you're using?
@guruG509
@guruG509 Жыл бұрын
A video on quaternions and madgwick filter would be cool
@PhilsLab
@PhilsLab Жыл бұрын
I'll definitely cover quaternions at some point. Madgwick filter I haven't really had a use for for now I'm afraid, EKF did all I needed.
@Cracked1ce
@Cracked1ce Жыл бұрын
While I agree tag connect is cool. It takes up a large amount of board space which goes for top, bottom, and interior of the board.
@km-electronics1
@km-electronics1 Жыл бұрын
Checkout the legless version. It's much more space saving.
@davidkleng1711
@davidkleng1711 Жыл бұрын
Hi Phil, amazing video. Do you have any video where do you use the external qspi flash to programm the code in?
@PhilsLab
@PhilsLab Жыл бұрын
Thanks, David. That's on my list of videos to make for 2023 - I'm afraid I can't guarantee when that'll come out though.
@davidkleng1711
@davidkleng1711 Жыл бұрын
@@PhilsLab that’s great! I watch all your videos anyway so I will be waiting for it! Thanks a lot for the good content
@greenberet84
@greenberet84 Жыл бұрын
Greetings!! Love your channel! :) any course recommendations about filter design (especially for RF), poles and zeros, transfer functions etc?
@arneg0
@arneg0 Жыл бұрын
Hey Phil, thanks for all the content and good videos. Is there a way to have links to the instruments used for the tests or possibly a guide to make the PCB so we can replicate what is taught? That would be cool...
@PhilsLab
@PhilsLab Жыл бұрын
Thanks! I'll put a link to the Digilent Analog Discovery Pro on the description. If you check my Git repo, there are some DSP board design files available. Also, the YT vids + course should help to design your own board if you wish.
@martinmeijerman4131
@martinmeijerman4131 Жыл бұрын
This is a great video! When you are cascading multiple filters thereby feeding the output of one set of calculations into the next, float calculation might introduce inaccuracies quickly. Would it be an idea to use doubles instead of floats? The STM32H7 can do double precision floating point calculations in hardware. Could be a nice comparison between the filters in float and double (next video? :-)). To be Nit-picky, math.h should have been included in the c-file instead of the header since users of the filter will not be using math.h only the implementation does... Keep up the good work!!!
@davidkclayton
@davidkclayton Жыл бұрын
I accomplish the same thing using op-amps, the difficulty for me is sourcing the multi gang pots.
@tcfween
@tcfween Жыл бұрын
This video is excellent for me, thank you! As a tech-interested musician, you just opened up a whole new field of understanding for me. Are you familiar with Dan Worrall's channel? It was him who brought me to the border of this new understanding and I can't help but wonder what would happen if you two collaborated. Thanks again for all the well-presented info. BTW, sweet Charvel, bro!
@bryanst.martin7134
@bryanst.martin7134 Жыл бұрын
Tech interested musician? Ever heard the LP of Lou Reid's Metal Machine Music? If so, tell me how it ends. ;-)
@PhilsLab
@PhilsLab Жыл бұрын
Thanks, Christopher - very glad to hear that! Haven't seen Dan's videos before but will check him out. The Charvel is rather nice - a limited custom shop run of only ~86 in the world, so I had to get one :D
@arlenalem
@arlenalem Жыл бұрын
Thanks a lot Phil, your videos are really helpful seriously, I've learnt and I am learning a lot thanks to you. Could please share the source of the theory, I could find the formula in 8:56
@johnadriani7467
@johnadriani7467 Жыл бұрын
amigo how about if you build a line in port to ikea sonos symfonisk lanport adapter so that you can also connect the tv or projector etc. via the line in input
@aeelectronics28
@aeelectronics28 Жыл бұрын
If there is GUI that control stm32 Filter it would be more awesome ❤️still thanks💕
@martinchristiansson658
@martinchristiansson658 Жыл бұрын
Phil, as I understand, there is a push towards using other chipsets that are cheaper and sometimes better due to it is difficult to get your hands on the stm32 line. Will you make a tutorial on others? Like at32 or ck line? How to preogram them, simularities and differenced and so forth? Best Regards, Martin
@koustavdas7775
@koustavdas7775 4 ай бұрын
How to build that physical controller box didi you uploaded that video also
@tonygiguere2495
@tonygiguere2495 Жыл бұрын
Amazing video. Btw would it be possible to use USB-C PD in in an upcoming PCB design of yours? I love the video the helped me with multiple designs keep it up :)
@PhilsLab
@PhilsLab Жыл бұрын
Thanks, Tony. Definitely will be making a USB C PD vid in 2023 :)
@tonygiguere2495
@tonygiguere2495 Жыл бұрын
@@PhilsLab Ok! thank you for the response.
@MikeHudsontek
@MikeHudsontek Жыл бұрын
Hey Phil, do you have any plans to make a course that's focused more on the embedded side of things? I feel it would be a great addition to your existing course
@PhilsLab
@PhilsLab Жыл бұрын
Hey Mike, I'm currently working on an 'advanced hardware design course', which'll cover FPGA and SoC integration. Not sure I'll be making a purely 'embedded-sided' course for now I'm afraid.
@S-MKim
@S-MKim Жыл бұрын
24:32 AUDIO_BUFFER_SIZE: First of all Congraturations on your impressive system. I have a question. It looks like you are using input and output buffers and you are filtering block by block. What is the latency of your system that you normally have?
@imoldovan
@imoldovan Жыл бұрын
What is the delay on this filter>>
@haraldh.9354
@haraldh.9354 Жыл бұрын
amazing but too heavy for me. do you think there is an impact if the power supply is not clean enough??
@sc0or
@sc0or Жыл бұрын
For an electric guitar? I think the worse it is the more options for an unique sound they will get ;)
@PhilsLab
@PhilsLab Жыл бұрын
Thanks, Harald. The power supply design can/will definitely have an impact on noise performance.
@michaelzemah1476
@michaelzemah1476 8 ай бұрын
Can you please, please, please, make a video on how to setup a STM32H7 MCU with I2S as fullduplex and DMA stream ? There are many issues with STM32H7 and its DMA, and the solutions on the internet didnt help me out...
@kdn6827
@kdn6827 Жыл бұрын
Hi Phil, When will be FPGA course available for online purchase? Was saving money since long time for mixed signal course but now I will buy FPGA one. One suggestion, could you offer a bundle of 2 course, such that if one buy FPGA then mixed signals one will get discounted. For people who can't afford both courses.
@theoneandonlyyoko
@theoneandonlyyoko Жыл бұрын
are the boards for sale?
@sc0or
@sc0or Жыл бұрын
It would be interesting you to let us know how much of a CPU capacity every program utilizes pls
@PhilsLab
@PhilsLab Жыл бұрын
Good idea. I'll add that in future DSP vids!
@sc0or
@sc0or Жыл бұрын
@@PhilsLab Thank you!
@Alexmouseuk
@Alexmouseuk Жыл бұрын
Are these source files on Github?
@adityadrs
@adityadrs Жыл бұрын
at 3:49 (kzbin.info/www/bejne/aqCQkJqLndmSjsU) bottom pins of the connectors are not soldered are they??
@bartek153
@bartek153 Жыл бұрын
Sorry to ask on here but does you email work alright? i have tried to email you but it always bounces..
@GalvayraPHX
@GalvayraPHX Жыл бұрын
NOoooooo! Why was the input on the right on that one metal box...
@PhilsLab
@PhilsLab Жыл бұрын
I know - it's silly guitar player/guitar electronics conventions :( Just like the DC barrel jack having positive on the outside...
@Waferdicing
@Waferdicing Жыл бұрын
💛❤️💚💜💙🖤
@barbasbandas6665
@barbasbandas6665 Жыл бұрын
make a delay!!!!!
ESP32 + PCB Antenna Hardware Design Tutorial - Phil's Lab #90
34:06
Phil’s Lab
Рет қаралды 162 М.
BGA PCB Design Tips - Phil's Lab #95
28:21
Phil’s Lab
Рет қаралды 35 М.
I CAN’T BELIEVE I LOST 😱
00:46
Topper Guild
Рет қаралды 101 МЛН
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 39 МЛН
ROCK PAPER SCISSOR! (55 MLN SUBS!) feat @PANDAGIRLOFFICIAL #shorts
00:31
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 81 МЛН
STM32 Fast Fourier Transform (CMSIS DSP FFT) - Phil's Lab #111
20:12
DSP Overdrive Algorithm in Software (STM32) - Phil's Lab #117
32:52
Lessons Learned from a Decade of Audio Programming
26:14
Comb Filters & Delay Lines in Software (STM32) - Phil's Lab #124
29:12
Magnus Carlsen arrives 2.30 mins late for a 3 minute game | World Blitz 2022
10:58
8. IIR Filters - Infinite Impulse Response - Digital Filter Basics
14:58
Thermal PCB Design Tips - Phil's Lab #93
21:14
Phil’s Lab
Рет қаралды 27 М.
Игровой Комп с Авито за 4500р
1:00
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 2 МЛН
Спутниковый телефон #обзор #товары
0:35
Product show
Рет қаралды 2,2 МЛН
ИГРОВОВЫЙ НОУТ ASUS ЗА 57 тысяч
25:33
Ремонтяш
Рет қаралды 343 М.
Tag her 🤭💞 #miniphone #smartphone #iphone #samsung #fyp
0:11
Pockify™
Рет қаралды 23 МЛН