[#20] PDM Microphones - Audio DSP On STM32 (16 Bit / 48 kHz)

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ธ.ค. 2024

ความคิดเห็น • 68

  • @stepannovotny4291
    @stepannovotny4291 ปีที่แล้ว

    These DSP videos have helped me to make a very configurable ultrasonic leak detector. Fantastic quick-start.

  • @batosato
    @batosato หลายเดือนก่อน

    Great video!! If anyone is wondering how to enable PDM2PCM option then make sure that CRC is activated.

  • @radosawpuchalski2251
    @radosawpuchalski2251 ปีที่แล้ว +1

    I have a question. Why MidBuffer has only 16 elements if you process 64 elements of pdmRxBuf in PDM_Filter function?

  • @simonmerrett
    @simonmerrett 4 ปีที่แล้ว +3

    Thanks for another great video. Do you think you could use dual PDM microphones in a background or far field noise cancelling application? One microphone near the mouth and one further away. Convert both inputs to digital (I2S?) and subtract the far signal from the near signal? Or would you use a different way? I'm thinking about removing cabin noise in a vehicle. Thanks again!

    • @alexchu0911
      @alexchu0911 6 หลายเดือนก่อน

      No need to locate these 2 Microphones as you said. Usually dual-MIC NS algorithm (BF is probably used) requires standard location of MICs. For cabin noise, you can refer some successful cases of algorithm companies or vehicle manufactures with MIC arrays.

  • @pawezimroz7104
    @pawezimroz7104 4 ปีที่แล้ว +4

    Should it work if I just run code on my board (I'm using F411E discovery) and connect my headphones to it? Well, it isn't, but surely I did something wrong. Besides it's not clear for me why are you using such sizes for the buffers and why they differ: 128, 256 and 16. Also I have no idea why only i'th and (i+2)'th samples are transmitted. How is it connected with the fact that you use 24b data of 32b frame and "half-word" configuration in DMA? I also wonder what is the reason of using slave mode, wouldn't it work if both I2S were set to master mode? Sorry, I am just a beginner and maybe I just didn't understand but I would be very grateful to hear some more thorough explaination on these details.

    • @kishoresaldanha815
      @kishoresaldanha815 4 ปีที่แล้ว

      You need to use drivers for the onboard audio DAC chip . Example th-cam.com/video/QIPQOnVablY/w-d-xo.html

    • @theprotector11
      @theprotector11 4 ปีที่แล้ว

      Hello, have you managed to figure out how to do this on F411E? I watched the video which was replied by. But do I really need to manually install drivers now?

    • @kishoresaldanha815
      @kishoresaldanha815 4 ปีที่แล้ว

      @@theprotector11 yes. otherwise the DAC chip won't play the audio on the headphones. I have managed to work it on DISCO board .I can share you the project

    • @theprotector11
      @theprotector11 4 ปีที่แล้ว

      @@kishoresaldanha815 Yes please. How exactly can we get in contact here? And do I need the driver as well for the microphone to send signal as well?

    • @kishoresaldanha815
      @kishoresaldanha815 4 ปีที่แล้ว

      @@theprotector11 I will share the github link. you will need a stm32f4 disco board. The board has cs432l audio chip and a pdm microphone. The driver for audio chip is only two files .c and .h which you need to include in this video's source code . Besides the code you will need to make two wired connections between I2S master and slave shown in this video.

  • @syedafzal2062
    @syedafzal2062 3 ปีที่แล้ว +1

    It's an amazing video brother just wanted to see the DAC setup(Entire Hardware setup)

  • @enricoubaldino5856
    @enricoubaldino5856 4 ปีที่แล้ว +2

    Congratulations, great explanation. If I wanted to transfer the PDM data acquired by the microphones via USB_OTG_FS what should I activate? Which library do you use for data transfer? Thanks so much

  • @danielgan5899
    @danielgan5899 4 ปีที่แล้ว +1

    Hi, I'm pretty new to DSP but how do you output the PCM data to say a waveform output like Audacity/Adobe Audition? Or even how do you output your real-time voice to something I can view off?

  • @bobby9568
    @bobby9568 ปีที่แล้ว

    No demo? So did it actually work?

  • @romiolover6852
    @romiolover6852 3 ปีที่แล้ว +1

    Very good explanation thx, I wonder if you could make another video about the same PDM bitstream but outputting it through the USB of the discovery board as a USB microphone application, that will be an awesome useful application.

  • @stankogradev8766
    @stankogradev8766 2 ปีที่แล้ว

    Can you create a tutorial for preamp for microphone with the dsp?

  • @personalsergio
    @personalsergio 4 ปีที่แล้ว +1

    Thanks so much for your videos! only one question, can i use this code with the DAC of the discovery board? What I need to change to make it work with it? Thans!

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  4 ปีที่แล้ว +2

      No this demo code only works with the external PMOD audio board. I didn’t try to use it with the onboard DAC. Sorry

  • @lloydlobo3174
    @lloydlobo3174 4 ปีที่แล้ว +1

    I am using an STM32F407VG. I downloaded the code to check if my board mic works. The code did not do anything. Can you confirm the hardware and software requirements of this project?

    • @rashadshubita1941
      @rashadshubita1941 4 ปีที่แล้ว

      same here!

    • @romiolover6852
      @romiolover6852 3 ปีที่แล้ว

      i think he used an external codec not the built in one on the board

    • @leoponce82ponce
      @leoponce82ponce 3 ปีที่แล้ว +1

      It's because he is using external codec, to use internal codec (audio jack), use the MY_CS43L22 library from th-cam.com/video/QIPQOnVablY/w-d-xo.html&ab_channel=MutexEmbedded-Education. If you use the same code from YetAnotherElectornicsChannel it will work just by starting the internal codec in I2S Mode. (remember to make the two wire connections mentiones it the video (clock from i2s3 to i2s2))

  • @mudpie-studio-v1c
    @mudpie-studio-v1c 4 ปีที่แล้ว

    Yet another cool video ! Thanks for sharing your knowledge :)

  • @erickleiss6660
    @erickleiss6660 3 ปีที่แล้ว

    Great video, how would you send the PCM data over Uart?

  • @remi5580
    @remi5580 2 ปีที่แล้ว +1

    Hey, I have a question, why do you have "Hal_SAI_receive.... ,64);" instead of "Hal_SAI_receive...,128);", considering that pdmRxBuf size is 128 ? With your code, doesnt pdmRxBuf(64->127) all equal to 0?

    • @jvdev5686
      @jvdev5686 4 หลายเดือนก่อน

      This is a great question. I see by debugging that the second half of the pdmRxBuf is not zero, but I don't understand why. I too think I would normally start DMA with a length of 128, yet this causes the program to misbehave badly!

  • @leoponce82ponce
    @leoponce82ponce 3 ปีที่แล้ว

    Hey man.. thanks again for all your work.. is it possible to use only one I2S interface.. like in previous videos.. in full duplex mode .. to use the mic and output the signal ?

  • @anilkoluacik
    @anilkoluacik 2 ปีที่แล้ว

    Hey, there are some pins denoted as GPIO_Output? How did you decide them? Can you please explain?
    Thx for your valuable response.

  • @47lokeshkumar74
    @47lokeshkumar74 4 ปีที่แล้ว +2

    show the hardware connection also

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  4 ปีที่แล้ว +1

      Please check 5:52. There it is shown

    • @47lokeshkumar74
      @47lokeshkumar74 4 ปีที่แล้ว

      @@YetAnotherElectronicsChannel I am using wolfson audio card with sm32f407vg. How can I know whether my board i working or not. s there any code for this? bro.
      Thanks

  • @กฤชพลเกตุชู
    @กฤชพลเกตุชู 4 ปีที่แล้ว

    You guy is amazing. I lerned a lot from you.

  • @chengL10
    @chengL10 4 ปีที่แล้ว

    thanks for your time and your knowledge!

  • @SasukeUchiha-mj2vh
    @SasukeUchiha-mj2vh 3 ปีที่แล้ว

    Also connected PDM microphone. There is the white like noise. With analog micrphones its ok it has clear sound. And in your video the PDM to PCM sound is not high quality. Is it acceptable for MEMS PDM microphones with PCM conversion or there is a methods to improve the quality?

  • @alldudu4583
    @alldudu4583 ปีที่แล้ว

    Hello I'm building an audio circuit with the built-in PDM microphone and the 24-bit DAC CS43L22. So far i've only manage to build one via USB-Host. How can i build a similar demo such as yours? Thank you so much and love your video it was very helpful :)

  • @IONGROZEA
    @IONGROZEA 3 ปีที่แล้ว

    Congratulations, very good quality tutorial. Do you have time to make one where the PDM signal is fed to spectrum analyzer?

  • @danteforonoro9759
    @danteforonoro9759 4 ปีที่แล้ว

    Perfect timing! Thanks a lot!

  • @kishoresaldanha815
    @kishoresaldanha815 4 ปีที่แล้ว

    At 14:15 what is the guarantee that fifo_buf won't overflow ?

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  4 ปีที่แล้ว

      The input stream and output stream are derived from the same BCLK. So they are exactly in sync. So there won't be any buffer overflow / underflow

  • @leoponce82ponce
    @leoponce82ponce 3 ปีที่แล้ว

    sorry for my confusion.. the output sound is going to the integrated DAC right? if so.. is the DAC connected to the black headphone jac? how are you getting the sound from the DAC ?

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  3 ปีที่แล้ว +1

      No I have used an external DAC converter (on the PMOD I2S2 Board). And that output I had recorded via the line inputs of my Zoom H4

    • @leoponce82ponce
      @leoponce82ponce 3 ปีที่แล้ว

      @@YetAnotherElectronicsChannel thank you so much. Amazing videos.

  • @ghaithkadri7544
    @ghaithkadri7544 3 ปีที่แล้ว

    Please can you explain to me further the role of HAL_I2S_TxHalfCpltCallback. Because I did not find a good explanation on the Net ?

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  3 ปีที่แล้ว +1

      For all sort of processing activities where you have a continuous data flow (and audio is such an application use-case) you are usually using double-buffers. Most DMA engines of the different uC's are supporting that usually.
      The idea is: You always have one buffer where you are the processing on with your processor-core and the other buffer is used to transmit/receive.
      As soon as the tx/rx operation is finished on one buffer, it will start rx/tx on the other buffer and you can start processing on the first buffer. This is doing then a ping-pong back and forth between those two buffers.
      Here in this example, you have one big array of data which is "virtually" divided in two buffers. The Half- and Full- complete callback are then indicating which buffer is ready to process.

    • @ghaithkadri7544
      @ghaithkadri7544 3 ปีที่แล้ว

      It's very kind of you to answer me.
      If you don't mind, can i send you some questions by email where I found problems?

  • @FRDETsdfs
    @FRDETsdfs 3 ปีที่แล้ว

    What changes do you have to make to the configuration to make it work for two channels (two PDM microphones)? I assume you have to set in_ptr_channels = 2. Are there any other changes you would need to make to the configuration?

  • @jerrymcway
    @jerrymcway 4 ปีที่แล้ว

    Great video, thanks for the good explanation!

  • @kriskmm8544
    @kriskmm8544 4 ปีที่แล้ว +1

    Life saving ❤️️❤️️

  • @kionmahuermicio9860
    @kionmahuermicio9860 4 ปีที่แล้ว +1

    Great Video! You Should implement some "chorus" effect on the STM32

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  4 ปีที่แล้ว +1

      At least I have some video about reverb effect: th-cam.com/video/nRLXNmLmHqM/w-d-xo.html

    • @kionmahuermicio9860
      @kionmahuermicio9860 4 ปีที่แล้ว

      @@YetAnotherElectronicsChannel Yes, i already seen it.

  • @syedafzal2062
    @syedafzal2062 3 ปีที่แล้ว

    Microphone beam forming????

  • @syedafzal2062
    @syedafzal2062 3 ปีที่แล้ว

    NOT GETTING ANYTHING IN pdmRxBuf[]

  • @nova0302
    @nova0302 ปีที่แล้ว

    Hello! Bro
    I really appriciate and enjoy your videos.
    But I'm wondering about fifo pointers in your source code.(like fifobuf_w_ptr, fifobuf_r_ptr).
    They are increasing every time the functions like FifoRead(), FifoRead() are called. Is it Ok?

    • @YetAnotherElectronicsChannel
      @YetAnotherElectronicsChannel  ปีที่แล้ว +1

      I haven’t checked the code but I think they’re relying on the fact that they start again with 0 as soon as they overflow. For an 8 bit unsigned type then at 255

    • @nova0302
      @nova0302 ปีที่แล้ว

      @@YetAnotherElectronicsChannel Oh! I see. the fifo array size is 256 and the type of fifo_r_ptr and fifo_w_ptr are uint8_t, Thannks bro.

  • @dansnazelle8553
    @dansnazelle8553 4 ปีที่แล้ว

    thanks so much for this very useful video

  • @hlw8051
    @hlw8051 4 ปีที่แล้ว

    so useful

  • @alimohammadi2344
    @alimohammadi2344 2 ปีที่แล้ว

    very good 👍

  • @edgull_tlt
    @edgull_tlt 3 ปีที่แล้ว

    Спасибо

  • @casper5314
    @casper5314 ปีที่แล้ว

    techRizz