DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

AN726 データシートの表示(PDF) - Silicon Laboratories

部品番号
コンポーネント説明
メーカー
AN726
Silabs
Silicon Laboratories Silabs
AN726 Datasheet PDF : 28 Pages
1 2 3 4 5 6 7 8 9 10 Next Last
AN726
5.2. Algorithms
The Class-D ToolStick uses two algorithms to manipulate data: Exponentially Weighted Moving Average (EWMA)
and µLaw. This section also describes Remainder-Weighted Dithering as an optional algorithm.
5.2.1. Exponentially Weighted Moving Average (EWMA)
The EWMA is a form of Exponential Averaging that creates a low-pass filter. This filter performs noise shaping to
help move the quantization noise out of the audible range. The Class-D ToolStick firmware uses this form of
averaging to filter the ADC results.
The EWMA takes the form:
yn=
yn
1
y------n-----–-----1----
2m
+
x------n----
2m
In this equation, y(n) is the current output, y(n-1) is the previous output, x(n) is the current input sample, and m is
the weight of the average.
The weight determines how heavy the average of the EWMA is. The smaller weights (m = 1, 2) use more of the
new sample and react more quickly to dramatic changes in the input. Larger weights (m = 4, 5) use more of the
previous output and provide more smoothing.
The EWMA has several advantages over other forms of averaging:
Quick to calculate (two shifts, an addition, and a subtraction)
Only saving the previous value
Contains history from every sample in time, which would take lots of memory in a traditional average
The weight can be dynamically adjusted easily in firmware depending on the circumstances without
dramatically changing the computational time
The EWMA is a form of IIR filter, which means it can become unstable if the cumulative error becomes too large.
5.2.2. Remainder-Weighted Dithering
The firmware quantizes the 12-bit ADC results or 16-bit signed USB data to a 9-bit EPCA PWM value. Remainder-
weighted dithering is an optional algorithm that allows the Class-D ToolStick firmware to recover some of the
energy lost in the LSBs during this conversion in a random, inaudible way.
This algorithm captures the LSBs of the original 12- or 16-bit data, shifts the data to the final 9-bit size, and
compares against a random value of the same magnitude as the LSBs shifted away. If the original data was
positive and the LSBs are greater than the random value, then the LSB of the 9-bit data is incremented by 1.
Similarly, if the original data was negative and the LSBs are less than the random value, the LSB is decremented
by 1. Otherwise, the data remains unchanged.
12-bit to 9-bit (3 bits):
output_value = 1931 = 0x078B
output_lsb = 0x78B & 0x7 = 3
output_value = 1931 >> 3 = 241
random_lsb = 1 random_lsb = 6 random_lsb = 4 random_lsb = 0 random_lsb = 3
242
241
EPCA
overflows
Figure 6. Remainder-Weighted Dithering Example
Rev. 0.1
9

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]