Skip to content

Commit

Permalink
Rename c2c fft functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Sep 15, 2023
1 parent d1c5dae commit a3ef056
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
# - id: no-commit-to-branch

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v15.0.7
rev: v16.0.6
hooks:
- id: clang-format
types_or: [c++, c]
Expand Down
8 changes: 4 additions & 4 deletions lib/gw/fft/radix2.hpp → lib/gw/fft/fft.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct twiddle_factor_lut
};

template<typename Float, etl::size_t Extent>
auto radix2_inplace(etl::span<etl::complex<Float>, Extent> x, etl::span<etl::complex<Float> const, Extent / 2> w)
auto c2c_dit2_kernel(etl::span<etl::complex<Float>, Extent> x, etl::span<etl::complex<Float> const, Extent / 2> w)
-> void
{
// bit-reverse ordering
Expand Down Expand Up @@ -89,7 +89,7 @@ auto radix2_inplace(etl::span<etl::complex<Float>, Extent> x, etl::span<etl::com
}

template<typename Float, etl::size_t Extent>
auto radix2_inplace_alt(etl::span<etl::complex<Float>, Extent> x, etl::span<etl::complex<Float> const, Extent / 2> w)
auto c2c_dit2_kernel_alt(etl::span<etl::complex<Float>, Extent> x, etl::span<etl::complex<Float> const, Extent / 2> w)
{
auto const len = x.size();

Expand Down Expand Up @@ -123,7 +123,7 @@ auto radix2_inplace_alt(etl::span<etl::complex<Float>, Extent> x, etl::span<etl:
}

template<typename Float, etl::size_t Size>
auto radix2_inplace(etl::span<etl::complex<Float>, Size> x, twiddle_factor_lut<Float, Size> const& w) -> void
auto c2c_dit2_kernel(etl::span<etl::complex<Float>, Size> x, twiddle_factor_lut<Float, Size> const& w) -> void
{
auto const len = x.size();
auto const order = static_cast<int>(std::lround(etl::log2(len)));
Expand Down Expand Up @@ -154,7 +154,7 @@ auto radix2_inplace(etl::span<etl::complex<Float>, Size> x, twiddle_factor_lut<F
}

template<etl::size_t Extent>
auto radix2_inplace(etl::span<complex_q15_t, Extent> x, etl::span<complex_q15_t const, Extent / 2> w) -> void
auto c2c_dit2_kernel(etl::span<complex_q15_t, Extent> x, etl::span<complex_q15_t const, Extent / 2> w) -> void
{
// auto const len = x.size();
// auto const order = static_cast<int>(std::lround(etl::log2(len)));
Expand Down
44 changes: 22 additions & 22 deletions src/astra/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <gw/audio/dither/rectangle_dither.hpp>
#include <gw/audio/dither/triangle_dither.hpp>
#include <gw/core/benchmark.hpp>
#include <gw/fft/radix2.hpp>
#include <gw/fft/fft.hpp>

#include <etl/algorithm.hpp>
#include <etl/array.hpp>
Expand Down Expand Up @@ -81,7 +81,7 @@ struct fft_benchmark
auto operator()() -> void
{
etl::generate(_buf.begin(), _buf.end(), [i = 0]() mutable { return static_cast<Float>(i++); });
gw::fft::radix2_inplace<Float, N>(_buf, _tw);
gw::fft::c2c_dit2_kernel<Float, N>(_buf, _tw);
gw::doNotOptimize(_buf.front());
gw::doNotOptimize(_buf.back());
}
Expand Down Expand Up @@ -114,7 +114,7 @@ struct fft_benchmark_q15
auto operator()() -> void
{
etl::generate(_buf.begin(), _buf.end(), [i = 0]() mutable { return static_cast<int16_t>(i++); });
gw::fft::radix2_inplace<N>(_buf, _tw);
gw::fft::c2c_dit2_kernel<N>(_buf, _tw);
gw::doNotOptimize(_buf.front());
gw::doNotOptimize(_buf.back());
}
Expand Down Expand Up @@ -267,25 +267,25 @@ auto main() -> int
astra::mcu.StartLog(true);
astra::mcu.PrintLine("Daisy Patch SM started. Test Beginning");

// etl::timeit<128>("radix2_inplace<float, 16> - ", fft_benchmark<float, 16>{});
// etl::timeit<128>("radix2_inplace<float, 32> - ", fft_benchmark<float, 32>{});
// etl::timeit<128>("radix2_inplace<float, 64> - ", fft_benchmark<float, 64>{});
// etl::timeit<128>("radix2_inplace<float, 128> - ", fft_benchmark<float, 128>{});
// etl::timeit<128>("radix2_inplace<float, 256> - ", fft_benchmark<float, 256>{});
// etl::timeit<128>("radix2_inplace<float, 512> - ", fft_benchmark<float, 512>{});
// etl::timeit<128>("radix2_inplace<float, 1024> - ", fft_benchmark<float, 1024>{});
// etl::timeit<128>("radix2_inplace<float, 2048> - ", fft_benchmark<float, 2048>{});
// etl::timeit<128>("radix2_inplace<float, 4096> - ", fft_benchmark<float, 4096>{});

// etl::timeit<128>("radix2_inplace<q15_t, 16> - ", fft_benchmark_q15<16>{});
// etl::timeit<128>("radix2_inplace<q15_t, 32> - ", fft_benchmark_q15<32>{});
// etl::timeit<128>("radix2_inplace<q15_t, 64> - ", fft_benchmark_q15<64>{});
// etl::timeit<128>("radix2_inplace<q15_t, 128> - ", fft_benchmark_q15<128>{});
// etl::timeit<128>("radix2_inplace<q15_t, 256> - ", fft_benchmark_q15<256>{});
// etl::timeit<128>("radix2_inplace<q15_t, 512> - ", fft_benchmark_q15<512>{});
// etl::timeit<128>("radix2_inplace<q15_t, 1024> - ", fft_benchmark_q15<1024>{});
// etl::timeit<128>("radix2_inplace<q15_t, 2048> - ", fft_benchmark_q15<2048>{});
// etl::timeit<128>("radix2_inplace<q15_t, 4096> - ", fft_benchmark_q15<4096>{});
// etl::timeit<128>("c2c_dit2_kernel<float, 16> - ", fft_benchmark<float, 16>{});
// etl::timeit<128>("c2c_dit2_kernel<float, 32> - ", fft_benchmark<float, 32>{});
// etl::timeit<128>("c2c_dit2_kernel<float, 64> - ", fft_benchmark<float, 64>{});
// etl::timeit<128>("c2c_dit2_kernel<float, 128> - ", fft_benchmark<float, 128>{});
// etl::timeit<128>("c2c_dit2_kernel<float, 256> - ", fft_benchmark<float, 256>{});
// etl::timeit<128>("c2c_dit2_kernel<float, 512> - ", fft_benchmark<float, 512>{});
// etl::timeit<128>("c2c_dit2_kernel<float, 1024> - ", fft_benchmark<float, 1024>{});
// etl::timeit<128>("c2c_dit2_kernel<float, 2048> - ", fft_benchmark<float, 2048>{});
// etl::timeit<128>("c2c_dit2_kernel<float, 4096> - ", fft_benchmark<float, 4096>{});

// etl::timeit<128>("c2c_dit2_kernel<q15_t, 16> - ", fft_benchmark_q15<16>{});
// etl::timeit<128>("c2c_dit2_kernel<q15_t, 32> - ", fft_benchmark_q15<32>{});
// etl::timeit<128>("c2c_dit2_kernel<q15_t, 64> - ", fft_benchmark_q15<64>{});
// etl::timeit<128>("c2c_dit2_kernel<q15_t, 128> - ", fft_benchmark_q15<128>{});
// etl::timeit<128>("c2c_dit2_kernel<q15_t, 256> - ", fft_benchmark_q15<256>{});
// etl::timeit<128>("c2c_dit2_kernel<q15_t, 512> - ", fft_benchmark_q15<512>{});
// etl::timeit<128>("c2c_dit2_kernel<q15_t, 1024> - ", fft_benchmark_q15<1024>{});
// etl::timeit<128>("c2c_dit2_kernel<q15_t, 2048> - ", fft_benchmark_q15<2048>{});
// etl::timeit<128>("c2c_dit2_kernel<q15_t, 4096> - ", fft_benchmark_q15<4096>{});

// etl::timeit<256>("cmul<64> - ", cmul<64>{});
// etl::timeit<256>("cmul<128> - ", cmul<128>{});
Expand Down

0 comments on commit a3ef056

Please sign in to comment.