Partial Convolution

riscv_status riscv_conv_partial_f32(const float32_t *pSrcA, uint32_t srcALen, const float32_t *pSrcB, uint32_t srcBLen, float32_t *pDst, uint32_t firstIndex, uint32_t numPoints)
riscv_status riscv_conv_partial_fast_opt_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints, q15_t *pScratch1, q15_t *pScratch2)
riscv_status riscv_conv_partial_fast_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints)
riscv_status riscv_conv_partial_fast_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst, uint32_t firstIndex, uint32_t numPoints)
riscv_status riscv_conv_partial_opt_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints, q15_t *pScratch1, q15_t *pScratch2)
riscv_status riscv_conv_partial_opt_q7(const q7_t *pSrcA, uint32_t srcALen, const q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst, uint32_t firstIndex, uint32_t numPoints, q15_t *pScratch1, q15_t *pScratch2)
riscv_status riscv_conv_partial_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints)
riscv_status riscv_conv_partial_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst, uint32_t firstIndex, uint32_t numPoints)
riscv_status riscv_conv_partial_q7(const q7_t *pSrcA, uint32_t srcALen, const q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst, uint32_t firstIndex, uint32_t numPoints)
group PartialConv

Partial Convolution is equivalent to Convolution except that a subset of the output samples is generated. Each function has two additional arguments. firstIndex specifies the starting index of the subset of output samples. numPoints is the number of output samples to compute. The function computes the output in the range [firstIndex, ..., firstIndex+numPoints-1]. The output array pDst contains numPoints values.

The allowable range of output indices is [0 srcALen+srcBLen-2]. If the requested subset does not fall in this range then the functions return RISCV_MATH_ARGUMENT_ERROR. Otherwise the functions return RISCV_MATH_SUCCESS.

Fast Versions

Fast versions are supported for Q31 and Q15 of partial convolution. Cycles for Fast versions are less compared to Q31 and Q15 of partial conv and the design requires the input signals should be scaled down to avoid intermediate overflows.

Opt Versions

Opt versions are supported for Q15 and Q7. Design uses internal scratch buffer for getting good optimisation. These versions are optimised in cycles and consumes more memory (Scratch memory) compared to Q15 and Q7 versions of partial convolution

Long versions:

For convolution of long vectors, those functions are no more adapted and will be very slow. An implementation based upon FFTs should be used.

Note

Refer to riscv_conv_f32() for details on fixed point behavior.

Functions

riscv_status riscv_conv_partial_f32(const float32_t *pSrcA, uint32_t srcALen, const float32_t *pSrcB, uint32_t srcBLen, float32_t *pDst, uint32_t firstIndex, uint32_t numPoints)

Partial convolution of floating-point sequences.

Parameters
  • pSrcA[in] points to the first input sequence

  • srcALen[in] length of the first input sequence

  • pSrcB[in] points to the second input sequence

  • srcBLen[in] length of the second input sequence

  • pDst[out] points to the location where the output result is written

  • firstIndex[in] is the first output sample to start with

  • numPoints[in] is the number of output points to be computed

Returns

execution status

  • RISCV_MATH_SUCCESS : Operation successful

  • RISCV_MATH_ARGUMENT_ERROR : requested subset is not in the range [0 srcALen+srcBLen-2]

riscv_status riscv_conv_partial_fast_opt_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints, q15_t *pScratch1, q15_t *pScratch2)

Partial convolution of Q15 sequences (fast version).

Partial convolution of Q15 sequences (fast version) for RISC-V Core with DSP enabled.

Remark

Refer to riscv_conv_partial_q15() for a slower implementation of this function which uses a 64-bit accumulator to avoid wrap around distortion.

Parameters
  • pSrcA[in] points to the first input sequence

  • srcALen[in] length of the first input sequence

  • pSrcB[in] points to the second input sequence

  • srcBLen[in] length of the second input sequence

  • pDst[out] points to the location where the output result is written

  • firstIndex[in] is the first output sample to start with

  • numPoints[in] is the number of output points to be computed

  • pScratch1[in] points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2

  • pScratch2[in] points to scratch buffer of size min(srcALen, srcBLen)

Returns

execution status

  • RISCV_MATH_SUCCESS : Operation successful

  • RISCV_MATH_ARGUMENT_ERROR : requested subset is not in the range [0 srcALen+srcBLen-2]

riscv_status riscv_conv_partial_fast_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints)

Partial convolution of Q15 sequences (fast version).

Partial convolution of Q15 sequences (fast version) for RISC-V Core with DSP enabled.

Remark

Refer to riscv_conv_partial_q15() for a slower implementation of this function which uses a 64-bit accumulator to avoid wrap around distortion.

Parameters
  • pSrcA[in] points to the first input sequence

  • srcALen[in] length of the first input sequence

  • pSrcB[in] points to the second input sequence

  • srcBLen[in] length of the second input sequence

  • pDst[out] points to the location where the output result is written

  • firstIndex[in] is the first output sample to start with

  • numPoints[in] is the number of output points to be computed

Returns

execution status

  • RISCV_MATH_SUCCESS : Operation successful

  • RISCV_MATH_ARGUMENT_ERROR : requested subset is not in the range [0 srcALen+srcBLen-2]

riscv_status riscv_conv_partial_fast_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst, uint32_t firstIndex, uint32_t numPoints)

Partial convolution of Q31 sequences (fast version).

