Measuring Line-Level Analog Audio Signals Using ADC/MCU Analog Inputs
2024-05-24 | By Judith Settle
Line-level audio is crucial to the audio recording process. It is the stage after a preamp and before speakers from which consumers hear audio. Before the signal was digital, the source was what we call analog, meaning it is continuous and variable. When the signal was strictly analog, it was more susceptible to noise, while a digital signal is a series of ones and zeroes. Digital signals, having only two options, are then easier to remove noise from. Following, I will explain how to best measure line level signal using an ADC (Audio to Digital Converter.)
An analog-to-digital converter must be used to enable a microcontroller to read data. Some microcontrollers have an ADC integrated, allowing you to use only one tool to measure and later analyze results. Measuring analog audio signals is a way to ensure that the signal integrity is kept throughout the process of being converted to digital. Before initializing the process, you must make sure that your microcontroller has pins that can read an ADC’s input on its pins.
While there are some basics needed to start this process, there are other parameters that must be set, and later may even cause issues in the process if not done correctly. An issue that may arise with this process is that parts of the information can be lost from the original source. The first step you should perform is to set the input voltage of the ADC. A way to ensure you get the correct input is by using software to convert raw bits to volts and then convert them into your desired unit. The figure below shows an example of how to set the input range.
Figure 1: Bus voltage fixed at 24 VDC
Next, when measuring audio signals, it is important to select a good sample rate. The lowest sample rate, according to the Nyquist theorem, is twice the bandwidth or higher of the signal. When there are higher sample rates there are also some issues that arise. Some issues may be slower speeds and higher power consumption. The diagram below shows how increasing the bit level can make the signal closer to what the original signal looks like when converted to digital. When applying the Nyquist theorem, you might also catch some unwanted frequencies in that range that you can address with a filter. Unwanted frequencies appear as noise, when the bits you are sampling increase, you will also notice that the noise decreases. The ADC should have enough analog range to handle the sum of the largest desired or undesired signal.
Figure 2: Resolution increasing by bit
In conclusion, it is important to set many parameters to ensure you are getting as close to the original signal as possible when converting the signal to digital. Once you have performed these steps and set your parameters, you will have a clean signal with minimal noise. Start by setting the input voltage. Second, utilizing the Nyquist Theorem, find a good sample rate to get the desired signal fully captured. Finally, you can use a filter to remove any remaining unwanted frequencies.
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum