Although the QA403 is a wonderful device, it would be handy to let people know that most measurements can be done with just a decent audio interface for around $70-150 Great video btw 👍🏻
Thanks, Isaac! Actually working on one of those NXP i.MX RT designs at the moment for an audio project. Will be interesting to see how that compares to the H7...
loved all your videos series for Engineers like us ,who was not taught the real beauty of DSP and MCU and their integration in real life love fro India sir
*Summary* *What it's about:* This video demonstrates how to implement a Finite Impulse Response (FIR) filter on an STM32 microcontroller using the CMSIS DSP library for real-time audio processing. *Key Points:* * *0:00** FIR Filter Advantages:* FIR filters offer precise frequency response control, are stable, and can create complex filter shapes. * *3:06** CMSIS DSP Library:* This ARM library provides optimized DSP functions for Cortex microcontrollers, including FIR filtering, offering significant speed improvements over custom code. * *3:06** Implementation Steps:* 1. *3:06** Download CMSIS files:* Get `arm_math.h` header and the appropriate pre-compiled library (`arm_cortexM7lf_math.lib` for single-precision floating point on STM32H7). 2. *4:24** Add libraries to project:* Include the header file and link the library in your IDE (STM32CubeIDE in this case). 3. *6:00** Understand CMSIS FIR functions:* * `arm_fir_init_F32()`: Initializes the FIR filter structure. Requires reversed coefficient order and a working buffer. * `arm_fir_f32()`: Performs the actual filtering on a block of input samples. 4. *9:13** Write your code:* * Define kernel length, block size, and structures for the FIR instance, buffers, and kernel. * Write functions to initialize the filter (including kernel reversal), process audio blocks, and convert between integer and floating-point formats. 5. *16:17** Design the filter:* Use tools like T-Filter to design your desired frequency response and generate filter coefficients. * *21:41** Real-time testing:* The video demonstrates the implemented filter working on a custom STM32H7 board, achieving results very close to the designed filter response. *Tools Used:* * STM32CubeIDE * CMSIS DSP Library (version 4) * T-Filter online filter design tool * Quant Asylum QA403 audio analyzer * Segger J-Link debugger *Tips:* * Remember to reverse the filter coefficient order before passing it to the initialization function. * Consider memory constraints and processing power when choosing your filter length. * Non-idealities in the system can affect real-world filter performance. i used gemini 1.5 pro to summarize the transcript
Hey Phil! I absolutely love your videos and are absolute game changers! Thank you so much for uploading these videos! P.S. it would be amazing to see a PCB design walkthrough for the infiniFX board!
Hi phil.. I am trying to design a filter that could filter out the decaying DC offsets. What would be mu best choice? Can u also suggest some must have tools for filter design? I’m a beginer so any information is useful information
Very nice video Phil! With your current infinity development platform, how many effects do you think you can chain with current hardware? Like equalizer > distortion > delay > reverb or some pipeline that'll mimick a pedalboard ? Or would you have many identical devices with different firmware instead? I have no idea how powerful those MCU are for those applications.
I can provide some indication. The NXP iMX RT 1062 is a comparable processor. Using a 256 sample loop with a 48kHz sample rate, the processor can calculate two Schroeder reverbs, a pitch shifting effect, a noise gate and tremolo effect (both as described in past Phil's lab videos), a 128 sample FFT and inverse FFT along with a 64 sample FFT magnitude calculation in sequence without problem. The iMX RT 1176 that Phil discussed in the comments has a 50% more powerful Cortex M7 core and includes a second M4 core. A single STM32H7 processor can probably handle the DSP functions of a moderately powerful pedal board.
Hey, great content as always! I wondered if you've looked into the STM32 FMAC hardware? Wouldn't be a nice hardware-agnostic demo like this, but maybe it would be interesting to compare the pure firmware FIR approach to hardware? I've seen it on the peripheral list but never used it myself. Not sure what the limitations might be. Thanks!
Thanks! Haven't really used the FMAC terribly much, as it's typically a fixed-point implementation. Most of my DSP implementations are floating point and so far haven't had the need to use it. I definitely should explore that a bit more though!
Hey so what's the deal with using 32-bit floats as your kernel type, specifying some 20 digits for each element, when only 10-12 digits of precision is realistic with this datatype at this magnitude? Looking at 13:50 here, Your very first coefficient for example, is diverging after the 12th digit, meaning the entire least-significant half of your coefficient is not at all being represented in the hardware. At such a long kernel length, won't this essentially result in a different filter than what was called for by your literal const declaration?
Yes, this was just due to using TFilter that works with doubles, and me copying over the values directly without further processing/precision reduction. The reason I didn't do any editing to those values was for the sake of time, and the fact that the filter results are - typically - still very similar between theoretical and practical implementation. The 'precision-reduction-effects' of using floats was also mentioned briefly in the video. A better alternative would of course be to use the DP CMSIS libs, or use a filter design tool that works with SP floats.
Very informative. Two questions. Why would you need multiple passband and stopband? I kinda seem lost. Have you mentioned this on a video already? And is this why you had to use this specific library instead of implementing your own FIR (which you've done before)?
Thanks! The filter in this video is just for demo purposes, to show how to design a somewhat-specific FIR filter - no particular practical application. The CMSIS library is faster than the 'naive' FIR filter implementation.
Thanks for sharing. You're a great teacher, better than some of my EE professors lol!
Thank you very much! Haha sad state of affairs if that's the case..
I'm quiet sure - some day "Professor Phil" will do it much better for his students !! 👍👍
Although the QA403 is a wonderful device, it would be handy to let people know that most measurements can be done with just a decent audio interface for around $70-150
Great video btw 👍🏻
Audio stuff using the CMSIS Library! I think I am in love!! I use NXP M7 microcontrollers, and all this stuff is still directly useful! Great content.
Thanks, Isaac! Actually working on one of those NXP i.MX RT designs at the moment for an audio project. Will be interesting to see how that compares to the H7...
@@PhilsLab If that ends up being something you can share, I'd love to see a video about that. Are you using a BGA device?
Yep, that's something I can share once it's finished! I'm using the MIMXRT1776DVMAA (BGA-289 package).
loved all your videos series for Engineers like us ,who was not taught the real beauty of DSP and MCU and their integration in real life
love fro India sir
Thank you very much for your kind comment!
*Summary*
*What it's about:* This video demonstrates how to implement a Finite Impulse Response (FIR) filter on an STM32 microcontroller using the CMSIS DSP library for real-time audio processing.
*Key Points:*
* *0:00** FIR Filter Advantages:* FIR filters offer precise frequency response control, are stable, and can create complex filter shapes.
* *3:06** CMSIS DSP Library:* This ARM library provides optimized DSP functions for Cortex microcontrollers, including FIR filtering, offering significant speed improvements over custom code.
* *3:06** Implementation Steps:*
1. *3:06** Download CMSIS files:* Get `arm_math.h` header and the appropriate pre-compiled library (`arm_cortexM7lf_math.lib` for single-precision floating point on STM32H7).
2. *4:24** Add libraries to project:* Include the header file and link the library in your IDE (STM32CubeIDE in this case).
3. *6:00** Understand CMSIS FIR functions:*
* `arm_fir_init_F32()`: Initializes the FIR filter structure. Requires reversed coefficient order and a working buffer.
* `arm_fir_f32()`: Performs the actual filtering on a block of input samples.
4. *9:13** Write your code:*
* Define kernel length, block size, and structures for the FIR instance, buffers, and kernel.
* Write functions to initialize the filter (including kernel reversal), process audio blocks, and convert between integer and floating-point formats.
5. *16:17** Design the filter:* Use tools like T-Filter to design your desired frequency response and generate filter coefficients.
* *21:41** Real-time testing:* The video demonstrates the implemented filter working on a custom STM32H7 board, achieving results very close to the designed filter response.
*Tools Used:*
* STM32CubeIDE
* CMSIS DSP Library (version 4)
* T-Filter online filter design tool
* Quant Asylum QA403 audio analyzer
* Segger J-Link debugger
*Tips:*
* Remember to reverse the filter coefficient order before passing it to the initialization function.
* Consider memory constraints and processing power when choosing your filter length.
* Non-idealities in the system can affect real-world filter performance.
i used gemini 1.5 pro to summarize the transcript
Thank you Phil, That's great Topic and Video!
Very interesting video! Thank you for uploading these videos, it means alot!
Thanks for your support!
Hey Phil! I absolutely love your videos and are absolute game changers! Thank you so much for uploading these videos!
P.S. it would be amazing to see a PCB design walkthrough for the infiniFX board!
Thank you very much for watching! Yep, will be making a new rev of the board with a screen - then will make a hardware walkthrough.
damn nice. was looking for this stuff last week. 👍
thank you for these amazing tutorials.
Battery powered sensor board would be also interesting 🙂
Hi phil..
I am trying to design a filter that could filter out the decaying DC offsets. What would be mu best choice?
Can u also suggest some must have tools for filter design?
I’m a beginer so any information is useful information
Very nice video Phil!
With your current infinity development platform, how many effects do you think you can chain with current hardware?
Like equalizer > distortion > delay > reverb or some pipeline that'll mimick a pedalboard ? Or would you have many identical devices with different firmware instead?
I have no idea how powerful those MCU are for those applications.
I can provide some indication. The NXP iMX RT 1062 is a comparable processor. Using a 256 sample loop with a 48kHz sample rate, the processor can calculate two Schroeder reverbs, a pitch shifting effect, a noise gate and tremolo effect (both as described in past Phil's lab videos), a 128 sample FFT and inverse FFT along with a 64 sample FFT magnitude calculation in sequence without problem. The iMX RT 1176 that Phil discussed in the comments has a 50% more powerful Cortex M7 core and includes a second M4 core.
A single STM32H7 processor can probably handle the DSP functions of a moderately powerful pedal board.
Great video big dog!
Thanks a lot!
Have you tried any of the STM32G4 processors with the FMAC?
Amazing man!
Thank you, Luis!
Thank you !
Thanks for watching!
Interesting topic ;)
Hey, great content as always! I wondered if you've looked into the STM32 FMAC hardware? Wouldn't be a nice hardware-agnostic demo like this, but maybe it would be interesting to compare the pure firmware FIR approach to hardware? I've seen it on the peripheral list but never used it myself. Not sure what the limitations might be. Thanks!
Thanks! Haven't really used the FMAC terribly much, as it's typically a fixed-point implementation. Most of my DSP implementations are floating point and so far haven't had the need to use it. I definitely should explore that a bit more though!
Hey so what's the deal with using 32-bit floats as your kernel type, specifying some 20 digits for each element, when only 10-12 digits of precision is realistic with this datatype at this magnitude? Looking at 13:50 here, Your very first coefficient for example, is diverging after the 12th digit, meaning the entire least-significant half of your coefficient is not at all being represented in the hardware. At such a long kernel length, won't this essentially result in a different filter than what was called for by your literal const declaration?
Yes, this was just due to using TFilter that works with doubles, and me copying over the values directly without further processing/precision reduction. The reason I didn't do any editing to those values was for the sake of time, and the fact that the filter results are - typically - still very similar between theoretical and practical implementation. The 'precision-reduction-effects' of using floats was also mentioned briefly in the video. A better alternative would of course be to use the DP CMSIS libs, or use a filter design tool that works with SP floats.
Why you need to reverso order the taps since they are symmetric?
For the case of symmetric kernels, sure there is no need. But there are plenty of cases where the kernel isn't symmetric.
Does the use of block functionality degrade the latency?
There will be always be a (small) latency with block-processing, e.g. for 256-sample block @ 48kHz ~5ms.
hey sir , i have a request for you . Can you make a video on how to create a custom pcb for stm32wl family and use its lora function in the pcb?
Huge Fan! Would it be possible to create a USB interface for guitar with in-built DSP filters using an STM32?
Thank you! Yes, I'm working on a STM32 USB + Audio device class implementation for a future video at the moment.
@@PhilsLab if you do it multichannel, you will be the hero of the audio maker community
Wanna try... But I don't have such audio devices to see frequency response.. Will try nano vna on low fr.
If you have a function generator and oscilloscope, you can do similar tests, albeit not as quickly/simply.
Just a simple audio interface will be fine
Very informative. Two questions. Why would you need multiple passband and stopband? I kinda seem lost. Have you mentioned this on a video already? And is this why you had to use this specific library instead of implementing your own FIR (which you've done before)?
Thanks! The filter in this video is just for demo purposes, to show how to design a somewhat-specific FIR filter - no particular practical application. The CMSIS library is faster than the 'naive' FIR filter implementation.
Why cannot library reverse coefficients by itself is a mistery!
👍🙏❤️