diff --git a/zones_convolver/util/FFTDecomposition.cpp b/zones_convolver/util/FFTDecomposition.cpp new file mode 100644 index 0000000..cd23dcf --- /dev/null +++ b/zones_convolver/util/FFTDecomposition.cpp @@ -0,0 +1,5 @@ +// +// Created by Leon Paterson-Stephens on 17/01/2024. +// + +#include "FFTDecomposition.h" diff --git a/zones_convolver/util/FFTDecomposition.h b/zones_convolver/util/FFTDecomposition.h new file mode 100644 index 0000000..cb5fbf4 --- /dev/null +++ b/zones_convolver/util/FFTDecomposition.h @@ -0,0 +1,25 @@ +#include + +namespace FFTDecomposition +{ +inline void ForwardDecompositionRadix2 (std::complex * data, + std::size_t num_points, + std::size_t num_steps, + std::size_t current_step) +{ + jassert (num_points > 0 && juce::isPowerOfTwo (num_points)); + jassert (num_steps > 0 && num_steps <= num_points && juce::isPowerOfTwo (num_steps)); + jassert (current_step < num_steps); + + auto half_num_points = num_points / 2; + for (auto point_index = 0u; point_index < half_num_points - 1u; ++point_index) + { + auto a_n = data [point_index] + data [half_num_points]; + auto b_n = data [point_index] - data [half_num_points]; + } +} + +inline void InverseDecompositionRadix2 () +{ +} +} \ No newline at end of file diff --git a/zones_convolver/zones_convolver.cpp b/zones_convolver/zones_convolver.cpp index 781b591..e1001a5 100644 --- a/zones_convolver/zones_convolver.cpp +++ b/zones_convolver/zones_convolver.cpp @@ -2,5 +2,6 @@ #include "util/CircularBuffer.cpp" #include "util/ComplexBuffer.cpp" +#include "util/FFTDecomposition.cpp" #include "util/FrequencyDelayLine.cpp" #include "util/SplitBlock.cpp" \ No newline at end of file diff --git a/zones_convolver/zones_convolver.h b/zones_convolver/zones_convolver.h index 4ee5130..39354e5 100644 --- a/zones_convolver/zones_convolver.h +++ b/zones_convolver/zones_convolver.h @@ -16,5 +16,6 @@ END_JUCE_MODULE_DECLARATION #include "util/CircularBuffer.h" #include "util/ComplexBuffer.h" +#include "util/FFTDecomposition.h" #include "util/FrequencyDelayLine.h" #include "util/SplitBlock.h" \ No newline at end of file