summaryrefslogtreecommitdiff
path: root/gtk2_ardour/fft.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-10-14 16:10:01 +0000
committerDavid Robillard <d@drobilla.net>2009-10-14 16:10:01 +0000
commitbb9cc45cd22af67ac275a5e73accbe14fee664d8 (patch)
treee52977d3eae6ff07b856088041a080a2fa3e5b79 /gtk2_ardour/fft.cc
parent8c4ce1e2ce35571aed5a686671431fdfffae7f8c (diff)
Strip trailing whitespace and fix other whitespace errors (e.g. space/tab mixing). Whitespace changes only.
Vimmers, try let c_space_errors = 1 in your .vimrc to highlight this kind of stuff in red. I don't know the emacs equivalent... git-svn-id: svn://localhost/ardour2/branches/3.0@5773 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/fft.cc')
-rw-r--r--gtk2_ardour/fft.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk2_ardour/fft.cc b/gtk2_ardour/fft.cc
index f78a1e94ad..d4841dd573 100644
--- a/gtk2_ardour/fft.cc
+++ b/gtk2_ardour/fft.cc
@@ -46,7 +46,7 @@ FFT::reset()
{
memset(_power_at_bin, 0, sizeof(float) * _data_size);
memset(_phase_at_bin, 0, sizeof(float) * _data_size);
-
+
_iterations = 0;
}
@@ -74,11 +74,11 @@ 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);
-
+
if (Re < 0.0 && Im > 0.0) {
phase += M_PI;
} else if (Re < 0.0 && Im < 0.0) {
@@ -96,7 +96,7 @@ void
FFT::calculate()
{
if (_iterations > 1) {
- for (uint32_t i=0; i < _data_size - 1; i++) {
+ for (uint32_t i=0; i < _data_size - 1; i++) {
_power_at_bin[i] /= (float)_iterations;
_phase_at_bin[i] /= (float)_iterations;
}
@@ -114,14 +114,14 @@ FFT::get_hann_window()
_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];
}
double isum = 1.0 / sum;
-
+
for (uint32_t i=0; i < _window_size; i++) {
_hann_window[i] *= isum;
}