Sound Design Toolkit 075 Physically informed sound synthesis for everyday sounds

- Main Page
- Modules
- Data Structures
- Files

Data Structures | Typedefs | Functions
SDTComplex.h: Handling complex numbers

## Data Structures
struct | SDTComplex
| Data structure containing the real and imaginary part of a complex number. More...

## Typedefs
typedef struct SDTComplex | SDTComplex
| Data structure containing the real and imaginary part of a complex number.

## Functions
SDTComplex | SDTComplex_cart (double real, double imag)
| Returns a complex number with the given real and imaginary parts. More...
SDTComplex | SDTComplex_exp (double phase)
| Returns a complex exponential with base e and given phase. More...
SDTComplex | SDTComplex_conj (SDTComplex a)
| Returns the complex conjugate of a complex number. More...
double | SDTComplex_abs (SDTComplex a)
| Returns the absolute value (magnitude) of a complex number. More...
SDTComplex | SDTComplex_add (SDTComplex a, SDTComplex b)
| Returns the sum of two complex numbers. More...
SDTComplex | SDTComplex_sub (SDTComplex a, SDTComplex b)
| Returns the difference of two complex numbers. More...
SDTComplex | SDTComplex_mult (SDTComplex a, SDTComplex b)
| Returns the multiplication between two complex numbers. More...
SDTComplex | SDTComplex_div (SDTComplex a, SDTComplex b)
| Returns the division between two complex numbers. More...
SDTComplex | SDTComplex_addReal (SDTComplex a, double b)
| Returns the sum of a complex number and a real number. More...
SDTComplex | SDTComplex_subReal (SDTComplex a, double b)
| Returns the difference of a complex number and a real number. More...
SDTComplex | SDTComplex_realSub (double a, SDTComplex b)
| Returns the difference of a real number and a complex number. More...
SDTComplex | SDTComplex_multReal (SDTComplex a, double b)
| Returns the multiplication between a complex number and a real number. More...
SDTComplex | SDTComplex_divReal (SDTComplex a, double b)
| Returns the division between a complex number and a real number. More...
SDTComplex | SDTComplex_realDiv (double a, SDTComplex b)
| Returns the division between a real number and a complex number. More...

## Detailed Description

This module contains data structures and functions to perform basic operations with complex numbers.

## Function Documentation

double SDTComplex_abs | ( | SDTComplex | a | ) |

Returns the absolute value (magnitude) of a complex number.

Parameters

  [in] | a | Input value

Returns
  Absolute value of input

SDTComplex SDTComplex_add | ( | SDTComplex | a,
|  | SDTComplex | b
| ) |  |

Returns the sum of two complex numbers.

Parameters

  [in] | a | First operand
  [in] | b | Second operand

Returns
  a plus b

SDTComplex SDTComplex_addReal | ( | SDTComplex | a,
|  | double | b
| ) |  |

Returns the sum of a complex number and a real number.

Parameters

  [in] | a | Complex operand
  [in] | b | Real operand

Returns
  a plus b

SDTComplex SDTComplex_cart | ( | double | real,
|  | double | imag
| ) |  |

Returns a complex number with the given real and imaginary parts.

Parameters

  [in] | real | Real part
  [in] | imag | Imaginary part

Returns
  Complex number

SDTComplex SDTComplex_conj | ( | SDTComplex | a | ) |

Returns the complex conjugate of a complex number.

Parameters

  [in] | a | Input value

Returns
  Complex conjugate of input

SDTComplex SDTComplex_div | ( | SDTComplex | a,
|  | SDTComplex | b
| ) |  |

Returns the division between two complex numbers.

Parameters

  [in] | a | First operand
  [in] | b | Second operand

Returns
  a divided by b

SDTComplex SDTComplex_divReal | ( | SDTComplex | a,
|  | double | b
| ) |  |

Returns the division between a complex number and a real number.

Parameters

  [in] | a | Complex operand
  [in] | b | Real operand

Returns
  a divided by b

SDTComplex SDTComplex_exp | ( | double | phase | ) |

Returns a complex exponential with base e and given phase.

Parameters

  [in] | phase | Phase

Returns
  Complex exponential

SDTComplex SDTComplex_mult | ( | SDTComplex | a,
|  | SDTComplex | b
| ) |  |

Returns the multiplication between two complex numbers.

Parameters

  [in] | a | First operand
  [in] | b | Second operand

Returns
  a times b

SDTComplex SDTComplex_multReal | ( | SDTComplex | a,
|  | double | b
| ) |  |

Returns the multiplication between a complex number and a real number.

Parameters

  [in] | a | Complex operand
  [in] | b | Real operand

Returns
  a times b

SDTComplex SDTComplex_realDiv | ( | double | a,
|  | SDTComplex | b
| ) |  |

Returns the division between a real number and a complex number.

Parameters

  [in] | a | Real operand
  [in] | b | Complex operand

Returns
  a divided by b

SDTComplex SDTComplex_realSub | ( | double | a,
|  | SDTComplex | b
| ) |  |

Returns the difference of a real number and a complex number.

Parameters

  [in] | a | Real operand
  [in] | b | Complex operand

Returns
  a minus b

SDTComplex SDTComplex_sub | ( | SDTComplex | a,
|  | SDTComplex | b
| ) |  |

Returns the difference of two complex numbers.

Parameters

  [in] | a | First operand
  [in] | b | Second operand

Returns
  a minus b

SDTComplex SDTComplex_subReal | ( | SDTComplex | a,
|  | double | b
| ) |  |

Returns the difference of a complex number and a real number.

Parameters

  [in] | a | Complex operand
  [in] | b | Real operand

Returns
  a minus b