EH#4: Understanding the LPDDR4 SDRAM memory for mobile, automotive and embedded system applications.
EH#4: Understanding the LPDDR4 SDRAM memory for mobile, automotive and embedded system applications.
- Get link
- X
- Other Apps
Audio processing is a fascinating and essential area in embedded systems, where hardware meets the real world in the most tangible way—through sound. Whether it's enhancing voice recognition in smart devices, filtering noise in automotive systems, or creating immersive audio experiences in consumer electronics, audio processing is at the heart of many cutting-edge applications.
For embedded engineers, mastering audio processing opens up a world of opportunities. But unlike software engineers working in high-level languages, embedded engineers face unique challenges: constrained hardware resources, real-time processing demands, and the need to optimize every bit of memory and every clock cycle.
This blog series is designed to bridge the gap between theory and practical implementation, providing you with the foundational knowledge and hands-on techniques needed to tackle audio processing in embedded systems. We'll explore key concepts like digital signal processing (DSP), filter design, noise reduction, and more, all with a focus on the specific needs of embedded environments.
Whether you're new to audio processing or looking to deepen your expertise, this series will equip you with the tools and insights to bring high-quality audio solutions to your next embedded project. Let’s dive into the world where sound and silicon meet!
Let's first understand
how a speaker works. Please watch this video .
how a class D amplifier works. Please watch this video .
Here's a brief description of some points we need to understand before starting the actual audio applications:
PWM (Pulse Width Modulation):
PPM (Pulse Position Modulation):
Encodes audio by varying the position of each pulse relative to a reference point. Less common in audio but used in certain communication systems.PDM (Pulse Density Modulation):
Represents audio as a 1-bit stream where the density of pulses (1s) corresponds to the signal amplitude. Common in digital microphones and some DACs.I2S (Inter-IC Sound):
A serial bus standard for transmitting PCM audio data between digital audio devices. Widely used for connecting processors to DACs and ADCs.PCM (Pulse Code Modulation):
DAC Signal (Digital-to-Analog Converter Signal):
The output of a DAC, which converts digital audio signals (PCM, PDM, etc.) into a continuous analog signal that can drive speakers or other analog audio equipment. Below image is very simplified version as it does not include the amplifier right before the speaker in the diagram.
Now let's look some of them in a bit details
is best understood as "oversampled 1-bit audio." It's a simple digital system that uses a very high sampling rate with just one bit per sample. If you took the 16-bit audio of a CD, dramatically increased its sampling rate, and reduced the wordlength to 1 bit in a sensible way, you'd have a PDM system. PDM is more straightforward than Pulse Code Modulation (PCM).
PCM (Pulse Code Modulation):
In contrast, PDM simplifies by using just one bit and a much higher sampling rate.
Noise Shaping in 1-Bit Audio Systems
When converting a 24-bit PCM signal to a 1-bit system like PDM, directly reducing the wordlength by keeping only the Most Significant Bit (MSB) creates severe distortion—over 40%. This happens because the system lacks dithering, which is crucial for managing quantization errors.
Dithering is a process that adds a small amount of random noise before quantization. This noise helps to decorrelate the quantization errors from the signal, turning them into a uniform white noise floor rather than distortion. Without dithering, these errors align with the signal, causing unpleasant artifacts.
Noise shaping improves 1-bit audio by redistributing the quantization noise into higher frequencies, where it is less audible. This allows for a more accurate representation of the original signal, even with only 1 bit per sample.
Oversampling Reducing wordlength in digital audio introduces significant noise, especially when dropping to 1-bit, which can be up to 90 dB noisier than a 16-bit system. Noise shaping can push this noise to higher frequencies, which works well in imaging but not in audio, where mid- and high-frequency noise is very noticeable.
To manage this, a higher sampling rate is used. This increases the system's bandwidth, allowing noise to be shifted above the audible range, where it can't be heard. There are two ways to achieve this higher sampling rate:
A PDM modulator decides whether to output a 1
or 0
based on the cumulative error between the original analog signal and the modulated digital signal.
Here's how it works:
Integration and Comparison:
Bit Decision:
1
.0
.Error Feedback:
Noise Shaping:
The result is that the PDM modulator outputs a stream of 1
s and 0
s where the density of 1
s is proportional to the amplitude of the input signal. For more info on PDM and PCM visit this document.
For a speaker application, the DAC output signal generally provides better quality compared to a PWM signal with a low-pass filter (LPF). Here’s why:
DAC Output Signal: A high-quality DAC converts digital audio directly into an analog signal with minimal distortion and noise, preserving the full detail of the original audio. This analog signal is ready to drive speakers or further amplification, making it ideal for high-fidelity audio applications.
PWM + LPF Signal: While a PWM signal can be filtered using an LPF to approximate an analog signal, this process can introduce distortion, especially if the PWM frequency is not high enough or the filter design is not optimal. The resulting analog signal may have less accuracy and clarity compared to a direct DAC output.
In summary, for speaker applications where sound quality is critical, the DAC output is typically superior to a PWM signal processed through an LPF.
It is generally not advisable to drive a speaker directly with either a DAC output signal or a PWM+LPF signal without amplification. Here’s why a Class D amplifier is recommended:
Power Levels:
Impedance Matching:
Efficiency and Quality:
Conclusion: To properly drive a speaker with good sound quality and sufficient volume, a Class D amplifier is necessary. It ensures that the signal (whether from a DAC or PWM+LPF) is amplified to the appropriate power level, matches the speaker’s impedance, and delivers clear, undistorted audio.
Class D amplifiers can accept various types of input interfaces, each suited to different applications and signal types. Here’s common Class D input interfaces:
Analog Input:
Description: Receives a continuous analog signal directly from sources such as DACs.Digital Input:
Description: Accepts digital audio signals directly, often in formats like I2S, SPDIF, or TDM. The Class D amplifier typically includes a built-in digital-to-analog conversion stage.Pulse Width Modulation (PWM) Input:
Description: Accepts PWM signals directly. Class D amplifiers designed for PWM inputs process these signals without needing additional conversion.Pulse Density Modulation (PDM) Input:
Description: Some Class D amplifiers accept PDM signals directly. PDM signals are typically converted internally to a form suitable for amplification.Differential Input:
Description: Receives a differential signal, which can help reduce noise and interference by using a balanced input configuration.XPT8871 Example Schematics
Circled components R and C makes a high pass filter that blocks DC and low frequency noise from audio input signal and then the signal is fed to the XPT IC.
A video on designing the Amplifier circuit: Link
An excellent video on understanding the Class D-Amplifier: Link, this video explains how PWM can be used to generate amplified output signal of input shape.
In depth understanding of Class-D Amplifier
This is an audio source for the amplifier.
Now IC will generate a very high frequency PWM signal within the IC.
Now applying a LPF on this PWM signal.Here is how the LPF filtered signal looks like: Green - high frequency PWM signal and Yellow - LPF filtered output signal.
Zoom again
Comments
Post a Comment