AX Filtering Overview

Introduction

Voice shaping is one of the techniques used to use the same base waveform and produce different sounds. Two filters are provided in the voice generation path to shape the voice. One pole Low Pass Filter and two pole biquad filter stages are provided to the developer to assist in voice shaping. The details of these two filters are given below.

Low Pass Filter

Only a Low Pass Filter can be realized with a one pole system.

The equation of the filter is: y(n) = a0*x(n) - b0*y(n-1)

The transfer function is: H(z) = a0/(1-b0z-1)

A typical frequency response of this filter with cut-off frequency = 4000Hz is shown in the following figure.

The audio renderer realizes this filter as: y(n) = a0*x(n) + (-b0)*y(n-1), as this form is more conducive for DSP. Because of this, the filter coefficient b0 should be arithmetically negated before being sent to AX. The coefficients a0 and b0 are expressed as Q15 numbers. The functions AXSetVoiceLpf, and AXSetVoiceLpfCoefs are used to control the low pass filter for a voice. In addition to the above two functions, AXComputeLpfCoefs is also provided to calculate the coefficients for LPF on the fly given a cut-off frequency.

Biquad Filter

Biquad Filter provides more flexibility in terms of its usage. Low Pass, High Pass and Band Pass filters are realizable with this filter. The filter roll-off is steeper using biquad.

The equation of the filter is: y(n) = b0 * x(n) + b1 * x(n-1) + b2 * x(n-2) - a1 * y(n-1) - a2 * y(n-2)

The transfer function is given by:
         b0 + b1(Z^-1) + b2(Z^-2)   
H(z) = ----------------------------
         1  + a1(Z^-1) + a2(Z^-2)    
    

However, the audio renderer realizes this filter as: (n) = b0 * x(n) + b1 * x(n-1) + b2 * x(n-2) + (- a1) * y(n-1) + (- a2) * y(n-2), as this form is more conducive for DSP. Because of this, the filter coefficients a1 and a2 should be arithmetically negated before being sent to AX.

The frequency response of a typical low pass filter realized using biquad is given in the following diagram:
The functions AXSetVoiceBiquad, and AXSetVoiceBiquadCoefs are used to control the biquad filter for a voice.
CAUTION:
Due to the difference in PPC and DSP architectures, PPC being a floating-point processor and DSP a fixed point processor, the output of a voice processed on PPC might sound different than the same voice processed on DSP. This is especially true when using biquad and LPF filters. DSP has a 16-bit width to represent coefficients. This limitation imposes restrictions on the realization of stable filters for extreme cut-off filters. For example, realizing a low pass filter using biquad less than 160Hz, might be difficult for all inputs. It is up to the developers to make sure that the filters they submit to the DSP are stable for all the inputs that are processed through such a filter.

See Also

AXSetVoiceLpf
AXSetVoiceLpfCoefs
AXComputeLpfCoefs
AXSetVoiceBiquad
AXSetVoiceBiquadCoefs

Revision History

2013-05-08 Automated cleanup pass.
2012-08-01 Cleanup Pass.
2011-02-21 Initial version.


CONFIDENTIAL