De-emphasis
The de-emphasis feature is included for audio data that has utilized the 50/15s pre-emphasis for noise reduction. There are
three de-emphasis filters, one for 32kHz, one for 44.1kHz, and one for 48kHz selectable via deemph_sel and bypassed via
deemph_bypass in Register 6: De-emphasis Filter & Volume Ramp Rate.
The de-emphasis filter can automatically be applied when an SPDIF stream sets the de-emphasis flag. It will auto detect the
sample rate (32k, 44.1k, 48k) in either consumer or professional formats and then apply the correct de-emphasis filter. The
automatic enabling of the de-emphasis filter can be enabled via auto_deemph in Register 6: De-emphasis Filter & Volume
Ramp Rate.
Preset Oversampling FIR Filters
Seven pre-programmed digital filters are selectable for SPDIF and PCM serial mode via filter_shape in Register 7: Filter
Bandwidth and System Mute. See ANALOG PERFORMANCE, PCM FILTER FREQUENCY RESPONSE and PCM FILTER
IMPULSE RESPONSE for more information.
Custom Oversampling FIR Filter
The FIR filter can also be programmed as a two-staged interpolation filter with custom coefficients to achieve unique sound
signature. Custom coefficients can be generated using MATLAB and then downloaded using a custom C code.
Example Source Code for Loading a Filter
// only accept 128, 64 or 16 coefficients
// Note: The coefficients must be quantized to 32 bits for this method!
// Note: Stage 1 consists of 128 or 64 values (0-127 being the coefficients)
// Note: Stage 2 consists of 16 values (0-13 being the coefficients, 14-15 are zeros)
// Note: Stage 2 is symmetric about coefficient 13. See the example filters for more information.
byte fir_badr = 32;
byte coeff_stage = (byte)(coeffs.Count == 64 ? 0: 1);
for (int i = 0; i < coeffs.Count; i++)
{
// stage 1 contains 128 or 64 coefficients, while stage 2 contains 16 coefficients
registers.WriteRegister(fir_badr, (byte)((coeff_stage << 7) + i));
// write the coefficient data
registers.WriteRegister(fir_badr+1, (byte)(coeffs[i] & 0xff));
registers.WriteRegister(fir_badr+2, (byte)((coeffs[i] >> 8) & 0xff));
registers.WriteRegister(fir_badr+3, (byte)((coeffs[i] >> 16) & 0xff));
registers.WriteRegister(fir_badr+5, 0x02); // set the write enable bit
}
// disable the write enable bit when we’re done
registers.WriteRegister(fir_badr+5, (byte)(setEvenBit ? 0x04 : 0x00));
Oversampling Filter (OSF) Bypass
The oversampling FIR filter can be bypassed using bypass_osf in Register 37: Programmable FIR Configuration, sourcing
data directly into the IIR filter. The audio input should be oversampled at 8 x fs rate when OSF is bypassed to have the same
IIR filter bandwidth as PCM audio sampled at fs rate. For example, a signal with 44.1kHz sample rate can be oversampled
externally to 8 x 44.1kHz = 352.8kHz and then applied to the serial decoder in either I2S, LJ, or RJ format. The maximum
sample rate that can be applied is 1.536MHz (8 x 192kHz).
IIR Filter
Four filters with cutoffs at 47kHz, 50kHz, 60kHz, and 70kHz scaled by fs/44100 are selectable via iir_bw in Register 7: Filter
Bandwidth and System Mute. See ANALOG PERFORMANCE and IIR FILTER RESPONSE for more information.