Filter Design Toolbox    

Indexing into a Cell Array of Cell Arrays

To index into a cell array of cell arrays, you have to use as many sets of braces as you have layers of cells.

Here's an example of indexing into the cell arrays of multisection quantized filters.

Example -- Accessing Coefficient Information from Multisection Filters

When you create quantized filters with multiple sections, specify the reference filter coefficients as a cell array of cell arrays, using one cell array to enter the numerator and denominator of each section. In this case, use sequences of curly braces to index into these cell arrays.

For example, suppose you want to quantize and design a sixth-order Butterworth filter you create using the Signal Processing Toolbox.

Filters whose transfer functions are factored into second-order sections are much more robust against quantization error, so use sos to put your direct form II filter into a second-order sections form.

The reference coefficients are contained in a three-by-one cell array of cells Hq.ReferenceCoefficients. This cell array is created from the values you set for the ReferenceCoefficients property. You can index into one of the three cell arrays of cells by:

  1. Creating a cell array c from the cell array Hq.ReferenceCoefficients
  2. Indexing into it

Notice that you can use the colon operator to obtain the contents of both entries in the cell array contained in the cell array c{2}.


  Indexing into a Cell Array of Vectors or Matrices Working with Quantizers