From The MPEG-4 Structured Audio Book by John Lazzaro and John Wawrzynek.

Part IV/2: Filter Core Opcodes

Sections

Core Opcodes:

allpass bandpass bandstop biquad chorus comb delay delay1 fir firt flange fracdelay hipass iir iirt lopass reverb

Other Elements:

oparray

Introduction

In this chapter, we describe the core opcodes for audio filters. These a-rate opcodes return a filtered version of the signal coded by the a-rate parameter in.

Most opcodes in this chapter are normative, and compute filters that sound identical on any compliant decoder. A few opcodes are non-normative, and are provided as convenient tools for algorithm prototyping.

We also introduce a SAOL language feature, the oparray, in conjunction with the fracdelay core opcode. Oparrays let several syntactically distinct calls to the same opcode share a single set of internal state variables.

 

FIR Filters

Two finite impulse response (FIR) filter core opcodes, fir and firt, are provided in SAOL. The right panel shows the header syntax for the opcodes.

Both opcodes return a filtered version of the signal provided by the a-rate parameter in. During the first call to these opcodes, the internal filter state variables are initialized to zero.

Both opcodes are normative, in the sense that the filter coefficients parameters define the transfer function of the filter, assuming one opcode call per a-pass.

The method for implementing this transfer function is non-normative.

The fir opcode specifies the FIR filter coefficients as the list b0, b1, b2 ... of scalar k-rate parameters.

The firt opcode specifies the FIR filter coefficients as the table parameter t, whose length is the order of the filter. If the optional k-rate parameter order is less than the table length, this parameter determines the filter order, as specified on the right panel.

FIR: Parameter Coefficients


aopcode fir(asig in, ksig b0
            [, ksig b1, 
             ksig b2 ...])



Implements transfer function

                -1       -2
H(z) = b0 + b1 z   + b2 z   ...

Exact implementation is decoder
dependent.

FIR: Wavetable Coefficients


aopcode firt(asig in, table t
            [, ksig order]) 


FIR coefficients are stored in
the table t. If order is not
supplied, let order be the
length of table t. The 
opcode implements the transfer
function:

                    -1         -2
H(z) = t[0] + t[2]*z   + t[2]*z   

                      -(order-1)
      ... t[order-1]*z

Exact implementation is decoder
dependent.