Klang C++
Language Reference (draft)
Loading...
Searching...
No Matches
klang::SampleRate

Sample rate constants. More...

#include <klang.h>

Public Member Functions

 SampleRate (float sr)
 
 operator float ()
 

Public Attributes

float f
 sample rate (float)
 
int i
 sample rate (integer)
 
double d
 sample rate (double)
 
float inv
 1 / sample rate (inverse)
 
float w
 angular frequency (omega)
 
float nyquist
 nyquist frequency (f / 2)
 

Detailed Description

Definition at line 891 of file klang.h.

Constructor & Destructor Documentation

◆ SampleRate()

klang::SampleRate::SampleRate ( float sr)
inline

Definition at line 899 of file klang.h.

899: f(sr), i(int(sr+0.001f)), d((double)sr), inv(1.f / sr), w(2.0f * pi * inv), nyquist(sr / 2.f) { }
constexpr constant pi
The mathematical constant, pi (and it's inverse).
Definition klang.h:218
float w
angular frequency (omega)
Definition klang.h:896
float nyquist
nyquist frequency (f / 2)
Definition klang.h:897
int i
sample rate (integer)
Definition klang.h:893
float f
sample rate (float)
Definition klang.h:892
double d
sample rate (double)
Definition klang.h:894
float inv
1 / sample rate (inverse)
Definition klang.h:895

References d, f, i, inv, nyquist, klang::pi, and w.

Member Function Documentation

◆ operator float()

klang::SampleRate::operator float ( )
inline

Definition at line 901 of file klang.h.

901{ return f; }

References f.

Member Data Documentation

◆ d

double klang::SampleRate::d

Definition at line 894 of file klang.h.

Referenced by SampleRate().

◆ f

float klang::SampleRate::f

Definition at line 892 of file klang.h.

Referenced by SampleRate(), and operator float().

◆ i

int klang::SampleRate::i

Definition at line 893 of file klang.h.

Referenced by SampleRate().

◆ inv

float klang::SampleRate::inv

Definition at line 895 of file klang.h.

Referenced by SampleRate(), and klang::Filters::Butterworth::LPF::init().

◆ nyquist

float klang::SampleRate::nyquist

Definition at line 897 of file klang.h.

Referenced by SampleRate().

◆ w