Summary of AVR Atmega audio input RMA using FFT Radix-4
audiogetradix4 is a library interfacing with AC audio inputs via an ADC pin to calculate RMS values using a DFT Radix-4 algorithm. It implements a port of Anatoly Kuzmenko's RADIX-4 FFT and applies Parseval's theorem to derive SPL dB from the frequency spectrum. The hardware setup utilizes a TLC272 opamp in a pre-amplifier circuit (rev 03) with added filter capacitors for sensitivity, alongside dynamic biasing logic.
Parts used in the audiogetradix4 Project:
- ADC pin
- TLC272 opamp
- Filter caps
- Electronic board (from AVR Atmega audio input RMA project)
audiogetradix4 is a simple library you can use to interface with a ac audio input.
It reads data from an ADC pin and returns the RMS value of the input using DFT Radix-4 algorithm.

The discrete Fourier transform (DFT) converts a finite list of equally-spaced samples of a function into the list of coefficients of a finite combination of complex sinusoids, ordered by their frequencies, that has those same sample values.
I’m not a DSP expert, so if some expert find error in the method i use, explained below, please let me know.
A Radix-4 decimation-in-time (DIT) FFT is a Cooley–Tukey algorithm for computing the discrete Fourier transform (DFT).
My radix4 implementation is a port of RADIX-4 FFT library by Anatoly Kuzmenko.
To obtain RMS value of the AC current of the audio signal processed, from which you can get the SPL db value, we use the Parseval’s theorem for FFT so for fft size of N.
Let’s conside x[i] as the signal, and let’s take N samples, we could take only real part of the signal using our ADC, so we can consider Parseval therorem for DFT.
consider X[k] as the “modified” frequency spectrum, valid from 0 to N/2, and the the first (0) and the last (N/2) element have to be divided by the root square of 2.
We define:
given ReX as the real part, and ImX as the imaginary part of the signal in frequency domain.
So Parseval therorem for DFT became:
Now we know that RMS in time domain is:
Applying the parseval theorem we can compute RMS in frequency domain as:
Because we are computing a discrete signal, we can treat the equation above for DTFT.
So X[k] is not a “modified” frequency spectrum.
So Parseval therorem for DTFT became:
And we can compute RMS in frequency domain as:
Once again as audiogetavarage library here is also implemented a dynamic bias, for the electronic board used during experiment, refer to that project.
This time the TLC272 opamp is used in pre, this ic is a little more sensitive then the TLC27L2 used previously, so a filter caps is added in this pre circuit revision (rev 03).
For more detail: AVR Atmega audio input RMA using FFT Radix-4
- How does the library process audio signals?
It reads data from an ADC pin and returns the RMS value using the DFT Radix-4 algorithm. - What algorithm is used to compute the discrete Fourier transform?
The implementation uses a Radix-4 decimation-in-time Cooley–Tukey algorithm ported from Anatoly Kuzmenko. - How is the RMS value calculated from the frequency spectrum?
The code applies Parseval's theorem for DFT or DTFT to compute RMS in the frequency domain. - Why was the TLC272 opamp selected for this revision?
The TLC272 is more sensitive than the previously used TLC27L2, necessitating additional filter capacitors. - What changes were made in the pre-circuit revision 03?
A filter cap was added to the pre-circuit due to the higher sensitivity of the TLC272 opamp. - Does the library support dynamic biasing?
Yes, it implements dynamic bias similar to the audiogetavarage library. - Can you get the SPL db value from this library?
Yes, the RMS value of the AC current processed allows for obtaining the SPL db value.




