std1.0.0-beta-7 SafeC docs

std :: dsp::complex_dsp

Struct std::Complex

#include <std/dsp/complex_dsp.h> source

struct Complex {
    double re;
    double im;
}

Fields

§double resource
§double imsource

Methods

§Complex operator+(Complex other) constsource · definition
§Complex operator-(Complex other) constsource · definition
§Complex operator*(Complex other) constsource · definition
§Complex operator/(Complex other) constsource · definition

negate — SafeC operator overloads aren't distinguished by arity, so unary '-' can't share the 'operator-' name with binary subtraction above

§double abs() constsource · definition

magnitude: sqrt(re^2 + im^2)

§double arg() constsource · definition

phase angle: atan2(im, re)

§Complex conj() constsource · definition

complex conjugate: (re, -im)

§static Complex new(double re, double im)source · definition
§static Complex polar(double magnitude, double theta)source · definition

magnitude * e^(i*theta) = magnitude * (cos(theta), sin(theta)) — the form FFT twiddle factors and oscillator/DFT kernels are naturally expressed in.