| NFFT 3.5.0

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

window.c
1 /*
2 * Copyright (c) 2002, 2017 Jens Keiner, Stefan Kunis, Daniel Potts
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License as published by the Free Software
6 * Foundation; either version 2 of the License, or (at your option) any later
7 * version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12 * details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 51
16 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19 #include "api.h"
20
21 #if defined(DIRAC_DELTA)
22 static const INT m2K_[] = {0};
23 #elif defined(GAUSSIAN)
24 static const INT m2K_[] = {0, 1, 3, 6, 7, 9, 11, 13, 15, 17, 19, 21, 22, 23, 24};
25 #elif defined(B_SPLINE)
26 static const INT m2K_[] = {0, 0, 4, 7, 10, 13, 15, 17, 19, 22, 24};
27 #elif defined(SINC_POWER)
28 static const INT m2K_[] = {0, 0, 2, 5, 8, 11, 12, 14, 16, 18, 21, 23, 24, 24};
29 #else /* Kaiser-Bessel is the default. */
30 static const INT m2K_[] = {1, 3, 7, 9, 14, 17, 20, 23, 24};
31 #endif
32
37 INT Y(m2K)(const INT m)
38 {
39 int j = MIN(((int)(m)), ((int)((sizeof(m2K_) / sizeof(m2K_[0])) - 1)));
40 return (INT)((1U << m2K_[j]) * (m + 2));
41 }
42
46 NFFT_INT Y(get_default_window_cut_off)()
47 {
48 return (NFFT_INT)(WINDOW_HELP_ESTIMATE_m);
49 }
50
51 const char *Y(get_window_name)()
52 {
53 return STRINGIZE(WINDOW_NAME);
54 }