Krotos Modules 3
Loading...
Searching...
No Matches
AudioFFT.h
Go to the documentation of this file.
1// ==================================================================================
2// Copyright (c) 2017 HiFi-LoFi
3//
4// Permission is hereby granted, free of charge, to any person obtaining a copy
5// of this software and associated documentation files (the "Software"), to deal
6// in the Software without restriction, including without limitation the rights
7// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8// copies of the Software, and to permit persons to whom the Software is furnished
9// to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20// ==================================================================================
21
22#ifndef _AUDIOFFT_H
23#define _AUDIOFFT_H
24
88#include <cstddef>
89#include <memory>
90
91namespace audiofft
92{
93
94 namespace detail
95 {
96 class AudioFFTImpl;
97 }
98
99 // =============================================================
100
106 {
107 public:
111 AudioFFT();
112
113 AudioFFT(const AudioFFT&) = delete;
114 AudioFFT& operator=(const AudioFFT&) = delete;
115
119 ~AudioFFT();
120
125 void init(size_t size);
126
133 void fft(const float* data, float* re, float* im);
134
141 void ifft(float* data, const float* re, const float* im);
142
148 static size_t ComplexSize(size_t size);
149
150 private:
151 std::unique_ptr<detail::AudioFFTImpl> _impl;
152 };
153
160
161} // namespace audiofft
162
163#endif // Header guard
Performs 1D FFTs.
Definition AudioFFT.h:106
std::unique_ptr< detail::AudioFFTImpl > _impl
Definition AudioFFT.h:151
void init(size_t size)
Initializes the FFT object.
Definition AudioFFT.cpp:984
void fft(const float *data, float *re, float *im)
Performs the forward FFT.
Definition AudioFFT.cpp:990
AudioFFT & operator=(const AudioFFT &)=delete
AudioFFT(const AudioFFT &)=delete
void ifft(float *data, const float *re, const float *im)
Performs the inverse FFT.
Definition AudioFFT.cpp:992
~AudioFFT()
Destructor.
Definition AudioFFT.cpp:982
AudioFFT()
Constructor.
Definition AudioFFT.cpp:980
static size_t ComplexSize(size_t size)
Calculates the necessary size of the real/imaginary complex arrays.
Definition AudioFFT.cpp:994
Definition AudioFFT.cpp:44
AudioFFT AudioFFTBase
Let's keep an AudioFFTBase type around for now because it has been here already in the 1st version in...
Definition AudioFFT.h:159