Commit f5b673dc authored by kenkangxgwe's avatar kenkangxgwe Committed by Chromium LUCI CQ

[Cast] Fix angle calculation in LinearChirp

Bug: None
Test: run cast_media_audio_unittests --gtest_filter=*PostProcessorTest.*
Change-Id: I742ed1cad68d81677d90b98682f1d473c05e20a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2591915Reviewed-by: default avatarKenneth MacKay <kmackay@chromium.org>
Commit-Queue: Mingyu Kang <kenkangxgwe@google.com>
Cr-Commit-Position: refs/heads/master@{#838750}
parent 256e7a49
...@@ -46,9 +46,9 @@ AlignedBuffer<float> LinearChirp(int frames, ...@@ -46,9 +46,9 @@ AlignedBuffer<float> LinearChirp(int frames,
for (size_t ch = 0; ch < start_frequencies.size(); ++ch) { for (size_t ch = 0; ch < start_frequencies.size(); ++ch) {
double angle = 0.0; double angle = 0.0;
for (int f = 0; f < frames; ++f) { for (int f = 0; f < frames; ++f) {
angle += angle += (start_frequencies[ch] +
start_frequencies[ch] + (end_frequencies[ch] - start_frequencies[ch]) * f / frames) *
(end_frequencies[ch] - start_frequencies[ch]) * f * M_PI / frames; M_PI;
chirp[ch + f * start_frequencies.size()] = sin(angle); chirp[ch + f * start_frequencies.size()] = sin(angle);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment