MCPcopy Create free account
hub / github.com/FastLED/FastLED / makeAdversarialSine

Function makeAdversarialSine

tests/fl/audio/fft/fft.cpp:674–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

672namespace { // adversarial_binning
673
674fl::vector<fl::i16> makeAdversarialSine(float freq, int count = 512,
675 float sampleRate = 44100.0f,
676 float amplitude = 16000.0f) {
677 fl::vector<fl::i16> samples;
678 samples.reserve(count);
679 for (int i = 0; i < count; ++i) {
680 float phase = 2.0f * FL_M_PI * freq * static_cast<float>(i) / sampleRate;
681 samples.push_back(static_cast<fl::i16>(amplitude * fl::sinf(phase)));
682 }
683 return samples;
684}
685
686fl::vector<fl::i16> makeTwoTone(float freq1, float freq2, int count = 512,
687 float sampleRate = 44100.0f,

Callers 1

FL_TEST_FILEFunction · 0.85

Calls 3

sinfFunction · 0.85
reserveMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected