From 1861460abf26bd68fb0695d07e827222881848d5 Mon Sep 17 00:00:00 2001 From: Martin Pavelek Date: Thu, 14 Mar 2019 14:04:00 +0100 Subject: [PATCH 1/2] Fix Blackman-Harris window formula, adjust formatting --- plugins/Eq/EqSpectrumView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/Eq/EqSpectrumView.cpp b/plugins/Eq/EqSpectrumView.cpp index 677c896fbb7..295418dbc4a 100644 --- a/plugins/Eq/EqSpectrumView.cpp +++ b/plugins/Eq/EqSpectrumView.cpp @@ -45,11 +45,11 @@ EqAnalyser::EqAnalyser() : const float a2 = 0.14128; const float a3 = 0.01168; - for(int i = 0; i < FFT_BUFFER_SIZE; i++) + for (int i = 0; i < FFT_BUFFER_SIZE; i++) { - m_fftWindow[i] = ( a0 - a1 * cosf( 2 * F_PI * i / (float)FFT_BUFFER_SIZE - 1 ) - + a2 * cosf( 4 * F_PI * i / (float)FFT_BUFFER_SIZE-1) - - a3 * cos( 6 * F_PI * i / (float)FFT_BUFFER_SIZE - 1.0 )); + m_fftWindow[i] = (a0 - a1 * cos( 2 * F_PI * i / ((float)FFT_BUFFER_SIZE - 1.0)) + + a2 * cos( 4 * F_PI * i / ((float)FFT_BUFFER_SIZE - 1.0)) + - a3 * cos( 6 * F_PI * i / ((float)FFT_BUFFER_SIZE - 1.0))); } clear(); } From a3d3b281d0ffb468cf8ed883c596d8b05c5e622b Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Sun, 17 Mar 2019 22:59:41 +0900 Subject: [PATCH 2/2] Update EqSpectrumView.cpp --- plugins/Eq/EqSpectrumView.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Eq/EqSpectrumView.cpp b/plugins/Eq/EqSpectrumView.cpp index 295418dbc4a..456ca4871db 100644 --- a/plugins/Eq/EqSpectrumView.cpp +++ b/plugins/Eq/EqSpectrumView.cpp @@ -47,9 +47,9 @@ EqAnalyser::EqAnalyser() : for (int i = 0; i < FFT_BUFFER_SIZE; i++) { - m_fftWindow[i] = (a0 - a1 * cos( 2 * F_PI * i / ((float)FFT_BUFFER_SIZE - 1.0)) - + a2 * cos( 4 * F_PI * i / ((float)FFT_BUFFER_SIZE - 1.0)) - - a3 * cos( 6 * F_PI * i / ((float)FFT_BUFFER_SIZE - 1.0))); + m_fftWindow[i] = (a0 - a1 * cos(2 * F_PI * i / ((float)FFT_BUFFER_SIZE - 1.0)) + + a2 * cos(4 * F_PI * i / ((float)FFT_BUFFER_SIZE - 1.0)) + - a3 * cos(6 * F_PI * i / ((float)FFT_BUFFER_SIZE - 1.0))); } clear(); }