11#ifndef __SOF_MATH_TRIG_H__
12#define __SOF_MATH_TRIG_H__
16#define PI_Q4_28 843314857
17#define PI_MUL2_Q4_28 1686629713
18#define PI_DIV2_Q3_29 843314857
19#define PI_Q3_29 1686629713
21#define CORDIC_31B_TABLE_SIZE 31
22#define CORDIC_15B_TABLE_SIZE 15
23#define CORDIC_30B_ITABLE_SIZE 30
24#define CORDIC_16B_ITABLE_SIZE 16
25#define CORDIC_31B_ITERATIONS (CORDIC_31B_TABLE_SIZE - 1)
26#define CORDIC_16B_ITERATIONS (CORDIC_16B_ITABLE_SIZE - 1)
51void cordic_approx(int32_t th_rad_fxp, int32_t a_idx, int32_t *sign, int32_t *b_yn, int32_t *xn,
107 th_cdc_fxp = sign * b_yn;
139 th_cdc_fxp = sign * xn;
172 th_cdc_fxp = sign * b_yn;
205 th_cdc_fxp = sign * xn;
299 if (cdc_asin_th >= 0)
324 if (cdc_acos_th >= 0)
351 if (cdc_asin_th >= 0)
377 if (cdc_acos_th >= 0)
int32_t im
Definition trig.h:39
int32_t re
Definition trig.h:38
uint32_t type
Definition tlv.h:0
static void cmpx_exp_16b(int32_t th_rad_fxp, struct cordic_cmpx *cexp)
cmpx_exp_16b() - CORDIC-based approximation of complex exponential e^(j*THETA).
Definition trig.h:268
#define CORDIC_16B_ITERATIONS
Definition trig.h:26
static int16_t cos_fixed_16b(int32_t th_rad_fxp)
cos_fixed_16b() - Cosine function using CORDIC algorithm
Definition trig.h:196
cordic_cfg
Definition trig.h:28
@ EN_32B_CORDIC_SINE
Definition trig.h:29
@ EN_16B_CORDIC_CEXP
Definition trig.h:34
@ EN_16B_CORDIC_COSINE
Definition trig.h:33
@ EN_32B_CORDIC_COSINE
Definition trig.h:30
@ EN_32B_CORDIC_CEXP
Definition trig.h:31
@ EN_16B_CORDIC_SINE
Definition trig.h:32
int32_t sofm_atan2_32b(int32_t y, int32_t x)
sofm_atan2_32b() - Four-quadrant arctangent using degree-9 Remez minimax polynomial
int32_t is_scalar_cordic_asin(int32_t realvalue, int numiters_minus_one)
is_scalar_cordic_asin() - CORDIC-based approximation for inverse sine
#define CORDIC_31B_ITERATIONS
Definition trig.h:25
static int32_t cos_fixed_32b(int32_t th_rad_fxp)
cos_fixed_32b() - Cosine function using CORDIC algorithm
Definition trig.h:131
static void cmpx_exp_32b(int32_t th_rad_fxp, struct cordic_cmpx *cexp)
cmpx_exp_32b() - CORDIC-based approximation of complex exponential e^(j*THETA).
Definition trig.h:233
#define CORDIC_15B_TABLE_SIZE
Definition trig.h:22
int32_t is_scalar_cordic_acos(int32_t realvalue, int numiters_minus_one)
is_scalar_cordic_acos() - CORDIC-based approximation for inverse cosine
void cordic_approx(int32_t th_rad_fxp, int32_t a_idx, int32_t *sign, int32_t *b_yn, int32_t *xn, int32_t *th_cdc_fxp)
cordic_approx() - CORDIC-based approximation of sine and cosine
static int32_t sin_fixed_32b(int32_t th_rad_fxp)
sin_fixed_32b() - Sine function using CORDIC algorithm
Definition trig.h:99
#define PI_Q3_29
Definition trig.h:19
static int32_t acos_fixed_32b(int32_t cdc_acos_th)
acos_fixed_32b() - CORDIC-based approximation of inverse cosine
Definition trig.h:320
#define CORDIC_31B_TABLE_SIZE
Definition trig.h:21
static int16_t acos_fixed_16b(int32_t cdc_acos_th)
acos_fixed_16b() - CORDIC-based approximation of inverse cosine
Definition trig.h:373
void cmpx_cexp(int32_t sign, int32_t b_yn, int32_t xn, cordic_cfg type, struct cordic_cmpx *cexp)
cmpx_cexp() - CORDIC-based approximation of complex exponential e^(j*THETA)
static int32_t asin_fixed_32b(int32_t cdc_asin_th)
asin_fixed_32b() - CORDIC-based approximation of inverse sine
Definition trig.h:295
static int16_t sin_fixed_16b(int32_t th_rad_fxp)
sin_fixed_16b() - Sine function using CORDIC algorithm
Definition trig.h:163
static int16_t asin_fixed_16b(int32_t cdc_asin_th)
asin_fixed_16b() - CORDIC-based approximation of inverse sine
Definition trig.h:347