![]() |
SH4ZAM! 0.1.0
Fast math library for the Sega Dreamcast's SH4 CPU
|


Go to the source code of this file.
Data Structures | |
| struct | shz_complex_t |
Macros | |
Preprocessor | |
Macros and preprocessor constants. | |
| #define | SHZ_CMPLXF(x, y) |
| #define | SHZ_CMPLXF32(x, y) |
| #define | SHZ_I |
Typedefs | |
| typedef shz_complex_t | shz_complex |
Complex number API.
This file contains a collection of routines for working with complex (real + imaginary) numbers. The API is mostly modeled after C99's <complex.h>, although it also supports being used from C++ as well.
Definition in file shz_complex.h.
| #define SHZ_CMPLXF | ( | x, | |
| y ) |
Initializes a complex number.
Definition at line 38 of file shz_complex.h.
| #define SHZ_CMPLXF32 | ( | x, | |
| y ) |
Initializes a complex number.
Definition at line 39 of file shz_complex.h.
| #define SHZ_I |
Unit imaginary constant, 'I'.
Definition at line 40 of file shz_complex.h.
| typedef shz_complex_t shz_complex |
shz_complex_t alias for those who don't like POSIX-style.
Definition at line 53 of file shz_complex.h.
| shz_complex_t shz_cinitf | ( | float | real, |
| float | imag ) |
Returns a complex number which has been initialized to contain the given component values.
| shz_complex_t shz_cpolarf | ( | float | r, |
| float | theta ) |
Returns a complex number with a magnitude of r, and a phase angle of theta (in radians).
| bool shz_cequalf | ( | shz_complex_t | lhs, |
| shz_complex_t | rhs ) |
Checks for equality between two complex numbers with either an absolute or relative tolerance.
| float shz_crealf | ( | shz_complex_t | c | ) |
Returns the real component of a complex number.
| float shz_cimagf | ( | shz_complex_t | c | ) |
Returns the imaginary component of a complex number.
| shz_complex_t shz_caddf | ( | shz_complex_t | lhs, |
| shz_complex_t | rhs ) |
Adds two complex numbers together and returns the result.
| shz_complex_t shz_csubf | ( | shz_complex_t | lhs, |
| shz_complex_t | rhs ) |
Subtracts rhs from lhs and returns the complex result.
| shz_complex_t shz_cmulf | ( | shz_complex_t | lhs, |
| shz_complex_t | rhs ) |
Multiplies two complex numbers together, returning the complex result.
| shz_complex_t shz_cdivf | ( | shz_complex_t | lhs, |
| shz_complex_t | rhs ) |
Divides lhs by rhs, returning the complex result.
| shz_complex_t shz_cscalef | ( | shz_complex_t | c, |
| float | v ) |
Scales both componets of the complex number, c, by the value, v, returning the result.
| shz_complex_t shz_crecipf | ( | shz_complex_t | c | ) |
Returns the multiplicative inverse or reciprocal of the complex number, c.
| float shz_cabsf | ( | shz_complex_t | c | ) |
Returns the absolute value (or magnitude) of the complex number, c.
| float shz_inv_cabsf | ( | shz_complex_t | c | ) |
Returns the inverse of the absolute value (or inverse of the magnitude) of the complex number, c.
| float shz_cnormf | ( | shz_complex_t | c | ) |
Returns the squared magnitude of the complex number, c.
| float shz_cargf | ( | shz_complex_t | c | ) |
Returns the phase angle of the complex number, c.
| shz_complex_t shz_conjf | ( | shz_complex_t | c | ) |
Returns the complex conjugate of c.
| shz_complex_t shz_cprojf | ( | shz_complex_t | c | ) |
Calculates the projection of the complex number, c, onto the Riemann sphere.
| shz_complex_t shz_csqrtf | ( | shz_complex_t | c | ) |
Computes and returns the complex square root of c.
| shz_complex_t shz_cpowf | ( | shz_complex_t | base, |
| shz_complex_t | exp ) |
Raises the complex base to the complex exp power, returning a complex result.
| shz_complex_t shz_cexpf | ( | shz_complex_t | c | ) |
Returns the complex base e exponential of c.
| shz_complex_t shz_clogf | ( | shz_complex_t | c | ) |
Computes and returns the complex natural logarithm of c.
| shz_complex_t shz_clog10f | ( | shz_complex_t | c | ) |
Computes and returns the complex base 10 logarithm of c.
| shz_complex_t shz_csinf | ( | shz_complex_t | c | ) |
Calculates and returns the complex sine of c.
| shz_complex_t shz_ccosf | ( | shz_complex_t | c | ) |
Calculates and returns the complex cosine of c.
| shz_complex_t shz_ctanf | ( | shz_complex_t | c | ) |
Calculates and returns the complex tangent of c.
| shz_complex_t shz_ccscf | ( | shz_complex_t | c | ) |
Calculates and returns the complex cosecant of c.
| shz_complex_t shz_csecf | ( | shz_complex_t | c | ) |
Calculates and returns the complex secant of c.
| shz_complex_t shz_ccotf | ( | shz_complex_t | c | ) |
Calculates and returns the complex cotangent of c.
| shz_complex_t shz_casinf | ( | shz_complex_t | c | ) |
Calculates and returns the complex arcsine of c.
| shz_complex_t shz_cacosf | ( | shz_complex_t | c | ) |
Calculates and returns the complex arccosine of c.
| shz_complex_t shz_catanf | ( | shz_complex_t | c | ) |
Calculates and returns the complex arctangent of c.
| shz_complex_t shz_cacscf | ( | shz_complex_t | c | ) |
Calculates and returns the complex arccosecant of c.
| shz_complex_t shz_casecf | ( | shz_complex_t | c | ) |
Calculates and returns the complex arcsecant of c.
| shz_complex_t shz_cacotf | ( | shz_complex_t | c | ) |
Calculates and returns the complex arccotangent of c.
| shz_complex_t shz_csinhf | ( | shz_complex_t | c | ) |
Calculates and returns the complex hyperbolic sine of c.
| shz_complex_t shz_ccoshf | ( | shz_complex_t | c | ) |
Calculates and returns the complex hyperbolic cosine of c.
| shz_complex_t shz_ctanhf | ( | shz_complex_t | c | ) |
Calculates and returns the complex hyperbolic tangent of c.
| shz_complex_t shz_ccschf | ( | shz_complex_t | c | ) |
Calculates and returns the complex hyperbolic cosecant of c.
| shz_complex_t shz_csechf | ( | shz_complex_t | c | ) |
Calculates and returns the complex hyperbolic secant of c.
| shz_complex_t shz_ccothf | ( | shz_complex_t | c | ) |
Calculates and returns the complex hyperbolic cotangent of c.
| shz_complex_t shz_casinhf | ( | shz_complex_t | c | ) |
Calculates and returns the complex hyperbolic arcsine of c.
| shz_complex_t shz_cacoshf | ( | shz_complex_t | c | ) |
Calculates and returns the complex hyperbolic arccosine of c.
| shz_complex_t shz_catanhf | ( | shz_complex_t | c | ) |
Calculates and returns the complex hyperbolic arctangent of c.
| shz_complex_t shz_cacschf | ( | shz_complex_t | c | ) |
Calculates and returns the complex hyperbolic arccosecant of c.
| shz_complex_t shz_casechf | ( | shz_complex_t | c | ) |
Calculates and returns the complex hyperbolic arcsecant of c.
| shz_complex_t shz_cacothf | ( | shz_complex_t | c | ) |
Calculates and returns the complex hyperbolic arccotangent of c.
| void shz_fft | ( | shz_complex_t * | s, |
| size_t | size ) |
Fast Fourier Transform.
Applies a fast fourier transform to convert the complex array of samples, s, of the given size, from the time to the frequency domain. The conversion is done in-place.
size must be a power-of-two! XMTRX!