MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / make_patterned_f32

Function make_patterned_f32

tests/unittests/test_encoder_modules.cpp:160–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158using ModuleRunner = CpuModuleRunner;
159
160std::vector<float> make_patterned_f32(size_t count, float phase, float scale) {
161 std::vector<float> values(count, 0.0f);
162 for (size_t i = 0; i < count; ++i) {
163 const float x = static_cast<float>(i);
164 values[i] = scale * (std::sin(phase + 0.173f * x) + 0.5f * std::cos(phase * 0.7f + 0.097f * x));
165 }
166 return values;
167}
168
169std::vector<float> make_global_attention_bias_for_test(int64_t frames, int64_t valid_frames) {
170 std::vector<float> mask(static_cast<size_t>(frames * frames), -std::numeric_limits<float>::infinity());

Calls

no outgoing calls

Tested by

no test coverage detected