summaryrefslogtreecommitdiff
path: root/gtk2_ardour/fft.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-02-28 03:08:21 +0100
committerRobin Gareus <robin@gareus.org>2019-02-28 03:08:21 +0100
commit62470f3cb431e8378af303ad53f92b4948c459ad (patch)
tree6738d4f371ecdbfd92307b98a43b66fdf2f8189e /gtk2_ardour/fft.cc
parent06854e131520077b41e4da2bb6dc0f7141609be5 (diff)
NO-OP: whitespace
Diffstat (limited to 'gtk2_ardour/fft.cc')
-rw-r--r--gtk2_ardour/fft.cc31
1 files changed, 15 insertions, 16 deletions
diff --git a/gtk2_ardour/fft.cc b/gtk2_ardour/fft.cc
index ec9af2fd3e..b9a23f3571 100644
--- a/gtk2_ardour/fft.cc
+++ b/gtk2_ardour/fft.cc
@@ -76,7 +76,7 @@ FFT::analyze(ARDOUR::Sample *input, WindowingType windowing_type)
#define Re (_fftOutput[i])
#define Im (_fftOutput[_window_size-i])
- for (uint32_t i=1; i < _data_size - 1; i++) {
+ for (uint32_t i = 1; i < _data_size - 1; ++i) {
power = (Re * Re) + (Im * Im);
phase = atanf(Im / Re);
@@ -95,7 +95,7 @@ FFT::analyze(ARDOUR::Sample *input, WindowingType windowing_type)
}
void
-FFT::calculate()
+FFT::calculate ()
{
if (_iterations > 1) {
for (uint32_t i=0; i < _data_size - 1; i++) {
@@ -106,32 +106,31 @@ FFT::calculate()
}
}
-float *
-FFT::get_hann_window()
+float*
+FFT::get_hann_window ()
{
- if (_hann_window)
+ if (_hann_window) {
return _hann_window;
+ }
-
- _hann_window = (float *) malloc(sizeof(float) * _window_size);
+ _hann_window = (float*) malloc (sizeof (float) * _window_size);
double sum = 0.0;
- for (uint32_t i=0; i < _window_size; i++) {
- _hann_window[i]=0.81f * ( 0.5f - (0.5f * (float) cos(2.0f * M_PI * (float)i / (float)(_window_size))));
- sum += _hann_window[i];
- }
+ for (uint32_t i = 0; i < _window_size; ++i) {
+ _hann_window[i] = 0.81f * (0.5f - (0.5f * (float) cos (2.0f * M_PI * (float)i / (float)(_window_size))));
+ sum += _hann_window[i];
+ }
- double isum = 1.0 / sum;
+ double isum = 1.0 / sum;
- for (uint32_t i=0; i < _window_size; i++) {
- _hann_window[i] *= isum;
- }
+ for (uint32_t i = 0; i < _window_size; ++i) {
+ _hann_window[i] *= isum;
+ }
return _hann_window;
}
-
FFT::~FFT()
{
if (_hann_window) {