Sound Design Toolkit  078
Physically informed sound synthesis for everyday sounds
SDTComplex.h
1 
7 #ifndef SDT_COMPLEX_H
8 #define SDT_COMPLEX_H
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
15 typedef struct SDTComplex {
16  double r, i;
17 } SDTComplex;
18 
23 extern SDTComplex SDTComplex_car(double real, double imag);
24 
28 extern SDTComplex SDTComplex_exp(double phase);
29 
33 extern double SDTComplex_abs(SDTComplex a);
34 
38 extern double SDTComplex_angle(SDTComplex a);
39 
44 
50 
56 
62 
68 
73 extern SDTComplex SDTComplex_addReal(SDTComplex a, double b);
74 
79 extern SDTComplex SDTComplex_subReal(SDTComplex a, double b);
80 
85 extern SDTComplex SDTComplex_realSub(double a, SDTComplex b);
86 
91 extern SDTComplex SDTComplex_multReal(SDTComplex a, double b);
92 
97 extern SDTComplex SDTComplex_divReal(SDTComplex a, double b);
98 
103 extern SDTComplex SDTComplex_realDiv(double a, SDTComplex b);
104 
105 #ifdef __cplusplus
106 };
107 #endif
108 
109 #endif
110 
SDTComplex SDTComplex_realSub(double a, SDTComplex b)
Returns the difference of a real number and a complex number.
SDTComplex SDTComplex_exp(double phase)
Returns a complex exponential with base e and given phase.
SDTComplex SDTComplex_add(SDTComplex a, SDTComplex b)
Returns the sum of two complex numbers.
struct SDTComplex SDTComplex
Data structure containing the real and imaginary part of a complex number.
SDTComplex SDTComplex_realDiv(double a, SDTComplex b)
Returns the division between a real number and a complex number.
Data structure containing the real and imaginary part of a complex number.
Definition: SDTComplex.h:15
SDTComplex SDTComplex_car(double real, double imag)
Returns a complex number with the given real and imaginary parts.
SDTComplex SDTComplex_multReal(SDTComplex a, double b)
Returns the multiplication between a complex number and a real number.
SDTComplex SDTComplex_addReal(SDTComplex a, double b)
Returns the sum of a complex number and a real number.
double SDTComplex_angle(SDTComplex a)
Returns the angle (phase) of a complex number.
SDTComplex SDTComplex_subReal(SDTComplex a, double b)
Returns the difference of a complex number and a real number.
SDTComplex SDTComplex_divReal(SDTComplex a, double b)
Returns the division between a complex number and a real number.
SDTComplex SDTComplex_div(SDTComplex a, SDTComplex b)
Returns the division between two complex numbers.
SDTComplex SDTComplex_sub(SDTComplex a, SDTComplex b)
Returns the difference of two complex numbers.
double SDTComplex_abs(SDTComplex a)
Returns the absolute value (magnitude) of a complex number.
SDTComplex SDTComplex_conj(SDTComplex a)
Returns the complex conjugate of a complex number.
SDTComplex SDTComplex_mult(SDTComplex a, SDTComplex b)
Returns the multiplication between two complex numbers.