17#ifndef __SOF_MATH_TRIG_H__
18#define __SOF_MATH_TRIG_H__
22#define PI_Q4_28 843314857
23#define PI_MUL2_Q4_28 1686629713
24#define PI_DIV2_Q3_29 843314857
25#define PI_Q3_29 1686629713
27#define CORDIC_31B_TABLE_SIZE 31
28#define CORDIC_15B_TABLE_SIZE 15
29#define CORDIC_30B_ITABLE_SIZE 30
30#define CORDIC_16B_ITABLE_SIZE 16
31#define CORDIC_31B_ITERATIONS (CORDIC_31B_TABLE_SIZE - 1)
32#define CORDIC_16B_ITERATIONS (CORDIC_16B_ITABLE_SIZE - 1)
57void cordic_approx(int32_t th_rad_fxp, int32_t a_idx, int32_t *sign, int32_t *b_yn, int32_t *xn,
113 th_cdc_fxp = sign * b_yn;
145 th_cdc_fxp = sign * xn;
178 th_cdc_fxp = sign * b_yn;
211 th_cdc_fxp = sign * xn;
305 if (cdc_asin_th >= 0)
330 if (cdc_acos_th >= 0)
357 if (cdc_asin_th >= 0)
383 if (cdc_acos_th >= 0)
int32_t im
Definition trig.h:45
int32_t re
Definition trig.h:44
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:274
#define CORDIC_16B_ITERATIONS
Definition trig.h:32
static int16_t cos_fixed_16b(int32_t th_rad_fxp)
cos_fixed_16b() - Cosine function using CORDIC algorithm
Definition trig.h:202
cordic_cfg
Definition trig.h:34
@ EN_32B_CORDIC_SINE
Definition trig.h:35
@ EN_16B_CORDIC_CEXP
Definition trig.h:40
@ EN_16B_CORDIC_COSINE
Definition trig.h:39
@ EN_32B_CORDIC_COSINE
Definition trig.h:36
@ EN_32B_CORDIC_CEXP
Definition trig.h:37
@ EN_16B_CORDIC_SINE
Definition trig.h:38
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:31
static int32_t cos_fixed_32b(int32_t th_rad_fxp)
cos_fixed_32b() - Cosine function using CORDIC algorithm
Definition trig.h:137
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:239
#define CORDIC_15B_TABLE_SIZE
Definition trig.h:28
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:105
#define PI_Q3_29
Definition trig.h:25
static int32_t acos_fixed_32b(int32_t cdc_acos_th)
acos_fixed_32b() - CORDIC-based approximation of inverse cosine
Definition trig.h:326
#define CORDIC_31B_TABLE_SIZE
Definition trig.h:27
static int16_t acos_fixed_16b(int32_t cdc_acos_th)
acos_fixed_16b() - CORDIC-based approximation of inverse cosine
Definition trig.h:379
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:301
static int16_t sin_fixed_16b(int32_t th_rad_fxp)
sin_fixed_16b() - Sine function using CORDIC algorithm
Definition trig.h:169
static int16_t asin_fixed_16b(int32_t cdc_asin_th)
asin_fixed_16b() - CORDIC-based approximation of inverse sine
Definition trig.h:353