spandsp 0.0.6
math_fixed.c File Reference
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <float.h>
#include "floating_fudge.h"
#include <assert.h>
#include "math_fixed_tables.h"
#include "spandsp/telephony.h"
#include "spandsp/bit_operations.h"
#include "spandsp/math_fixed.h"

Functions

uint16_t fixed_reciprocal16 (uint16_t x, int *shift)
 
uint16_t fixed_divide16 (uint16_t y, uint16_t x)
 
uint16_t fixed_divide32 (uint32_t y, uint16_t x)
 
int16_t fixed_log10_16 (uint16_t x)
 
int32_t fixed_log10_32 (uint32_t x)
 
uint16_t fixed_sqrt16 (uint16_t x)
 
uint16_t fixed_sqrt32 (uint32_t x)
 
int16_t fixed_sin (uint16_t x)
 Evaluate an approximate 16 bit fixed point sine. More...
 
int16_t fixed_cos (uint16_t x)
 Evaluate an approximate 16 bit fixed point cosine. More...
 
uint16_t fixed_atan2 (int16_t y, int16_t x)
 Evaluate an approximate 16 bit fixed point sine. More...
 

Function Documentation

◆ fixed_atan2()

uint16_t fixed_atan2 ( int16_t  y,
int16_t  x 
)

Evaluate an approximate 16 bit fixed point sine.

Evaluate an approximate 16 bit fixed point sine.

Parameters
y.
x.
Returns
The 16 bit unsigned angle, in 360/65536 degree steps.

◆ fixed_cos()

int16_t fixed_cos ( uint16_t  x)

Evaluate an approximate 16 bit fixed point cosine.

Evaluate an approximate 16 bit fixed point cosine.

Parameters
xA 16 bit unsigned angle, in 360/65536 degree steps.
Returns
cos(x)*32767.

◆ fixed_sin()

int16_t fixed_sin ( uint16_t  x)

Evaluate an approximate 16 bit fixed point sine.

Evaluate an approximate 16 bit fixed point sine.

Parameters
xA 16 bit unsigned angle, in 360/65536 degree steps.
Returns
sin(x)*32767.