Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is "the instance structure must be manually initialized"?

38 views
Skip to first unread message

fl

unread,
Jan 14, 2014, 8:55:01 PM1/14/14
to
Hi,

I have big difficulties when I read below FIR function description.
1. I do not know what is "4 different data type filter instance structures"

2. I do not know What is "the instance structure must be manually initialized"

The "statically initialize" is manual initialize? Or call function:

ne10_result_t ne10_fir_init_float0 (ne10_fir_instance_f32_t * S,
ne10_uint16_t numTaps,
ne10_float32_t * pCoeffs,
ne10_float32_t * pState,
ne10_uint32_t blockSize)

I have no idea at all on this question.


Thanks a lot.



--------------------------
Initialization Functions
There is also an associated initialization function for each data type. The initialization function performs the following operations:

Sets the values of the internal structure fields.
Zeros out the values in the state buffer.

Use of the initialization function is optional. However, if the initialization function is used, then the instance structure cannot be placed into a const data section. To place an instance structure into a const data section, the instance structure must be manually initialized. Set the values in the state buffer to zeros before static initialization. The code below statically initializes each of the 4 different data type filter instance structures

ne10_fir_instance_f32_t S = {numTaps, pState, pCoeffs};
.............................
ne10_result_t ne10_fir_init_float0 (ne10_fir_instance_f32_t * S,
ne10_uint16_t numTaps,
ne10_float32_t * pCoeffs,
ne10_float32_t * pState,
ne10_uint32_t blockSize)
{
/* Assign filter taps */
S->numTaps = numTaps;

/* Assign coefficient pointer */
S->pCoeffs = pCoeffs;

/* Clear state buffer and the size of state buffer is (blockSize + numTaps - 1) */
memset (pState, 0, (numTaps + (blockSize - 1u)) * sizeof (ne10_float32_t));

/* Assign state pointer */
S->pState = pState;
return NE10_OK;
}

fl

unread,
Jan 14, 2014, 9:07:09 PM1/14/14
to
Here is the FIR instance declaration. I do not see 4 different data type filter instance structures in it. Do you see something?

Thanks.

typedef struct
{
ne10_uint16_t numTaps; /**< Length of the filter. */
ne10_float32_t *pState; /**< Points to the state variable array. The array is of length numTaps+maxBlockSize-1. */
ne10_float32_t *pCoeffs; /**< Points to the coefficient array. The array is of length numTaps. */
} ne10_fir_instance_f32_t;

/**

Kaz Kylheku

unread,
Jan 15, 2014, 12:13:08 AM1/15/14
to
On 2014-01-15, fl <rxj...@gmail.com> wrote:
> Here is the FIR instance declaration. I do not see 4 different data type filter instance structures in it. Do you see something?

The word "type" has a broader meaning than just "C language type", even
in the context of C.

Type is any aspect of a datum by which we categorize it, not
only the declared type known to the compiler.

0 new messages