File tree Expand file tree Collapse file tree 2 files changed +11
-18
lines changed
Expand file tree Collapse file tree 2 files changed +11
-18
lines changed Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.10)
2- project (dsplib LANGUAGES CXX VERSION 0.54.4 )
2+ project (dsplib LANGUAGES CXX VERSION 0.54.5 )
33
44set (CMAKE_CXX_STANDARD 17)
55set (CMAKE_CXX_STANDARD_REQUIRED ON )
Original file line number Diff line number Diff line change @@ -35,25 +35,19 @@ std::vector<cmplx_t> _gen_coeffs_table(int n) noexcept {
3535 DSPLIB_ASSUME (n % 4 == 0 );
3636 const int n4 = n / 4 ;
3737 const int n2 = n / 2 ;
38- const int n3 = 3 * n / 4 ;
39- std::vector<cmplx_t > res (n);
40- res[0 ] = {1 , 0 };
41- res[n4] = {0 , -1 };
42- res[n2] = {-1 , 0 };
43- res[n3] = {0 , 1 };
44- // use only first n/4 samples
38+ std::vector<cmplx_t > tb (n / 2 );
39+
40+ // calculate only first n/4 samples
41+ tb[0 ] = {1 , 0 };
42+ tb[n4] = {0 , -1 };
4543 for (int i = 1 ; i < n4; ++i) {
4644 const auto v = std::cos (2 * pi * i / n);
47- res[i].re = v;
48- res[n - i].re = v;
49- res[n2 + i].re = -v;
50- res[n2 - i].re = -v;
51- res[n4 + i].im = -v;
52- res[n4 - i].im = -v;
53- res[n3 + i].im = v;
54- res[n3 - i].im = v;
45+ tb[i].re = v;
46+ tb[n2 - i].re = -v;
47+ tb[n4 + i].im = -v;
48+ tb[n4 - i].im = -v;
5549 }
56- return res ;
50+ return tb ;
5751}
5852
5953// bit reverse array permutation
@@ -93,7 +87,6 @@ int Pow2FftPlan::size() const noexcept {
9387 return n_;
9488}
9589
96- // TODO: add "small" implementations (2, 4, 8)
9790void Pow2FftPlan::_fft (const cmplx_t * restrict in, cmplx_t * restrict out, int n) const noexcept {
9891 DSPLIB_ASSUME (n % 2 == 0 );
9992 DSPLIB_ASSUME (n >= 2 );
You can’t perform that action at this time.
0 commit comments