File: fftlibw3_op.cpp

package info (click to toggle)
libofa 0.9.3-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,932 kB
  • ctags: 460
  • sloc: cpp: 24,470; sh: 8,366; makefile: 45; ansic: 14
file content (60 lines) | stat: -rw-r--r-- 1,057 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* ------------------------------------------------------------------

   libofa -- the Open Fingerprint Architecture library

   Copyright (C) 2006 MusicIP Corporation
   All rights reserved.

-------------------------------------------------------------------*/
// FILE: "fftlibw3_op.cpp"
// MODULE: Wrapper for MIT FFTW ver 3.0 library calls
// AUTHOR: Frode Holm
// DATE CREATED: 1/12/06

#ifdef WIN32
#include "../config_win32.h"
#else
#include "../config.h"
#endif
#include "fftlib_op.h"


void 
FFTLib_op::Initialize(int N, bool optimize)
{
	if (optimize)
		Flags = FFTW_MEASURE;
	else
		Flags = FFTW_ESTIMATE;

}

void
FFTLib_op::Destroy()
{
    fftw_destroy_plan(PlanF);
}

void
FFTLib_op::SetSize(int N, bool optimize, double *in, double *out)
{
	if (optimize)
		Flags = FFTW_MEASURE;
	else
		Flags = FFTW_ESTIMATE;

	if (PlanF != 0)
	{
		fftw_destroy_plan(PlanF);
		PlanF = 0;
	}

	PlanF = fftw_plan_r2r_1d(N, in, out, FFTW_R2HC, Flags);
}

void 
FFTLib_op::ComputeFrame(int N, double *in, double *out)
{
	fftw_execute(PlanF);
}