Audaspace
1.9.0
A high level audio library.
Toggle main menu visibility
Loading...
Searching...
No Matches
util
FFTPlan.h
Go to the documentation of this file.
1
/*******************************************************************************
2
* Copyright 2015-2016 Juan Francisco Crespo Galán
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
******************************************************************************/
16
17
#pragma once
18
24
25
#include <complex>
26
#include <fftw3.h>
27
#include "
Audaspace.h
"
28
29
#include <memory>
30
#include <vector>
31
33
#define DEFAULT_N 4096
34
35
AUD_NAMESPACE_BEGIN
36
40
class
AUD_API
FFTPlan
41
{
42
private
:
46
int
m_N;
47
51
fftwf_plan m_fftPlanR2C;
52
56
fftwf_plan m_fftPlanC2R;
57
61
unsigned
int
m_bufferSize;
62
63
// delete copy constructor and operator=
64
FFTPlan(
const
FFTPlan&) =
delete
;
65
FFTPlan& operator=(
const
FFTPlan&) =
delete
;
66
67
public
:
73
FFTPlan
(
double
measureTime = 0);
74
85
FFTPlan
(
int
n,
double
measureTime = 0);
86
~FFTPlan();
87
92
int
getSize
();
93
98
void
FFT
(
void
* buffer);
99
104
void
IFFT
(
void
* buffer);
105
111
void
*
getBuffer
();
112
117
void
freeBuffer
(
void
* buffer);
118
};
119
120
AUD_NAMESPACE_END
Audaspace.h
The main header file of the library defining the namespace and basic data types.
AUD_NAMESPACE_END
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition
Audaspace.h:119
AUD_NAMESPACE_BEGIN
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition
Audaspace.h:116
AUD_API
#define AUD_API
Used for exporting symbols in the shared library.
Definition
Audaspace.h:93
FFTPlan::getSize
int getSize()
Retrieves the size of the FFT plan.
FFTPlan::FFT
void FFT(void *buffer)
Calculates the FFT of an input buffer with the current plan.
FFTPlan::FFTPlan
FFTPlan(int n, double measureTime=0)
Creates a new FFTPlan object with a custom size.
FFTPlan::freeBuffer
void freeBuffer(void *buffer)
Frees one of the buffers reserved with the getRealOnlyBuffer(), getComplexOnlyBuffer() or getInplaceB...
FFTPlan::getBuffer
void * getBuffer()
Reserves memory for a buffer that can be used for inplace transformations with this plan.
FFTPlan::IFFT
void IFFT(void *buffer)
Calculates the IFFT of an input buffer with the current plan.
FFTPlan::FFTPlan
FFTPlan(double measureTime=0)
Creates a new FFTPlan object with DEFAULT_N size (4096).
Generated by
1.17.0