DCT.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  QM DSP Library
5 
6  Centre for Digital Music, Queen Mary, University of London.
7  This file by Chris Cannam.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef QM_DSP_DCT_H
17 #define QM_DSP_DCT_H
18 
19 #include "FFT.h"
20 
21 #include <vector>
22 
23 class DCT
24 {
25 public:
31  DCT(int n);
32 
33  ~DCT();
34 
42  void forward(const double *in, double *out);
43 
54  void forwardUnitary(const double *in, double *out);
55 
63  void inverse(const double *in, double *out);
64 
73  void inverseUnitary(const double *in, double *out);
74 
75 private:
76  int m_n;
77  double m_scale;
78  std::vector<double> m_scaled;
79  std::vector<double> m_time2;
80  std::vector<double> m_freq2r;
81  std::vector<double> m_freq2i;
83 };
84 
85 #endif
std::vector< double > m_time2
Definition: DCT.h:79
std::vector< double > m_freq2i
Definition: DCT.h:81
Definition: DCT.h:23
std::vector< double > m_freq2r
Definition: DCT.h:80
void forward(const double *in, double *out)
Carry out a type-II DCT of size n, where n is the value provided to the constructor above...
Definition: DCT.cpp:36
void inverseUnitary(const double *in, double *out)
Carry out a type-III (inverse) unitary DCT of size n, where n is the value provided to the constructo...
Definition: DCT.cpp:83
DCT(int n)
Construct a DCT object to calculate the Discrete Cosine Transform given input of size n samples...
Definition: DCT.cpp:20
void forwardUnitary(const double *in, double *out)
Carry out a type-II unitary DCT of size n, where n is the value provided to the constructor above...
Definition: DCT.cpp:51
int m_n
Definition: DCT.h:76
double m_scale
Definition: DCT.h:77
std::vector< double > m_scaled
Definition: DCT.h:78
Definition: FFT.h:52
void inverse(const double *in, double *out)
Carry out a type-III (inverse) DCT of size n, where n is the value provided to the constructor above...
Definition: DCT.cpp:61
FFTReal m_fft
Definition: DCT.h:82
~DCT()
Definition: DCT.cpp:31