Pd++  0.01
A pure C++ implementation of Pure Data objects
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
cIFFT.h
1 /*
2  cIFFT.h
3  Pd++
4 
5  Created by Robert Esler on 11/11/14.
6  Copyright (c) 2014 Robert Esler. All rights reserved.
7 
8  Some of the code in Pd++ is Copyright (c) 1997-1999 Miller Puckette.
9  For information on usage and redistribution, and for a DISCLAIMER OF ALL
10  WARRANTIES, see the file, "LICENSE.txt," in this distribution.
11 */
12 
13 #ifndef __Pd____cIFFT__
14 #define __Pd____cIFFT__
15 
16 #include <string>
17 #include "PdMaster.h"
18 #include "fft.h"
19 
20 namespace pd {
21 
22 /*! \brief Complex Inverse Fast Fourier Transform.
23 
24  This is an emulation of the ifft~ object. It takes a window of
25  samples and resynthesizes them back into the time domain.
26  This is different from several other Pd++ classes as it
27  accepts a complex*, which is a c-style reference to our input window.
28  Complex Inverse Fast Fourier Transform only provides the real and imaginary parts
29  of an FFT. See FFT or fft_mayer.c for more information on the algorithm.
30 
31 */
32 
33 class complexIFFT : public PdMaster, public FFT {
34 
35 private:
36  int windowSize = 64;
37  double *realIFFT = nullptr;
38  double *imagIFFT = nullptr;
39  double *output = new double[2]; // 0 real, 1 imaginary
40  bool first = true;
41  int count = 0;
42 
43 
44 public:
45  complexIFFT();
46  complexIFFT(int);
47  ~complexIFFT();
48 
49  /*! This function takes a block of complex samples, which are the real and imaginary parts.*/
50  double *perform(double *input);
51 
52  const std::string pdName = "ifft~";
53 };
54 
55 } // pd namespace
56 
57 #endif /* defined(__Pd____cIFFT__) */
The Pd++ namespace.
Definition: BandPass.cpp:14
Complex Inverse Fast Fourier Transform.
Definition: cIFFT.h:33
A super class inherited by all Pd++ objects.
Definition: PdMaster.h:62
An FFT superclass. Adapted from the Pd version of FFT.
Definition: fft.h:125
Real Inverse Fast Fourier Transform.
Definition: rIFFT.h:33
complexIFFT()
Definition: cIFFT.cpp:32
double * perform(double *input)
Definition: cIFFT.cpp:53