MostlyHarmless 0.0.1
 
Loading...
Searching...
No Matches
marvin_FFT.h
Go to the documentation of this file.
1// ========================================================================================================
2// _______ _______ ______ ___ ___ _______ _______
3// | | | _ | __ \ | |_ _| | |
4// | | | < | |_| |_| |
5// |__|_|__|___|___|___|__|\_____/|_______|__|____|
6//
7// This file is part of the Marvin open source library and is licensed under the terms of the MIT License.
8//
9// ========================================================================================================
10
11#ifndef MARVIN_FFT_H
12#define MARVIN_FFT_H
15#include <memory>
16#include <span>
17#include <complex>
18#include <numbers>
19#include <type_traits>
31
35 template <typename T>
36 struct getValueType {
37 using ValueType = T;
38 };
39
43 template <typename T>
44 requires ComplexFloatType<T>
45 struct getValueType<T> {
46 using ValueType = typename T::value_type;
47 };
48
62 template <RealOrComplexFloatType SampleType>
63 class FFT final {
64 public:
66
71 explicit FFT(size_t order);
72
76 ~FFT() noexcept;
77
82 [[nodiscard]] EngineType getEngineType() const noexcept;
83
88 [[nodiscard]] size_t getFFTSize() const noexcept;
89
95 void forward(std::span<SampleType> source, std::span<std::complex<ValueType>> dest);
101 std::span<std::complex<ValueType>> forward(std::span<SampleType> source);
108 void inverse(std::span<std::complex<ValueType>> source, std::span<SampleType> dest);
114 std::span<SampleType> inverse(std::span<std::complex<ValueType>> source);
115
116 private:
117 class Impl;
118 std::unique_ptr<Impl> m_impl;
119 };
120} // namespace marvin::dsp::spectral
121#endif
typename getValueType< SampleType >::ValueType ValueType
Definition marvin_FFT.h:65
void inverse(std::span< std::complex< ValueType > > source, std::span< SampleType > dest)
EngineType getEngineType() const noexcept
size_t getFFTSize() const noexcept
void forward(std::span< SampleType > source, std::span< std::complex< ValueType > > dest)
Definition marvin_Concepts.h:30
Definition marvin_FFT.h:20
EngineType
Enum for the available fft backends.
Definition marvin_FFT.h:26
@ Ipp_FFT
Definition marvin_FFT.h:28
@ Accelerate_FFT
Definition marvin_FFT.h:27
@ Fallback_FFT
Definition marvin_FFT.h:29
typename T::value_type ValueType
Definition marvin_FFT.h:46
Definition marvin_FFT.h:36
T ValueType
Definition marvin_FFT.h:37