[#5] IIR Filters - Audio DSP On STM32 with I2S (24 Bit / 96 kHz)

  Рет қаралды 75,130

YetAnotherElectronicsChannel

YetAnotherElectronicsChannel

4 жыл бұрын

In this video I want to show you how you can setup a realtime audio signal processing chain on a STM32F4 microcontroller running on 96 kHz with 24 Bits resolution (how to setup the hardware modules and how to use the DMA correctly).
See my Github to download the code:
github.com/YetAnotherElectron...
Used hardware:
Pmod I2S2 Stereo In/Out Board
store.digilentinc.com/pmod-i2...
STM32F407G-DISC1 Evalboard
www.digikey.de/short/pd8tnp
Music: www.bensound.com
Other videos of my channel:
How to design a Class-D amplifier?
• [#2] Designing A Discr...
How to design a fully discrete Class-AB amplifier?
• [#3] Designing A Fully...
How to get a cheap 3D printed speaker sounding great?
• [#1] 3D Printed Speake...

Пікірлер: 184
@TheGmr140
@TheGmr140 4 жыл бұрын
finally a 21st century blog on electronics and DSP, well done Sir.
@pelotonnoob2123
@pelotonnoob2123 4 жыл бұрын
Please keep these series going. It is awesome
@demoncloud6147
@demoncloud6147 4 жыл бұрын
So good, Your channel is not just 'YetAnotherElectronicsChannel' that blinks LED ! It's deep.
@damny0utoobe
@damny0utoobe 4 жыл бұрын
This is an excellent video. I searched for audio filtering with STM32. I wasn't disappointed as this jumped right into an actual implementation using cubemx.
@AdilKhan-jp7hn
@AdilKhan-jp7hn 3 жыл бұрын
This is exactly the audio signal details I needed to get my project working. Thank you for such detailed video and excellent content. Thanks
@harrykaradimas857
@harrykaradimas857 4 жыл бұрын
Great video ! I understood for the first time how IIR filters can be implemented "by hand" !
@wolfgangbeginners-mind2853
@wolfgangbeginners-mind2853 3 жыл бұрын
Thanks for taking the time to go through all the STM32CubeMX parameters, and offering the code as well. It has been invaluable to getting me past the WALL of ARM stuff, and has maid it much clearer to dive in and get things working. Skoll!
@thatboy_mikejones2094
@thatboy_mikejones2094 4 жыл бұрын
Awesome video, can't wait for more dsp vids
@GilgaFrank
@GilgaFrank 4 жыл бұрын
Many thanks for this! An excellent discussion of I2S DSP.
@AAFX-OM
@AAFX-OM 4 жыл бұрын
I am so glad I stumbled upon this channel... Thank you for making these...
@mUbase
@mUbase 4 жыл бұрын
Yes!! Brilliant video. Excellent descriptions of the hardware and nice diagram of the input, filter and Z transform. Thanjks!!
@kissingfrogs
@kissingfrogs 3 жыл бұрын
nice. i finally get to see an implementation of IIR from block diagram theory to DSP code. It helped answer so many questions. thanks
@jonatanrrz
@jonatanrrz 8 ай бұрын
I just reproduced your project. I used the WM8782 ADC with the same settings, it worked perfectly. The HAL complete callbak is already fixed in newer versions. Your video detailing the settings in STM32_Cube_IDE was very useful. Thank you very much for providing such educational material on this subject.
@MickeyMishra
@MickeyMishra 3 жыл бұрын
24:05 signal before the crossover 25:02 crossover two-way applied/ thank you so much for giving us this example it really does mean a lot of people like me that don't necessarily ingest code very well and are more of a visual and audible kind of folk.
@diggleboy
@diggleboy 3 жыл бұрын
Fantastic video! Never knew I2S with DSP could perform so well at audio frequencies. Great walkthrough on how you learned and overcame some of the challenges you faced.
@einball
@einball 2 жыл бұрын
I2S, not I2C
@diggleboy
@diggleboy 2 жыл бұрын
@@einball Thanks for the correction.
@einball
@einball 2 жыл бұрын
​@@diggleboy You're welcome! I didn't want to be nosy but I also couldn't let the thought that 'someone is wrong on the internet' bug me during the night! :-^)
@hunterwhyte1208
@hunterwhyte1208 3 жыл бұрын
incredibly useful and well put together video, thanks so much
@soyboy3274
@soyboy3274 4 жыл бұрын
Really a great explanation! Hope you stay in the lane of audio processing, because there is little simple to understand information out there with code examples to look at etc. Really appreciate the video! Also a little PS: im really curious about the audio enhancement algorithms / for example the harmonic generator you showed of in your first video.
@user-hm9wi7be6t
@user-hm9wi7be6t 9 ай бұрын
Thank you so much for sharing this. It was very helpful in getting started with audio DSP!
@awaterplease7885
@awaterplease7885 4 жыл бұрын
Great video dude! Looking forward to more content.
@tamtam4321
@tamtam4321 4 жыл бұрын
thank you so much, I've learned a lot from your videos. Keep up the good work !
@mathemabeat009
@mathemabeat009 4 жыл бұрын
That!!! That is amazing!!! Thank you so much for sharing this video
@hlw8051
@hlw8051 4 жыл бұрын
great stuff! Keep it up brother
@robertmonroe9728
@robertmonroe9728 3 жыл бұрын
Amazingly useful video to start!
@embeddedmicrocontroller
@embeddedmicrocontroller 3 жыл бұрын
Good
@arkadiuszkrupinski6225
@arkadiuszkrupinski6225 3 жыл бұрын
Really nice job. Thank you for the video!
@PATRIK67KALLBACK
@PATRIK67KALLBACK 2 жыл бұрын
Nice project! I think I will test this, as well as your pitch shifter project
@ralfaralf6805
@ralfaralf6805 4 жыл бұрын
Wow, thanks so much for this!
@dmitr8194
@dmitr8194 4 жыл бұрын
Awesome! I should try it on ESP32 Also I find your another one video with reverberation very interesting. I had experiments in my childhood with IC chips. There was TTL like RAM for delay and a opam for ADC for implementing the reverberation machine. It was device sized like shoes box. Haha.. After four of mounts assemble and fix wired issue its had been working!
@tallabrianmonde3021
@tallabrianmonde3021 Ай бұрын
Thanks so much for your generousity Sir
@0x80O0oOverfl0w
@0x80O0oOverfl0w 4 жыл бұрын
I like this video, and your series as well. I have several STM32 dev boards so I'm looking forward to trying out some more examples. One thing I noticed missing was your clock configuration. With the steps presented in the video, the option to select an external 8MHz clock was grayed out. It wasn't until I did some digging that I learned the option was unlocked when you configured RCC in the System Core category, but the problem is I have no idea what the correct settings are supposed to be for the RCC. Also, it would be cool to figure out how to use the mems microphone and audio out that is already on the board, without having to use an additional (pmod) component. Keep up the good work!
@personalsergio
@personalsergio 4 жыл бұрын
Thanks so much! awesome video!
@syedafzal2062
@syedafzal2062 2 жыл бұрын
you are great Sir ....................... I hope you will make more such videos
@Andy-ph1qj
@Andy-ph1qj 4 жыл бұрын
Great video!
@ajoyraman1409
@ajoyraman1409 Жыл бұрын
Great job!
@perceptron9834
@perceptron9834 2 жыл бұрын
Great tutorial
@tosicz
@tosicz 3 жыл бұрын
Good work!
@sampaths82
@sampaths82 2 жыл бұрын
Useful project .thank you
@paulg.3067
@paulg.3067 4 жыл бұрын
great work
@alarmkoguvenlik
@alarmkoguvenlik 4 ай бұрын
You are great. Thank you.
@josemq0x158
@josemq0x158 3 жыл бұрын
gracias amigo por compartir tus conocimientos
@lekmamiex1634
@lekmamiex1634 2 жыл бұрын
Very good.... Waiting for the next tutor to combine with VHF transmitter Kind regards....
@HxcTufty
@HxcTufty 3 жыл бұрын
One thing worth noting, as I develop a similar project and I use this as an example, is that the callbacks with the default configuration are called twice per sample. One time they are called for Rx and one for Tx. In this example it doesn't matter as the code does the same thing twice with no consequences to data. However in my application I had counters and I would notice that they would count the double amount from what I ve seen on the analyzer. The workaround is to disable either Tx or Rx DMA interrupt so that the callbacks are called one time per half/full transfer.
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 3 жыл бұрын
Thank you. Someone else also mentioned this already. I would pin your message here in comment field..
@giorgitsintsadze9919
@giorgitsintsadze9919 3 жыл бұрын
did you just trust STM32 to finish handling each interrupt before moving to other ? or did you calculate how much time it would take to process data and compared to time it takes to fire each interrupt. I kind of got lost there. In case of FFT, where I believe you need to fill much bigger buffer (because of frequency resolution and etc) you would not process it before another RxReceived callback would be fired.
@edgeeffect
@edgeeffect 3 жыл бұрын
Do you have a link to your project's code?
@HxcTufty
@HxcTufty 3 жыл бұрын
@@giorgitsintsadze9919 What I do in that project is double buffering because I dont want to mess up with timings and disabling interrupts. So in case of FFT you can have 2 buffers of same size. One should gather data from i2s until is full. Once full you would switch to the other buffer and simultaneously calculate fft on first buffer.
@HxcTufty
@HxcTufty 3 жыл бұрын
@@edgeeffect nope sorry I cant share
@na5y
@na5y 4 жыл бұрын
Great video. A couple of questions if I may. I saw that the I2S_ex drivers are available for the STM32F4 but not for the F7 - any ideas why that might be? The I2S support is there in Cube for F7 but the Full duplex mode isn't supported. Also - did you capture both the half and full complete callbacks to give you and extra window of processing? I didn't quite understand that. Anyway - great series of videos, thank you !
@embeddedmicrocontroller
@embeddedmicrocontroller 3 жыл бұрын
Good job
@warrencookson8549
@warrencookson8549 3 жыл бұрын
Great video, I am going to use this as my introduction to DSP with a microcontroller! I was wondering what the input signal looks like? Can I use a bi-polar input or do I need to do the whole biasing thing between 0 - 3V's?
@theo5773
@theo5773 3 жыл бұрын
Good video
@Synthetech
@Synthetech 2 жыл бұрын
Hi. Great video. I've been doing a lot of work with a DAC and looking to dabble in ADC. In your vid at around 9:30 you said the uC can't generate exactly 96kHz. Did you try to tune it in any further using the PLLI2S multiplier in Clock Config? (seen at ~7:50 at the bottom) You should be able to increase or decrease the multiplier a bit to tune the error percentage in closer to the target frequency. It usually won't pull it in exact, but it should be able to tune in to less then 1% error.
@Mr_ASIC
@Mr_ASIC 4 жыл бұрын
please keep posting
@AlexLisiReal
@AlexLisiReal 3 жыл бұрын
thank you
@alessiobianchi8039
@alessiobianchi8039 3 жыл бұрын
Thanks for your video. May I ask you the connection between the PMod I2S2 board and the STM32F407 Discovery board? I don't know where to connect the pins of the DAC of the I2S2. Thanks in advance!
@babotvoj
@babotvoj 4 жыл бұрын
how did you wire up your boards, because i wired them up with some jumpers and connected my headphones to the DAC. The result is that I can hear the music but I have noise.
@nicknagy8903
@nicknagy8903 4 жыл бұрын
Also what should the data width be set at for the circular mode DMA settings in STM32CubeMX? Byte? Half word? Word?
@andrewandrosow4797
@andrewandrosow4797 3 жыл бұрын
Good work! Is (there) any way to configurate an I2S bus with LL drivers?I tried to build a project with stm32f303vct6, but there in the CubeMX ( "ProjectManager->advanced settings" ) is a one pukt next to I2S: it is HAL.
@felipegarciaencina5117
@felipegarciaencina5117 4 жыл бұрын
Hello, I'm looking to implement filters on a ESP32, you have experience in that platform?. Would be only 16 kHz sampling. with bandpass filters.
@HB9GZE
@HB9GZE 3 жыл бұрын
very good!! Thank you, I did learn a lot! The ADC takes an Input of 0 - 3.3V. Do you use an op-amp adder with 1.5V at the ADC to allow for the AC audio input? How much CPU load does this example finally take? What is the heaviest load; the IIR filter, the int handling...?
@HB9GZE
@HB9GZE 3 жыл бұрын
I do have a question: did you ever compare the STM32F4 IIR filter response to the theoretical/calculated transferfunction? I find an offset of several hundert Hz and cant explain why (the true sampling freq. is lesss then 96kHz; but only 2% or so)...
@dansnazelle8553
@dansnazelle8553 4 жыл бұрын
do you have any advice on Where in the code to control TIME with a pot (say time= time*(float) pot1; when i put that into the main it breaks. but without that line my adc works and sound and reverb work. so just need to figure out where it doesnt break the i2s. thanks :)
@Bianchi77
@Bianchi77 3 жыл бұрын
Cool info :) Is it possible that I use PCM5102 Decoder Board ?
@valdeciribeiro7839
@valdeciribeiro7839 4 жыл бұрын
Hello, congratulations on your work. what is the possibility of building a musical keyboard with stm32, how to do that. Can I play musical notes with this?grateful
@KenDedes94
@KenDedes94 4 жыл бұрын
Hello, thank you so much for the video. I have a question about debugging it in STM 32 IDE, It kept saying debugging connection lost? Can you tell me what kind of configuration you used for debugging it? Or maybe the way I flash it to the board wrong?
@S-MKim
@S-MKim 2 жыл бұрын
Did you find the answer? Is it an error?
@nicknagy8903
@nicknagy8903 4 жыл бұрын
Great video, thank you! I'm using an STM32F767ZI, it does not have full-duplex I2S interfaces but does have multiple half-duplex ones. Instead of HAL_I2SEx_TxRxCplt(), I have HAL_I2S_TxCplt() and HAL_I2S_RxCplt(), etc. For two half-duplex I2S interfaces do I need to make sure the transmitting interface is initiated / started first? Does it matter which interface is connected to the Pmod ADC and which to DAC? Does it matter which one is in master mode and which is in slave mode? Any pointers would help me out, thanks!
@sebastienvezina9158
@sebastienvezina9158 3 жыл бұрын
Hi! Did you ever figure that one out? I'm having that exact same issue on the F730. Thanks!
@eventhatsme
@eventhatsme 3 жыл бұрын
Excellent video! Is it really necessary with the "Master Clock Output" selection? I see that there are two lines that appear to have a clock signal: I2S2_CK and I2S2_MCK. Could you tell me the difference? Another thing: Have you set the DMA buffers to byte (8 bits), half word (16 bits) or word (32 bits)?
@eventhatsme
@eventhatsme 3 жыл бұрын
I guess I'll answer my own question: If the I2S unit has internal PLL it would suffice to disable the master clock output and use only the I2S2_CK line as input to the SCK of the unit. I think your setup use half word for the DMA, as this was working out nicely for me.
@adamskii0170
@adamskii0170 Жыл бұрын
I have tried to follow along with this but am having trouble when connecting the PMOD ADC and DAC, and cannot seem to pass through audio. Do you have any recommendations or can you indicate how to wire this? I noticed the LR clock connection is not shown on your block diagram and want to know where this connection would be applied :)
@panaromattt2177
@panaromattt2177 3 жыл бұрын
Teacher, How can I get the microphone on stm32f4 to realize some applications about Dsp. Thank you
@user-px4tj9cp9u
@user-px4tj9cp9u 4 жыл бұрын
Thank you, I will try, I would show you directly in the video how everything on the Board is tested. How much does Jack 3.5 need? There's only one on the Board, won't it be enough? 2) Is there a project implementation on SPL (LL)?
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
Yes there is an audio-codec on the board for audio output. However you don't have any audio input besides a microphone and you also have to configure the audio codec before with I2C. Using the PMOD I2S2 board here is quite more easier as you don't have to do software configurations first.
@chaowang2771
@chaowang2771 4 жыл бұрын
Great video! I'm a complete newbie here. I have a couple of questions. 1. Should the Pmodi2s2 be set as master mode or slave mode? 2. Should the VCC of Pmodi2s2 be connected to 3V or 5V output of STM32F407? 3. Is the LineIn of Pmodi2s2 connected to computer and LineOut connected to a headphone? Look forward to your answer. Thanks!
@mukulmalviya1605
@mukulmalviya1605 2 жыл бұрын
you got any answer
@TheRein10
@TheRein10 4 ай бұрын
Hi, excellent project. I would ask about signal input and output to board. Are you connect signal output (from PC) direct to LINE IN on board and LINE OUT from board to microphone input on PC? I’m afraid about signals level. Could you describe how are you connect this ? Thanks.
@shibillkhadri1937
@shibillkhadri1937 3 жыл бұрын
Is it also possible to have a real time auto tune effect based on Fourier transformations. How could one go about such an idea?
@felipeyoshino640
@felipeyoshino640 2 жыл бұрын
Hi there. Can you suggest me a ST MCU that can process 7.1 audio (8ch) through 4 stereo I²S lines, streaming it to my DAC? I'm actually working on my final eng grad project and I need to process multi channel decoded audio comming from HDMI interface. It has been so hard to research such kind of content on YT. Nice video. Thanks!
@oldhabbitsdiehard
@oldhabbitsdiehard 2 жыл бұрын
Hi, Can i implement this on STM32F103C8T6 Blue Pill Development Board or STM32L100C-Discovery board?
@user-xh9cj7in3p
@user-xh9cj7in3p Жыл бұрын
Is it possible to provide a link to the researchgate information you have displayed?
@lucastosetto2900
@lucastosetto2900 3 жыл бұрын
How can I configure the DSP to communicate with windows via USB? So I can use a similar system as an audio interface
@damonmccartney1168
@damonmccartney1168 4 жыл бұрын
Loving these videos, very clear explanations! However, when I upload to my board the results are noisy af! Any tips? Wires leading to the DAC/ADC are short etc, not sure how you get such crisp recordings. I get some strange artefacts.
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
How did you distribute the clocking? What converters are u using? Did u check the I2S signals with the scope ?
@damonmccartney1168
@damonmccartney1168 4 жыл бұрын
@@YetAnotherElectronicsChannel hello! Just loaded up your project files and uploaded. Same boards etc as you are using in your video! Will have a scope tonight and see if it's something obvious. A fellow audio and electronics enthusiast so love your videos!
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
Damon McCartney what I was doing always wrong is that I exchanged sometimes the datelines from/to ADC / DAC ... and for sure the clocking signals like MCLK, SCLK und WS are only available once on STM side but need to be spreaded to both ADC and DAC. The 3.3V supply can be taken directly from the STM32 board
@vahidsamavatian8324
@vahidsamavatian8324 4 жыл бұрын
This video is really interesting. Thanks for sharing it. I have some problems with its implementation. rxBuf[0] is allocated to MSB of L-channel and rxBuf [1] is allocated to LSB of L-channel. LSB has to be in this format/: 0xKL00 in which K and L can be anything. But the most important thing having to be noted that the least Byte of LSB is 00. However, in my implementation based on your explanation, it is not. Another Thing I have problem with is that float out of filtering is unreasonably high. I checked filtering parameters. Everything seems OK. Could you please help me in this regards.? Many thanks
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
Did you try to compile my project? Was this working? Which device to you exactly use?
@skylercornell7996
@skylercornell7996 4 жыл бұрын
Thank you, I learned a lot! One question: The incoming i2s data stream is 24 bit left aligned, so I would have expected to see a shift right by 8 to restore the incoming data to how the processor interprets data (right aligned). int lSample = (int) (rxBuf[4]
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
I²S is transmitting the data in signed integer format (means 2's complement) with the sign-bit being transmitted directly at the beginning. In 32-bit integer, the sign-bit is also most MSB bit. Of course you could shift the data low by 8, but you have to care, that still the sign-bit is on the correct position for also 32-bit integer data type (means that is not just a bit-shift but an arithmetic bit-shift). In the end it doesn't care if all the data values are scaled up by 255 or not. The risk in my implementation for sure is that you can get faster numeric overflows then if you are near to clipping level.
@skylercornell7996
@skylercornell7996 4 жыл бұрын
@@YetAnotherElectronicsChannel that makes perfect sense, can't wait to learn more from your videos !
@Scytherfreak
@Scytherfreak 4 жыл бұрын
Hi, with regards to the DMA interrupt.. I have a suspicion that the TxRxHalfCpltCallback is called twice and then the TxRxCpltCallback is called twice due to both DMA streams triggering everytime. Is this possible?
@theimunten6325
@theimunten6325 4 жыл бұрын
O yes!..you found that to..:-).. I put that remark at the bug report on github Quick fix: comment out the Dma interrupt associated with the send
@isoslow
@isoslow 2 жыл бұрын
Is it possible to get proper 96 kHz instead of proposed 93.75?
@michaelzemah1476
@michaelzemah1476 10 ай бұрын
I'm working on a project using STM32F411 Disco board, and it is connected via Fullduplex I2s and DMA like you described. I have a hard time getting the samples right and having math manipulations not corrupting the output. I'm stuck on this issue for 2 days now, and I watched your video & Phil's Lab's videos multiple times, and no matter what bitwise operation I perform on the input data, the output is getting corrupted. Can you maybe help me via a short zoom meeting? of chat about it privately ?
@dansnazelle8553
@dansnazelle8553 4 жыл бұрын
is there anything special about this codec or would these videos work for example with the WM8731? thanks for this great series
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
dan snazelle WM8731 will also work, but will need some modification as it needs to be configured before
@dansnazelle8553
@dansnazelle8553 4 жыл бұрын
@@YetAnotherElectronicsChannel yes i tried to build it :) but i am now reading it needs to enabled..however i am not sure where to do this. (seems it must be enabled via i2c?) anyway excellent videos.
@elakeee2921
@elakeee2921 3 жыл бұрын
How can we read and copy the uploaded code from STM32F405RGT6? Please can you explain
@davidkain9046
@davidkain9046 3 жыл бұрын
How connect stm32 board to i2s board?
@babotvoj
@babotvoj 4 жыл бұрын
The ADC you used is for audio signals, because it has ainr and ainl inputs. Do you know a similar adc that can be used for single signal? Or can I just use one of the input ports of the ADC and connect the other to ground?
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
Audio ADCs are typically always in stereo. There also some on the market which even have 4 or 8 audio channels. But always a multiple of 2. And yes, you can keep one input floating or connect to GND via a capacitor and then process only the samples of one channel inside the DSP
@babotvoj
@babotvoj 4 жыл бұрын
@@YetAnotherElectronicsChannel thank you very much for the quick answer
@marceldolnak3604
@marceldolnak3604 4 жыл бұрын
Hi What program do you use to calculate the IIR filter in your project ?.
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
Marcel Dolnák have a look here: www.earlevel.com/main/2013/10/13/biquad-calculator-v2/ ... or if you are interested to calculate it yourself look here www.w3.org/2011/audio/audio-eq-cookbook.html
@marceldolnak3604
@marceldolnak3604 4 жыл бұрын
@@YetAnotherElectronicsChannel Well thank you :-)
@antoniomartos2343
@antoniomartos2343 3 жыл бұрын
First, thanks for the great video!!! Second, does DSP library work on nucleo-L476RG?
@asunavk69
@asunavk69 3 жыл бұрын
No, since that board has no i2s, i also was researshing for that, and according on this site:stm32duinoforum.com/forum/viewtopic_f_29_t_4181.html, there's some way to make it work with i2s, but it would mean more work.
@antoniomartos2343
@antoniomartos2343 3 жыл бұрын
@@asunavk69 Oh but thats for the final part of the video. I just need fft and FIR lowpass filters. I tried a low pass filter and it worked perfectly. Thanks for everything and continue with the good work.
@asunavk69
@asunavk69 3 жыл бұрын
@@antoniomartos2343 idk what fft is but if a FIR low pass works for you then ok, did you do it with the l476rg?
@antoniomartos2343
@antoniomartos2343 3 жыл бұрын
@@asunavk69 fft means fast fourier transform for having signal in frecuency domain. FIR lowpass worked perfectly. Thanks a lot!!
@p_mouse8676
@p_mouse8676 4 жыл бұрын
It wasn't totally clear to me, but do you know the max samplerate? Is 192kHz possible for example?
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
Yes, 192 kHz is possible. Just checked it in the CubeMX Software.
@isoslow
@isoslow Жыл бұрын
I still hope you would reply on how to generate correct audio clock... Is this even possible with STM32F series?! More than 2.34% deviation is unusable if I say want to stream predefined sample rate stream from USB for example. In fact, any deviation would be unacceptable in this case :( .
@SuperLeoSG
@SuperLeoSG 4 жыл бұрын
really cool, but i'm curious to know, why you need such LF HF filtration? What is for?
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
Leonid Sobolev there is not sense behind 1 kHz high- and lowpass. It’s just a demo
@vectorsize
@vectorsize 4 жыл бұрын
Great example, thank you! did you use the default pins for the STM board? could you please share the pin to pin STM/Pmod connections you used for this to work? thanks ^^
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
The pinning of the STM32 you can see in the block diagram quite at the beginning of the video
@vectorsize
@vectorsize 4 жыл бұрын
@@YetAnotherElectronicsChannel oh, sorry I must have missed that detail..., thanks!
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
Check out roughly 3:10 for example
@vectorsize
@vectorsize 4 жыл бұрын
@@YetAnotherElectronicsChannel yep, there it is... I somehow overlooked it thinking this diagram was more conceptual 😅
@patrickmojica6558
@patrickmojica6558 4 жыл бұрын
@@YetAnotherElectronicsChannel Thank you your videos and code are very helpful. I'm trying to implement your phase vocoder to do pitch shifting in a DSP project i'm working on for school. I do have a question to solve a problem I've encountered: I see that the PmodI2S2 has separate pins for the ADC and DAC side, but both need the same clock signals: MCLK, LRCK (WS), and SCLK. Did you short these pins together on the pmod board somehow or did you configure pins on the STM32F4 to give you duplicates of the clock signals ?
@jonathanwogerbauer2703
@jonathanwogerbauer2703 2 жыл бұрын
Hallo, eine Frage: am Anfang sagst du ja deine Master Ck ist 6,144MHz und deine BLCK ist 24,576 MHz. Aber in deiner Clock Configuration (7:55) hast du bei deiner I2S Clock 96 MHz eingestellt? Wie ergibt sich da der Zusammenhang? Und über welche Parameter steuert man die Bit und Master Clock? Liebe Grüße
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 2 жыл бұрын
Du hast natürlich recht - das ist bisschen verwirrend. Mit 96 MHz wurde das I2S Modul getaktet. Eigentlich keine valide Frequenz, wenn man die Audio-Clocks exakt treffen will. Korrekterweise hätte die Clock da z.B. 98.304 oder 49.152 MHz sein müssen. Damit würde man dann durch 2^x Teiler dann entsprechend die Frequenzen wie 24.576M, 96k, 48k, 6.144M treffen. Normalerweise reserviert man für das audio-clocking eine eigene PLL, die diese "krumme" Frequenz dann erzeugt. In dem Beispiel war die reale sampling-requenz dann eher 93.75 kHz statt 96k
@drdream123
@drdream123 3 жыл бұрын
I'm trying to do what you do except with Analog Devices Blackfin BF533 for 8 channels.. can I hire you to help?
@LOFIAD
@LOFIAD Жыл бұрын
As i don't have the exact same chip, My configuration does not end up being the same and so I just hear white noise. The callback line is not there as well as some peripheral related stuff. Help! --- Update: my setup only worked with half word for reasons I don't understand
@nhatcomnhom
@nhatcomnhom Жыл бұрын
hi bro, at the schematic, i connect those stuff like your draw but it seem like WS, MCLK, SCLK cannot be connect at the same port (TT), i used i2s3 with audio jack out on board and pmod i2s as an input (i put it on slave mode), can you show how to connect it on board plz. Further more, seem like void HAL_I2SEx_TxRxCpltCallback and void HAL_I2SEx_TxRxHalfCpltCallback cannot work (i mean they dont fire even thought i fix the bug like your video). when i test HAL_I2S_Transmit_DMA to output sin wave sound it works , but HAL_I2SEx_TransmitReceive_DMA dont work (TT), hope you see my comment best regards
@assertivebird
@assertivebird 3 ай бұрын
Nice video! I would recommend doing filter processing in the main loop though.
@robertbristow-johnson6362
@robertbristow-johnson6362 Ай бұрын
I certainly wouldn't.
@assertivebird
@assertivebird 5 күн бұрын
@@robertbristow-johnson6362 aren't interrupt handlers supposed to be as fast as possible? All the heavy processing then is done in the main loop or separate task.
@robertbristow-johnson6362
@robertbristow-johnson6362 3 күн бұрын
@@assertivebird No not necessarily. In real-time DSP, we would put all of the sample-by-sample processing in the interrupt handler. If we are processing samples in blocks, then DMA would get the samples in and out, but the interrupt that occurs when the DMA is full would do all of the sample processing for the block.
@kerimzengin6317
@kerimzengin6317 2 жыл бұрын
Unfortunatelly,i dont have pdm microphone so i have to use stm32 microphone but i couldnt do that please someone help me?
@iotworld9673
@iotworld9673 Жыл бұрын
Hii sir big fan of your content, just in case you have some work or any project and you want some helping hand i am in.
@johnsaeid95
@johnsaeid95 4 жыл бұрын
I have an urgent question to me when you use 24 bit I2S Does the STM send 24 bit frame or send a 32-bit frame and the consider the least 8-bit ro be zeros ? plz respond
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
Hanna Nabil u are right, 24 bit audio is actually transmitted in 32 bit frames. The 8 LSB are 0‘s
@johnsaeid95
@johnsaeid95 4 жыл бұрын
@@YetAnotherElectronicsChannel but when use DMA ( half word) and you use I2S_dma which take 16-bits data Does the I2S still preserve the 32-bit frame ?
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
Hanna Nabil DMA is working in 16 bit mode, but two 16-words behind each other are building a 32 bit word. You can cast the 16-bit pointer directly to a 32-bit pointer
@johnsaeid95
@johnsaeid95 4 жыл бұрын
@@YetAnotherElectronicsChannel you are right But Does the I2S will still send clock cycle for the least 8-bit even they are always zeros Um asking because I am using a codec with 24-bit DAC which let me choose between 24 , 32 bit I2S
@YetAnotherElectronicsChannel
@YetAnotherElectronicsChannel 4 жыл бұрын
Hanna Nabil yes there will be another 8 clock cycles even if it is 0‘s
@robertbristow-johnson6362
@robertbristow-johnson6362 Ай бұрын
These two lines *must* be in error (assuming int is 32 bits). int lsample = (int) (rxBuf[0]
@serkansatuk4784
@serkansatuk4784 3 жыл бұрын
Hi, thanks for this great video. I used stm32f411ceu6 board ( stm32-base.org/boards/STM32F411CEU6-WeAct-Black-Pill-V2.0.html ) and activated i2s2 on full duplex master mode. İ2s2 Clock frequency to 96 kHz. After that i generated code but not worked. I checked İ2s2 pins with logic analyzer. O couldn't get any clock signals on the pins. Could you help me, please?
@tims4773
@tims4773 4 жыл бұрын
Would it be possible to do this using entirely the onboard STM32 ADC and DAC instead of the CS I2S modules?
@thecrikster
@thecrikster 4 жыл бұрын
Yes. You can enable DMA on both ADC and DAC, then have both triggered by hw timers. The samples will be interleaved so you need to split them. Use a DMA call back (as shown here) to process the ADC input. You will find that the filter order (number of taps), the sample rate and the max ADC clock speed are dependant on each other. For embedded systems the ADC clock speed has a max value much lower than "normal" systems. The sample rate will determine the sound quality of the output and should go no lower than 44.1KHz. Therefore, you will need to design your filter so that the order/taps achieve the required frequency response whilst not becoming too computationally expense to affect the sample rate. In other words, your ADC clock will be "maxed out" and it will be a trade off between sample rate and frequency response. As the cutoff frequency gets lower, the passband becomes narrower and it becomes increasingly difficult to create a cheap and effective filter.
@babotvoj
@babotvoj 4 жыл бұрын
@@thecrikster Are you talking ybout the IIR filter ? How does it effect ADC clock of the internal ADC but works fine with the external?
@jeremiasvargas1077
@jeremiasvargas1077 4 жыл бұрын
@@thecrikster I am doing a 2x vias Crossover (LP and BP) and the problem that I having is that I listen pulses but not "Music", any IN signal, the "Output" is a pulse.
@kekecjan
@kekecjan 3 жыл бұрын
Hello, i have one problem, yesterday i uploaded your code on stm32F4 Discovery and connected PMOD I2S2 and it was working as expected. Today i wanted to try new STM32 (STM32F401) i uploaded same code, i only changed clock configuration in STM32Cube nothing else, but i only heard cracking noise. I hooked up back to STM32F4 Discovery board and again cracking noise. Did i somehow destroied PMOD I2S2 ???? I checked wiring twice and it's correct. What do you think it's the ploblem?
@S-MKim
@S-MKim 2 жыл бұрын
Perhaps you could kindly make a detailed video on how you make it realized. I am still working on it for a week but no clue.
@kekecjan
@kekecjan 2 жыл бұрын
@@S-MKim I did fixed it... i was using male to female wires and ofcourse somewhere was no connection between pins. That was the reason.
@kekecjan
@kekecjan 2 жыл бұрын
@@S-MKim well i used 6x2 female header and i soldered pins to STM32F4 and worked.
@S-MKim
@S-MKim 2 жыл бұрын
@@kekecjan Congratulations. So the codes seem alright. I will buy a new Pmod I2S2 (mine seems dead) and try it again.
@kekecjan
@kekecjan 2 жыл бұрын
@@S-MKim yeah code works great. why dont you make your own PMOD I2S2 ? one board costs 50€ with shipping isn't that much for one PMOD? i made my own PMOD and work well... also i could make 5 of them for the same price. Up to you... all you need is already in documentation for PMOD.
@IvanEng747
@IvanEng747 Жыл бұрын
What about voice?
@huckfin1100
@huckfin1100 4 жыл бұрын
The second sample did not sound that good, bass on one side treble the other ? That's not normal
@asunavk69
@asunavk69 3 жыл бұрын
it was intencional, for demonstration porpouses he did one channel for low pass and other for high pass, to have full low pass and high pass i think one would need dedicated class D's to being filtered digitaly.. Edit: that would be if one would amplifly on a speaker, to have low-high pass on stereo i think it would be needed to add the another I2S "comunicator", if you know what i mean.
[#15] CMSIS DSP Library - Audio DSP On STM32 (24 Bit / 48 kHz)
15:24
YetAnotherElectronicsChannel
Рет қаралды 37 М.
How Many Balloons Does It Take To Fly?
00:18
MrBeast
Рет қаралды 205 МЛН
Double Stacked Pizza @Lionfield @ChefRush
00:33
albert_cancook
Рет қаралды 116 МЛН
Survive 100 Days In Nuclear Bunker, Win $500,000
32:21
MrBeast
Рет қаралды 85 МЛН
Stay on your way 🛤️✨
00:34
A4
Рет қаралды 25 МЛН
[#23] FFT Spectrum Analysis - Audio DSP On STM32 (24 Bit / 48 kHz)
14:33
YetAnotherElectronicsChannel
Рет қаралды 30 М.
Software Emulators vs FPGAs
27:08
What's Ken Making
Рет қаралды 275 М.
Building a Digital Music Player with I2S?! What is I2S! EB#45
10:24
Comb Filters & Delay Lines in Software (STM32) - Phil's Lab #124
29:12
Running DSP Algorithms on Arm Cortex M Processors
57:23
Lefteris Kostoulas
Рет қаралды 35 М.
8. IIR Filters - Infinite Impulse Response - Digital Filter Basics
14:58
Top Fifteen Mistakes People Make When Designing Prototype PCBs
12:26
Cosplay Light and Sound
Рет қаралды 141 М.
Hacking a weird TV censoring device
20:59
Ben Eater
Рет қаралды 3 МЛН
[#20] PDM Microphones - Audio DSP On STM32 (16 Bit / 48 kHz)
18:13
YetAnotherElectronicsChannel
Рет қаралды 23 М.
Audio EQ Software Implementation (STM32) - Phil's Lab #89
30:48
Phil’s Lab
Рет қаралды 33 М.
iPhone 15 Pro в реальной жизни
24:07
HUDAKOV
Рет қаралды 490 М.
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 6 МЛН
Это - iPhone 16!
16:29
Rozetked
Рет қаралды 346 М.
Хакер взломал компьютер с USB кабеля. Кевин Митник.
0:58
Последний Оплот Безопасности
Рет қаралды 2,2 МЛН
Проверил, как вам?
0:58
Коннор
Рет қаралды 310 М.