Just saw, that I used in my code the HAL_UART_TxHalfCpltCallback() for the UART-callback. But normally you should use the full-cplt callback and not the half-cplt callback. But anyway - it works.
Hi, it is not just another electronic Channel but a Great & Perfect Educational Channel in my Opinion. Thank you. I hopped in great steps from learning from your Channel, clearly you taking the time to explain in clarity to typical learners. I noticed that the real FFT library is limited to a length of 4096 which means it rather coarse in frequency bins. Please do another example using the complex FFT Maths library without length limit so that the resolution can be 1 hertz of 20Khz span.
O M G, This channel Is gold. Thanks for all you work, I've just discovered you and your work is remarkable, I will be mention U on my next livestreams, but for now I will keep learning from your videos!,Thanks again.
which external hardware are you using exactly? is it a PMOD I2S microphone from Digilent as shown in the video thumbnail? please show the hardware also along with code.
Thanks for suck detail explanation. I have one doubt as i procedded with FFT in stm32f446ze i did all the lib arm_math.a file attachments in the path but I am getting a hardfault after arm_rfft function. when i put a breakooint into it they gave this msg Can't find a source file at "D:\CMSIS\CMSIS_Setup_V4.xx\CMSIS\DSP_Lib\Source\GCC/../TransformFunctions/arm_rfft_fast_f32.c" Locate the file or edit the source lookup path to include its location. May I know where I might be going wrong. @YetAnotherElectronicsChannel
That's a great implementation of the FFT algorithm! Can you suggest some books/ reference material specific to STM32F4 Discovery kit to follow along so as to get acquainted with the ecosystem?
Thank you for the great video. I tried 'stm32f303k8t6' but it didn't work out. Adding 'arm_rfft_fast_init_f32(&fft_handler, 2048);' will result in 'undefined reference to 'arm_rfft_fast_init_f32' error. After creating the libs folder, adding the file 'libarm_cortexM4lf_math.a' and building it will result in a memory over-error. I'm not sure why. Thank you.
Hi, I know this video is 3 years old now but if theres any chance you or anyone would anwser if it is possible to change the master clock of I2S while its running to get a sort of bit-crunch effect. I know reducing the sample size can be done but I'm interested if it is also possible to change the bitrate and have it controlled via a potentiometer. Thank you.
ST does not provide any windowing function (like Hanning etc.). If we perform FFT on raw data block versus FFT on data block which has window effect, there will be much spectrum leakage. Not sure how others deal with it?
Dear Dr, Thank you very much for your helpful videos, I need to know, how we can create a simple GUI for audio recording using Line blue Jack on STM32F7 Discovery board. Thank you in advance
hello sir ,great channels... do you also have an explenation about the STM32 in combination with audio input audio output to make a 3-way loudspeaker box ?
Have you tried the CMSIS arm_cmplx_mag_f32 function for calculating the absolute value from the fft results? I tried setting this up with the latest CMSIS library but got issues with the floating point hardware implementation of the sqrt function, so never got it up and running.
Hello. Tell me please. I really liked your project, I would like to do something similar, but based on the mems-microphone with pdm output on discovery board. PDM mic is working with delta-sigma modulator inside, and your DAC has a "multi-bit delta-sigma modulator" inside. Do I need to do additional transformations in the input part in my code to get the spectrum analysis like in your video?
Hi! great video and explanation, just what I needed! I have a question if I want to use only one channel (being just the left channel or right channel for the microphone in an audio codec) there will be any problem? (in my case I want to have two microphones listening, si I don't know if it's a great idea.) Thanks.
Hey! I've been trying to use your code to do an FFT on the output of a hall effect current sensor. The ouput is a value of 0 to 4096 and the frequency of the signal is 60Hz (directly connected to the electric network). The problem I have is in the output buffer of the FFT, after doing the absolute value and the 20log, i get zeros and 87, I cannot find the harmonic at 60Hz, 120Hz, 180Hz. In other words, the output buffer of the FFT makes no sense. I am sampling the ouput of the sensor at 6000Hz. I am using STM32F411RE and I am using the internal ADC to convert analog output of the current sensor.
DIS GUY IS A GEM!!! Is that all the videos u got in the playlist? or am i missing something, i dont see all the other numbers Is this a paid course or something?
If it is to be implemented with ADC with opamp, bringing the signal to the full range between 0 and 3 v - how should I collect the data? Should I just sample the input 48000 times a second?
The full-scale range is specified in the datasheet of the ADC converter. Yes you collect the data via I²S interface. The sampling-rate is up to you, 48 kHz is one possible choice.
Hello Rick. Do we have a false measurement If I input a signal that is not in the full range of 0 - 3V ? And when reading the ADC value, do you leave it as the ADC output them, or do you transform it before putting it in the input buffer of 'arm_rfft_fast_init_f32()" ? Thank you
@@Gragoon well if you put a signal above reference voltage you are just gonna see maxed out value, and if you put something above 3.7 (or smth like that, check datasheet), you'll burn the input. You might transform the values before putting it into FFT by applying a windows function. I haven't got that far yet but I know one project where a Hamm windows is used. So that might be your choice.
@@Beatleman91 thank you for the fast reply ! In my case I have a sinusoidal signal that goes to 1Mhz with an amplitude of 0,6V. Can i just use it then as it’s not higher than ref voltage ?
Sorry I didn't got your question. What do you mean with sample-rate reduced by -1.125? By the way - I also have been working a lot as FOH engineer during university time :)
YetAnotherElectronicsChannel in the example: f_sample = 48kHz then it says actually 46.875 kHz. All the math is done with a sample rate value of 46.875 and not 48. A difference of 1.125. Is this compensation for the a/d conversion ?
@@sidneyclark4952 Ah now I understand. This is due to the nature of the STM32 chip. Even if it says 48 kHz (no matter if it is a computer or a mixing-desk or a smartphone), you will never have exactly 48 kHz or e.g. 96 kHz. The STM32 in this example is just not capable of producing an exact 48 kHz clocking-signal - instead it produces the 46.875 kHz clock-signal. So this is not a latency problem. The ADC itself doesn't care if it is exactly 48 kHz or so - it can handle every sample-rate up to 108kHz. The audio-signal itself also doesn't care about the sampling-rate, as long as the sample rate is higher then two times the signal-bandwidth (typically 2* 20Khz = 40 kHz). But in case you try to apply filters or doing FFT you should calculate through your formulas with the real frequency to match exactly the behavior you want to have. ADC's or DAC's are having conversion-delays of typically approx. 10 samples.. So in this case 10*(1/64875) = 213µs
The board has only a DAC. No ADC. And on top of it you have to configure it before via I2C or so... The I2S board is the most easy and clean way where you just need the I2S (no addition I2C config or similar)
@@suncrafterspielt9479 Depending on your requirements, 12 bit might be fine. But then you need additional circuitry probably like an DC offset and an opamp to bring your audio signal to the full 3v pp scale. But the biggest problem is to implement the synchronization between ADC and the I2S output port. If they are not in sync you will get sample drops over time. So the ADC must be triggered somehow by the I2S WCLK signal
I'm So Sorry My ENGLISH is Terrible :))) I'm So Sorry,I'm Mistake To Understand To you :)) it Means How To Stop Microphone feedback loop OR www.mediacollege.com/audio/images/feedback.gif I Say Again,Your Work is GREAT , Keep Going. :))
Thank you so much for sharing this tutorial. Just One question, how the STM32 can "hear" the sound? I see you use additional hardware, do you need a microphone too?
Just saw, that I used in my code the HAL_UART_TxHalfCpltCallback() for the UART-callback. But normally you should use the full-cplt callback and not the half-cplt callback. But anyway - it works.
Sir, how do you arrive at 150 as noise floor? Thanks.
Brooo, your video is exactly what I've been looking for since 4 days. I'm so glad
Hi, it is not just another electronic Channel but a Great & Perfect Educational Channel in my Opinion. Thank you. I hopped in great steps from learning from your Channel, clearly you taking the time to explain in clarity to typical learners.
I noticed that the real FFT library is limited to a length of 4096 which means it rather coarse in frequency bins.
Please do another example using the complex FFT Maths library without length limit so that the resolution can be 1 hertz of 20Khz span.
I'm not sure how to thank you. Every video has been incredibly helpful.
O M G, This channel Is gold. Thanks for all you work, I've just discovered you and your work is remarkable, I will be mention U on my next livestreams, but for now I will keep learning from your videos!,Thanks again.
Thanks a lot! It's the easiest explanation how to use arm dsp with STM32 that I've seen!
Well explained, I'm gonna try to use this to print violin frequencies on a screen using a microphone as an analog input. Let's see how it goes....
Awesome video. Well presented and helpful for those who are learning. Please keep up the STM32 DSP vids!
Are you studying postgraduate (masters or phd) course in DSP?
Motor Madness I have a M.S. in electrical engineering- but I didn’t had dedicated courses to DSP. This I learned myself actually
Many thanks for the video. It's very interesting and help me a lot at my university.
Big love from Berlin
Great video, thank you, just what I was looking for!
Excellent tutorial again
Wonderful ...❤
which external hardware are you using exactly? is it a PMOD I2S microphone from Digilent as shown in the video thumbnail? please show the hardware also along with code.
Thanks for suck detail explanation. I have one doubt as i procedded with FFT in stm32f446ze i did all the lib arm_math.a file attachments in the path but I am getting a hardfault after arm_rfft function. when i put a breakooint into it they gave this msg
Can't find a source file at "D:\CMSIS\CMSIS_Setup_V4.xx\CMSIS\DSP_Lib\Source\GCC/../TransformFunctions/arm_rfft_fast_f32.c"
Locate the file or edit the source lookup path to include its location.
May I know where I might be going wrong. @YetAnotherElectronicsChannel
That's a great implementation of the FFT algorithm! Can you suggest some books/ reference material specific to STM32F4 Discovery kit to follow along so as to get acquainted with the ecosystem?
Thank you for the great video. I tried 'stm32f303k8t6' but it didn't work out.
Adding 'arm_rfft_fast_init_f32(&fft_handler, 2048);' will result in 'undefined reference to 'arm_rfft_fast_init_f32' error.
After creating the libs folder, adding the file 'libarm_cortexM4lf_math.a' and building it will result in a memory over-error. I'm not sure why.
Thank you.
Hi, I know this video is 3 years old now but if theres any chance you or anyone would anwser if it is possible to change the master clock of I2S while its running to get a sort of bit-crunch effect. I know reducing the sample size can be done but I'm interested if it is also possible to change the bitrate and have it controlled via a potentiometer. Thank you.
ST does not provide any windowing function (like Hanning etc.). If we perform FFT on raw data block versus FFT on data block which has window effect, there will be much spectrum leakage. Not sure how others deal with it?
Dear Dr, Thank you very much for your helpful videos,
I need to know, how we can create a simple GUI for audio recording using Line blue Jack on STM32F7 Discovery board. Thank you in advance
hello sir ,great channels... do you also have an explenation about the STM32 in combination with audio input audio output to make a 3-way loudspeaker box ?
Have you tried the CMSIS arm_cmplx_mag_f32 function for calculating the absolute value from the fft results? I tried setting this up with the latest CMSIS library but got issues with the floating point hardware implementation of the sqrt function, so never got it up and running.
Hello. Tell me please. I really liked your project, I would like to do something similar, but based on the mems-microphone with pdm output on discovery board. PDM mic is working with delta-sigma modulator inside, and your DAC has a "multi-bit delta-sigma modulator" inside. Do I need to do additional transformations in the input part in my code to get the spectrum analysis like in your video?
Hello sir, im still confused to displaying the spectrum from the FFT
Nice
how did you calculate the noise offset?
Hi! great video and explanation, just what I needed! I have a question if I want to use only one channel (being just the left channel or right channel for the microphone in an audio codec) there will be any problem? (in my case I want to have two microphones listening, si I don't know if it's a great idea.)
Thanks.
The 1024 FFT bins are ended up with 10 bar indicators! Probably not very efficient way of computing audio equalizer.
Hey! I've been trying to use your code to do an FFT on the output of a hall effect current sensor. The ouput is a value of 0 to 4096 and the frequency of the signal is 60Hz (directly connected to the electric network). The problem I have is in the output buffer of the FFT, after doing the absolute value and the 20log, i get zeros and 87, I cannot find the harmonic at 60Hz, 120Hz, 180Hz. In other words, the output buffer of the FFT makes no sense. I am sampling the ouput of the sensor at 6000Hz. I am using STM32F411RE and I am using the internal ADC to convert analog output of the current sensor.
Good stuff, thanks!
DIS GUY IS A GEM!!!
Is that all the videos u got in the playlist? or am i missing something, i dont see all the other numbers
Is this a paid course or something?
Did you do any project using only STM32F407G without other hardware? Thank you
Where are you storing the data for FFT?
can we active the dac in stm32f407vg through i2c??
Hi, can this be implemented using a cheap ky-037 microphone?
how much does this little program load your chip? Not much at all I hope..?
hi, thanks for this detailed explanation. is that possible that I can achieve FFT with a cortex-M0 chip?
like stm32g031k8 evaluation board which has no floating-point hardware
If it is to be implemented with ADC with opamp, bringing the signal to the full range between 0 and 3 v - how should I collect the data? Should I just sample the input 48000 times a second?
The full-scale range is specified in the datasheet of the ADC converter.
Yes you collect the data via I²S interface. The sampling-rate is up to you, 48 kHz is one possible choice.
Hello Rick. Do we have a false measurement If I input a signal that is not in the full range of 0 - 3V ?
And when reading the ADC value, do you leave it as the ADC output them, or do you transform it before putting it in the input buffer of 'arm_rfft_fast_init_f32()" ?
Thank you
@@Gragoon if data ranges only from 0 to 3V you have in fact a DC offset. The FFT will present you a high peak then at 0 Hz frequency point.
@@Gragoon well if you put a signal above reference voltage you are just gonna see maxed out value, and if you put something above 3.7 (or smth like that, check datasheet), you'll burn the input.
You might transform the values before putting it into FFT by applying a windows function. I haven't got that far yet but I know one project where a Hamm windows is used. So that might be your choice.
@@Beatleman91 thank you for the fast reply ! In my case I have a sinusoidal signal that goes to 1Mhz with an amplitude of 0,6V. Can i just use it then as it’s not higher than ref voltage ?
Just a simple FOH engineer trying to follow along here, lol. So is the sample rate reduced -1.125 to compensate for a to d conversion latency ?
Sorry I didn't got your question. What do you mean with sample-rate reduced by -1.125? By the way - I also have been working a lot as FOH engineer during university time :)
YetAnotherElectronicsChannel in the example: f_sample = 48kHz then it says actually 46.875 kHz. All the math is done with a sample rate value of 46.875 and not 48. A difference of 1.125. Is this compensation for the a/d conversion ?
@@sidneyclark4952 Ah now I understand. This is due to the nature of the STM32 chip. Even if it says 48 kHz (no matter if it is a computer or a mixing-desk or a smartphone), you will never have exactly 48 kHz or e.g. 96 kHz. The STM32 in this example is just not capable of producing an exact 48 kHz clocking-signal - instead it produces the 46.875 kHz clock-signal. So this is not a latency problem. The ADC itself doesn't care if it is exactly 48 kHz or so - it can handle every sample-rate up to 108kHz. The audio-signal itself also doesn't care about the sampling-rate, as long as the sample rate is higher then two times the signal-bandwidth (typically 2* 20Khz = 40 kHz). But in case you try to apply filters or doing FFT you should calculate through your formulas with the real frequency to match exactly the behavior you want to have. ADC's or DAC's are having conversion-delays of typically approx. 10 samples.. So in this case 10*(1/64875) = 213µs
YetAnotherElectronicsChannel excellent explanation. Thanks, teach!
Just a quick question. Why do you use in all your videos an external I2S ADC and not the built-in ADC of the STM?
The board has only a DAC. No ADC. And on top of it you have to configure it before via I2C or so... The I2S board is the most easy and clean way where you just need the I2S (no addition I2C config or similar)
Ahh, ok thanks. I use a microprocessor with an integrated 12 bit adc. Would you recommend using it or still relying on the external i2s adc?
@@suncrafterspielt9479 Depending on your requirements, 12 bit might be fine. But then you need additional circuitry probably like an DC offset and an opamp to bring your audio signal to the full 3v pp scale. But the biggest problem is to implement the synchronization between ADC and the I2S output port. If they are not in sync you will get sample drops over time. So the ADC must be triggered somehow by the I2S WCLK signal
Yeah, external circuitry is then needed. But isn’t it possible to synchronise the timers on stm32?
Hey bro that's it amazing
Please make a video for removal sound loop output to input amplifier,with stm32.
Thankyou.
Sorry I didn't got your question to be honest. Can you please reformulate your question? :)
I'm So Sorry My ENGLISH is Terrible :)))
I'm So Sorry,I'm Mistake To Understand To you :)) it Means How To Stop Microphone feedback loop OR www.mediacollege.com/audio/images/feedback.gif
I Say Again,Your Work is GREAT , Keep Going. :))
Hi, how do I get in touch with you. Have a business question.
Contact me under: yetanotherelectronicschannel@gmail.com
Thank you so much for sharing this tutorial. Just One question, how the STM32 can "hear" the sound? I see you use additional hardware, do you need a microphone too?
As you see on the picture, project uses ADC stereo dongle with I2C output to uC. I believe the dongle is from the Digilent.
thanks