LMMS
Loading...
Searching...
No Matches
dsp::bandlimiter< SIZE_BITS > Struct Template Reference

#include <osc.h>

Public Types

enum  { SIZE = 1 << SIZE_BITS }

Public Member Functions

void compute_spectrum (float input[SIZE])
 Import time domain waveform and calculate spectrum from it.
void compute_waveform (float output[SIZE])
 Generate the waveform from the contained spectrum.
void remove_dc ()
 remove DC offset of the spectrum (it usually does more harm than good!)
void make_waveform (float output[SIZE], int cutoff, bool foldover=false)

Static Public Member Functions

static dsp::fft< float, SIZE_BITS > & get_fft ()

Public Attributes

std::complex< float > spectrum [SIZE]

Detailed Description

template<int SIZE_BITS>
struct dsp::bandlimiter< SIZE_BITS >

FFT-based bandlimiting helper class. Allows conversion between time and frequency domains and generating brickwall filtered versions of a waveform given a pre-computed spectrum. Waveform size must be a power of two, and template argument SIZE_BITS is log2 of waveform size.

Member Enumeration Documentation

◆ anonymous enum

template<int SIZE_BITS>
anonymous enum
Enumerator
SIZE 

Member Function Documentation

◆ compute_spectrum()

template<int SIZE_BITS>
void dsp::bandlimiter< SIZE_BITS >::compute_spectrum ( float input[SIZE])
inline

Import time domain waveform and calculate spectrum from it.

◆ compute_waveform()

template<int SIZE_BITS>
void dsp::bandlimiter< SIZE_BITS >::compute_waveform ( float output[SIZE])
inline

Generate the waveform from the contained spectrum.

◆ get_fft()

template<int SIZE_BITS>
dsp::fft< float, SIZE_BITS > & dsp::bandlimiter< SIZE_BITS >::get_fft ( )
inlinestatic

◆ make_waveform()

template<int SIZE_BITS>
void dsp::bandlimiter< SIZE_BITS >::make_waveform ( float output[SIZE],
int cutoff,
bool foldover = false )
inline

Very basic bandlimiting (brickwall filter) might need to be improved much in future!

◆ remove_dc()

template<int SIZE_BITS>
void dsp::bandlimiter< SIZE_BITS >::remove_dc ( )
inline

remove DC offset of the spectrum (it usually does more harm than good!)

Member Data Documentation

◆ spectrum

template<int SIZE_BITS>
std::complex<float> dsp::bandlimiter< SIZE_BITS >::spectrum[SIZE]

The documentation for this struct was generated from the following file: