fix fft grad

This commit is contained in:
2026-04-22 17:08:09 +03:00
parent 45215c1529
commit 69e8f5e75b
2 changed files with 3 additions and 3 deletions

View File

@@ -12,13 +12,13 @@ auto main() -> int
setup.m_file = "/mnt/raid/projects/dsp/songs/base/MakSim: Знаешь ли ты?.mp3";
auto r = hr::run<hr::plugins::fft>(setup);
hack::log()("grad:", r.m_grad);
hack::log()("grad:", r.m_grad.size());
hack::log()("min:", r.m_min, "max:", r.m_max);
hack::log()("size:", r.m_size);
if (!r.empty())
{
for (auto& p : r.m_data)
hack::log()(p[10].m_values, p[10].m_min, p[10].m_max);
hack::log()(p[10].m_values.size(), p[10].m_min, p[10].m_max);
}
}

View File

@@ -19,7 +19,7 @@ namespace hr::plugins
auto step = m_setup.m_step_size + 1;
m_result.m_grad.reserve(step);
for (size_t i = 0; i < step; ++i)
m_result.m_grad.push_back(static_cast<float>(i) * m_setup.m_sample_rate / m_setup.m_block_size);
m_result.m_grad.push_back(static_cast<float>(i) * m_setup.m_sample_rate / m_setup.m_block_size / 1'000);
}
void fft::process(fvec_t& base, real_time timestamp)