![]() |
Edge AI Add-on API 2.2.0
|
| nrf_axon_result_e nrf_axon_fir_2d_16_16_32_decimate | ( | const int16_t * | input_ptr, |
| const int16_t * | filter_ptr, | ||
| int32_t * | out_ptr, | ||
| uint16_t | input_height, | ||
| uint16_t | filter_height, | ||
| uint16_t | decimate_width, | ||
| uint8_t | rounding_bits, | ||
| nrf_axon_syncmode_blocking_e | block_mode, | ||
| bool | keep_reservation ) |
"FIR" => "Finite Impulse Response" filter with decimation multiple. Filter coefficients are MAC'd with the input. Input elements are multiplied with filter elements in the same order. in the order. ie, for filter length F, output x[n] = input[n]*filter[0] + input[n+1]*filter[F+1]+...input[n+F-1]*filter[F-1]. After each output is generated, the input skips ahead by decimate_width. The filter output starts at out_ptr[0].
This implementation uses a 2D strategy for optimized performance. Therefore, the input and filter dimensions are described in length = height * width, where width is also the decimation factor. Use axon_fir_2d_16_16_32_decimate() ff the input and filter dimensions cannot be described with height * width and/or decimation factor = 1.
Input is int16, filter is int16, and output is int32.
| input_ptr | pointer to the input, 16bit integer. |
| filter_ptr | pointer to the filter coefficients, 16bit integer. |
| out_ptr | pointer to the output, saturated to int32. 1st valid output starts at offset 0. Output can overlap/overwrite input. |
| input_height | height of the input shape (in elements). Minimum 4, maximum 256, input_height * decimation_width <= 512 input_height >= filter_height. |
| filter_height | height of the filter shape (in elements). Minimum 4, maximum 256, input_height * decimation_width <= 512 input_height >= filter_height. |
| decimation_width | combined decimation factor and input/filter width. minimum 2, maximum 16. |
| rounding_bits | number of bits to round the output by. |
| block_mode | recommnended to be set to NRF_AXON_SYNC_MODE_BLOCKING_POLLING. |
| keep_reservation | set to true if there are subsequent axon operations to execute immediately on completion. true prevents axon from be taken by another user and/or being powered off. Set to false if axon will not be used immediately after to free axon for other users and/or power down if idle. |