jamie@141
|
1 /*
|
jamie@141
|
2 * Copyright (C) 2012 Jamie Bullock
|
jamie@107
|
3 *
|
jamie@141
|
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
|
jamie@141
|
5 * of this software and associated documentation files (the "Software"), to
|
jamie@141
|
6 * deal in the Software without restriction, including without limitation the
|
jamie@141
|
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
jamie@141
|
8 * sell copies of the Software, and to permit persons to whom the Software is
|
jamie@141
|
9 * furnished to do so, subject to the following conditions:
|
jamie@107
|
10 *
|
jamie@141
|
11 * The above copyright notice and this permission notice shall be included in
|
jamie@141
|
12 * all copies or substantial portions of the Software.
|
jamie@107
|
13 *
|
jamie@141
|
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
jamie@141
|
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
jamie@141
|
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
jamie@141
|
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
jamie@141
|
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
jamie@141
|
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
jamie@141
|
20 * IN THE SOFTWARE.
|
jamie@141
|
21 *
|
jamie@107
|
22 */
|
jamie@107
|
23
|
jamie@107
|
24 /* xtract_window_private.h: declares window generation functions */
|
jamie@107
|
25
|
jamie@107
|
26 #define PI 3.1415926535897931
|
jamie@107
|
27
|
jamie@107
|
28 /** \brief generate a Gaussian window
|
jamie@107
|
29 *
|
jamie@107
|
30 * \param *window a pointer to an array to contain the window data
|
jamie@107
|
31 * \param N the number of elements in the array pointed to by *window
|
jamie@107
|
32 * \param sd the standard deviation of the "distribution" represented by the Gaussian curve. The higher the value of sd, the wider the curve. Generally sd <= 0.5
|
jamie@107
|
33 *
|
jamie@107
|
34 */
|
jamie@146
|
35 void gauss(double *window, const int N, const double sd);
|
jamie@107
|
36
|
jamie@107
|
37 /** \brief generate a Hamming window
|
jamie@107
|
38 *
|
jamie@107
|
39 * \param *window a pointer to an array to contain the window data
|
jamie@107
|
40 * \param N the number of elements in the array pointed to by *window
|
jamie@107
|
41 *
|
jamie@107
|
42 */
|
jamie@146
|
43 void hamming(double *window, const int N);
|
jamie@107
|
44
|
jamie@107
|
45 /** \brief generate a Hann window
|
jamie@107
|
46 *
|
jamie@107
|
47 * \param *window a pointer to an array to contain the window data
|
jamie@107
|
48 * \param N the number of elements in the array pointed to by *window
|
jamie@107
|
49 *
|
jamie@107
|
50 */
|
jamie@146
|
51 void hann(double *window, const int N);
|
jamie@107
|
52
|
jamie@107
|
53 /** \brief generate a Bartlett window
|
jamie@107
|
54 *
|
jamie@107
|
55 * \param *window a pointer to an array to contain the window data
|
jamie@107
|
56 * \param N the number of elements in the array pointed to by *window
|
jamie@107
|
57 *
|
jamie@107
|
58 */
|
jamie@146
|
59 void bartlett(double *window, const int N);
|
jamie@107
|
60
|
jamie@107
|
61 /** \brief generate a Triangular window
|
jamie@107
|
62 *
|
jamie@107
|
63 * \param *window a pointer to an array to contain the window data
|
jamie@107
|
64 * \param N the number of elements in the array pointed to by *window
|
jamie@107
|
65 *
|
jamie@107
|
66 */
|
jamie@146
|
67 void triangular(double *window, const int N);
|
jamie@107
|
68
|
jamie@107
|
69 /** \brief generate a Bartlett-Hann window
|
jamie@107
|
70 *
|
jamie@107
|
71 * \param *window a pointer to an array to contain the window data
|
jamie@107
|
72 * \param N the number of elements in the array pointed to by *window
|
jamie@107
|
73 *
|
jamie@107
|
74 */
|
jamie@146
|
75 void bartlett_hann(double *window, const int N);
|
jamie@107
|
76
|
jamie@107
|
77 /** \brief generate a Blackman window
|
jamie@107
|
78 *
|
jamie@107
|
79 * \param *window a pointer to an array to contain the window data
|
jamie@107
|
80 * \param N the number of elements in the array pointed to by *window
|
jamie@107
|
81 *
|
jamie@107
|
82 */
|
jamie@146
|
83 void blackman(double *window, const int N);
|
jamie@107
|
84
|
jamie@107
|
85 /** \brief generate a Kaiser window
|
jamie@107
|
86 *
|
jamie@107
|
87 * \param *window a pointer to an array to contain the window data
|
jamie@107
|
88 * \param N the number of elements in the array pointed to by *window
|
jamie@107
|
89 * \param alpha The larger the value of |alpha|, the narrower the window becomes
|
jamie@107
|
90 *
|
jamie@107
|
91 */
|
jamie@146
|
92 void kaiser(double *window, const int N, const double alpha);
|
jamie@107
|
93
|
jamie@107
|
94 /** \brief generate a Blackman-Harris window
|
jamie@107
|
95 *
|
jamie@107
|
96 * \param *window a pointer to an array to contain the window data
|
jamie@107
|
97 * \param N the number of elements in the array pointed to by *window
|
jamie@107
|
98 *
|
jamie@107
|
99 */
|
jamie@146
|
100 void blackman_harris(double *window, const int N);
|
jamie@107
|
101
|