Partial convolution of Q31 sequences (fast version) for RISC-V Core with DSP enabled.

Remark

Refer to riscv_conv_partial_q31() for a slower implementation of this function which uses a 64-bit accumulator to provide higher precision.

Parameters
  • pSrcA[in] points to the first input sequence

  • srcALen[in] length of the first input sequence

  • pSrcB[in] points to the second input sequence

  • srcBLen[in] length of the second input sequence

  • pDst[out] points to the location where the output result is written

  • firstIndex[in] is the first output sample to start with

  • numPoints[in] is the number of output points to be computed

Returns

execution status

  • RISCV_MATH_SUCCESS : Operation successful

  • RISCV_MATH_ARGUMENT_ERROR : requested subset is not in the range [0 srcALen+srcBLen-2]

riscv_status riscv_conv_partial_opt_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints, q15_t *pScratch1, q15_t *pScratch2)

Partial convolution of Q15 sequences.

Remark

Refer to riscv_conv_partial_fast_q15() for a faster but less precise version of this function.

Parameters
  • pSrcA[in] points to the first input sequence

  • srcALen[in] length of the first input sequence

  • pSrcB[in] points to the second input sequence

  • srcBLen[in] length of the second input sequence

  • pDst[out] points to the location where the output result is written

  • firstIndex[in] is the first output sample to start with

  • numPoints[in] is the number of output points to be computed

  • pScratch1[in] points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.

  • pScratch2[in] points to scratch buffer of size min(srcALen, srcBLen).

Returns

execution status

  • RISCV_MATH_SUCCESS : Operation successful

  • RISCV_MATH_ARGUMENT_ERROR : requested subset is not in the range [0 srcALen+srcBLen-2]

riscv_status riscv_conv_partial_opt_q7(const q7_t *pSrcA, uint32_t srcALen, const q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst, uint32_t firstIndex, uint32_t numPoints, q15_t *pScratch1, q15_t *pScratch2)

Partial convolution of Q7 sequences.

Parameters
  • pSrcA[in] points to the first input sequence

  • srcALen[in] length of the first input sequence

  • pSrcB[in] points to the second input sequence

  • srcBLen[in] length of the second input sequence

  • pDst[out] points to the location where the output result is written

  • firstIndex[in] is the first output sample to start with

  • numPoints[in] is the number of output points to be computed

  • pScratch1[in] points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2.

  • pScratch2[in] points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen).

Returns

execution status

  • RISCV_MATH_SUCCESS : Operation successful

  • RISCV_MATH_ARGUMENT_ERROR : requested subset is not in the range [0 srcALen+srcBLen-2]

riscv_status riscv_conv_partial_q15(const q15_t *pSrcA, uint32_t srcALen, const q15_t *pSrcB, uint32_t srcBLen, q15_t *pDst, uint32_t firstIndex, uint32_t numPoints)

Partial convolution of Q15 sequences.

Remark

Refer to riscv_conv_partial_fast_q15() for a faster but less precise version of this function.

Remark

Refer to riscv_conv_partial_opt_q15() for a faster implementation of this function using scratch buffers.

Parameters
  • pSrcA[in] points to the first input sequence

  • srcALen[in] length of the first input sequence

  • pSrcB[in] points to the second input sequence

  • srcBLen[in] length of the second input sequence

  • pDst[out] points to the location where the output result is written

  • firstIndex[in] is the first output sample to start with

  • numPoints[in] is the number of output points to be computed

Returns

execution status

  • RISCV_MATH_SUCCESS : Operation successful

  • RISCV_MATH_ARGUMENT_ERROR : requested subset is not in the range [0 srcALen+srcBLen-2]

riscv_status riscv_conv_partial_q31(const q31_t *pSrcA, uint32_t srcALen, const q31_t *pSrcB, uint32_t srcBLen, q31_t *pDst, uint32_t firstIndex, uint32_t numPoints)

Partial convolution of Q31 sequences.

Remark

Refer to riscv_conv_partial_fast_q31() for a faster but less precise implementation of this function.

Parameters
  • pSrcA[in] points to the first input sequence

  • srcALen[in] length of the first input sequence

  • pSrcB[in] points to the second input sequence

  • srcBLen[in] length of the second input sequence

  • pDst[out] points to the location where the output result is written

  • firstIndex[in] is the first output sample to start with

  • numPoints[in] is the number of output points to be computed

Returns

execution status

  • RISCV_MATH_SUCCESS : Operation successful

  • RISCV_MATH_ARGUMENT_ERROR : requested subset is not in the range [0 srcALen+srcBLen-2]

riscv_status riscv_conv_partial_q7(const q7_t *pSrcA, uint32_t srcALen, const q7_t *pSrcB, uint32_t srcBLen, q7_t *pDst, uint32_t firstIndex, uint32_t numPoints)

Partial convolution of Q7 sequences.

Remark

Refer to riscv_conv_partial_opt_q7() for a faster implementation of this function.

Parameters
  • pSrcA[in] points to the first input sequence

  • srcALen[in] length of the first input sequence

  • pSrcB[in] points to the second input sequence

  • srcBLen[in] length of the second input sequence

  • pDst[out] points to the location where the output result is written

  • firstIndex[in] is the first output sample to start with

  • numPoints[in] is the number of output points to be computed

Returns

execution status

  • RISCV_MATH_SUCCESS : Operation successful

  • RISCV_MATH_ARGUMENT_ERROR : requested subset is not in the range [0 srcALen+srcBLen-2]