[Difference Eqution]:
$$LPF_D=\frac{0.1441z^2+0.2881z+0.1441}{z^2-0.6777z+0.254}$$ With a sample of \$T_s = \$ 8e-6 seconds, in scientific E notation.
The difference equation:
\$Y\$ = Output
\$U\$ = Input
$$Y_i =0.1441U_{i}+0.2281U_{i-1}+0.1441U_{i-2}+0.6777Y_{i-1}-0.254Y_{i-2}$$
I first came here with an Atmel Atmega328p asking if I can sample an audio signal while implementing a digital filter I created.
I got the audio sampling down but soon came to realize the processing power wasn't there for the Atmel Atmega. You guys showed me a new way to sample from the ADC which is the DMA. Saying its much faster. I had an ADC sampling at 36 KHz while that was going I wanted to implement a difference equation. I learned that the difference equation couldn't be executed within the 36 KHz sampling time. I took your suggestions and bought a STM32L43KC.
A massive upgrade. DMA, DSP, 80 MHz. over the weekend I got where I left off with the Atmel Atmega.
Got the ADC running with DMA on the STM32 chip, but I realized something. I would need to have an interrupt in the DMA (Transfer Complete Interrupt) when the ADC samples are ready. If I am sampling the ADC at 36 KHz and the interrupt is enable on the DMA would that mean the CPU is still going to be interrupted every 36 KHz? Which still leaves me no room for implementing that digital filter?
Unless this time the MCU I am using has a DSP and that can execute my difference equation within 27.7 us otherwise I am seeing my self in the same situation. How do people actually sample and do DSP at the same time?
The only way I am thinking is using two MCU. Have one do the sampling interrupt send it over SPI, UART and then the second MCU interrupt when it receives it and do the DSP.
Any thoughts on this guys?
All I want to do is sample an audio signal at a good enough frequency to avoid aliasing then implement a digital filter that I worked on and shove it into a DAC and hear it.