[#23] FFT Spectrum Analysis - Audio DSP On STM32 (24 Bit / 48 kHz)

Поделиться
HTML-код
  • Опубликовано: 5 янв 2025

Комментарии • 68

  • @YetAnotherElectronicsChannel
    @YetAnotherElectronicsChannel  4 года назад +4

    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.

    • @renyvincent4406
      @renyvincent4406 3 года назад

      Sir, how do you arrive at 150 as noise floor? Thanks.

  • @Geh_Raus
    @Geh_Raus 5 месяцев назад +1

    Brooo, your video is exactly what I've been looking for since 4 days. I'm so glad

  • @ttkoh123
    @ttkoh123 2 года назад +1

    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.

  • @leoponce82ponce
    @leoponce82ponce 3 года назад +2

    I'm not sure how to thank you. Every video has been incredibly helpful.

  • @electromatic2014
    @electromatic2014 4 года назад +6

    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.

  • @andrej4eg90
    @andrej4eg90 4 года назад +1

    Thanks a lot! It's the easiest explanation how to use arm dsp with STM32 that I've seen!

  • @fedegroxo
    @fedegroxo 2 года назад +1

    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....

  • @motormadness9975
    @motormadness9975 4 года назад +1

    Awesome video. Well presented and helpful for those who are learning. Please keep up the STM32 DSP vids!

    • @motormadness9975
      @motormadness9975 4 года назад

      Are you studying postgraduate (masters or phd) course in DSP?

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  4 года назад

      Motor Madness I have a M.S. in electrical engineering- but I didn’t had dedicated courses to DSP. This I learned myself actually

  • @doanvietanhcao3608
    @doanvietanhcao3608 4 года назад +1

    Many thanks for the video. It's very interesting and help me a lot at my university.
    Big love from Berlin

  • @Vexown
    @Vexown 4 года назад +1

    Great video, thank you, just what I was looking for!

  • @roytynan2116
    @roytynan2116 4 года назад +1

    Excellent tutorial again

  • @Zurenio
    @Zurenio Год назад +1

    Wonderful ...❤

  • @RahulPandey-pm2sz
    @RahulPandey-pm2sz 2 года назад +2

    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.

  • @narendrawalawalkar7898
    @narendrawalawalkar7898 3 года назад +1

    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

  • @amitvikrampujar5517
    @amitvikrampujar5517 3 года назад +4

    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?

  • @지금이대로좋다-d6c
    @지금이대로좋다-d6c 3 года назад +1

    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.

  • @NeonFXFusion
    @NeonFXFusion 9 месяцев назад

    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.

  • @Debraj1978
    @Debraj1978 3 года назад

    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?

  • @deeplearning758
    @deeplearning758 4 года назад +1

    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

  • @souhailla10
    @souhailla10 3 года назад +1

    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 ?

  • @eventhatsme
    @eventhatsme 4 года назад +1

    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.

  • @АмирАрсланов-я9ц
    @АмирАрсланов-я9ц 2 года назад

    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?

  • @wahyuutorosaputro945
    @wahyuutorosaputro945 3 года назад

    Hello sir, im still confused to displaying the spectrum from the FFT

  • @47lokeshkumar74
    @47lokeshkumar74 Год назад

    Nice

  • @saurabhparekh9242
    @saurabhparekh9242 3 года назад +1

    how did you calculate the noise offset?

  • @juanchoavid123
    @juanchoavid123 3 года назад +1

    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.

  • @odissey2
    @odissey2 2 года назад

    The 1024 FFT bins are ended up with 10 bar indicators! Probably not very efficient way of computing audio equalizer.

  • @user-wr7bf1qc6v
    @user-wr7bf1qc6v 3 года назад

    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.

  • @sigicnc
    @sigicnc 4 года назад

    Good stuff, thanks!

  • @adityams1659
    @adityams1659 3 года назад

    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?

  • @franckciccio8032
    @franckciccio8032 3 года назад

    Did you do any project using only STM32F407G without other hardware? Thank you

  • @sreyaghosh6632
    @sreyaghosh6632 3 года назад

    Where are you storing the data for FFT?

  • @47lokeshkumar74
    @47lokeshkumar74 4 года назад

    can we active the dac in stm32f407vg through i2c??

  • @diniff8635
    @diniff8635 4 года назад

    Hi, can this be implemented using a cheap ky-037 microphone?

  • @nicolasjonasson4820
    @nicolasjonasson4820 3 года назад

    how much does this little program load your chip? Not much at all I hope..?

  • @mingweihu953
    @mingweihu953 2 года назад

    hi, thanks for this detailed explanation. is that possible that I can achieve FFT with a cortex-M0 chip?

    • @mingweihu953
      @mingweihu953 2 года назад

      like stm32g031k8 evaluation board which has no floating-point hardware

  • @Beatleman91
    @Beatleman91 3 года назад

    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?

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  3 года назад

      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.

    • @Gragoon
      @Gragoon 3 года назад

      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

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  3 года назад +1

      @@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.

    • @Beatleman91
      @Beatleman91 3 года назад

      @@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.

    • @Gragoon
      @Gragoon 3 года назад

      @@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 ?

  • @sidneyclark4952
    @sidneyclark4952 4 года назад

    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 ?

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  4 года назад

      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 :)

    • @sidneyclark4952
      @sidneyclark4952 4 года назад

      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 ?

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  4 года назад +3

      @@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

    • @sidneyclark4952
      @sidneyclark4952 4 года назад

      YetAnotherElectronicsChannel excellent explanation. Thanks, teach!

  • @suncrafterspielt9479
    @suncrafterspielt9479 4 года назад

    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?

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  4 года назад +1

      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
      @suncrafterspielt9479 4 года назад

      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?

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  4 года назад

      @@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

    • @suncrafterspielt9479
      @suncrafterspielt9479 4 года назад

      Yeah, external circuitry is then needed. But isn’t it possible to synchronise the timers on stm32?

  • @mrkmrk4454
    @mrkmrk4454 4 года назад

    Hey bro that's it amazing
    Please make a video for removal sound loop output to input amplifier,with stm32.
    Thankyou.

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  4 года назад

      Sorry I didn't got your question to be honest. Can you please reformulate your question? :)

    • @mrkmrk4454
      @mrkmrk4454 4 года назад

      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. :))

  • @wojciechg9498
    @wojciechg9498 4 года назад

    Hi, how do I get in touch with you. Have a business question.

  • @stefanocarniel4015
    @stefanocarniel4015 3 года назад

    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?

    • @odissey2
      @odissey2 2 года назад

      As you see on the picture, project uses ADC stereo dongle with I2C output to uC. I believe the dongle is from the Digilent.

  • @girlswithgames
    @girlswithgames 8 месяцев назад

    thanks