The C model holds input and output data in multi-dimensional arrays:
xip_array_real for input and xip_array_mpz for
output.
Data is arranged as a 3D array, where dim[0] is the path (always 1),
dim[1] is the number of channels, and dim[2] is
the number of samples per channel.
Multiple channels are interleaved in the flat data buffer: all channels
of a given sample are stored consecutively before the next sample. For three channels
this is:
sample 0 sample 1 sample 2
c0 c1 c2 c0 c1 c2 c0 c1 c2
The flat index of a given value is therefore (sample * num_channels) +
chan.
To access a single value by channel and sample number without computing the flat index, use the helpers:
-
xip_cic_v4_0_xip_array_real_set_samplewrites an input sample. -
xip_cic_v4_0_xip_array_mpz_get_samplereads an output sample.