• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ----------------------------------------------------------------------
2  * Project:      CMSIS DSP Library
3  * Title:        arm_hft248d_f64.c
4  * Description:  Floating-point (f64) Hft248d window
5  *
6  * $Date:        14 December 2022
7  * $Revision:    v1.15.0
8  *
9  * Target Processor: Cortex-M and Cortex-A cores
10  * -------------------------------------------------------------------- */
11 /*
12  * Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved.
13  *
14  * SPDX-License-Identifier: Apache-2.0
15  *
16  * Licensed under the Apache License, Version 2.0 (the License); you may
17  * not use this file except in compliance with the License.
18  * You may obtain a copy of the License at
19  *
20  * www.apache.org/licenses/LICENSE-2.0
21  *
22  * Unless required by applicable law or agreed to in writing, software
23  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
24  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25  * See the License for the specific language governing permissions and
26  * limitations under the License.
27  */
28 
29 #include "dsp/window_functions.h"
30 #include "dsp/fast_math_functions.h"
31 #include <math.h>
32 /**
33   @ingroup groupWindow
34  */
35 
36 
37 
38 
39 /**
40   @addtogroup WindowFlat
41   @{
42  */
43 
44 
45 /**
46   @ingroup WindowHFT248D
47  */
48 
49 /**
50   @brief         Hft248d window generating function (f64).
51   @param[out]    pDst       points to the output generated window
52   @param[in]     blockSize  number of samples in the window
53   @return        none
54 
55   @par Parameters of the window
56 
57   | Parameter                             | Value              |
58   | ------------------------------------: | -----------------: |
59   | Peak sidelobe level                   |          248.4 dB  |
60   | Normalized equivalent noise bandwidth |       5.6512 bins  |
61   | 3 dB bandwidth                        |       5.5567 bins  |
62   | Flatness                              |         0.0009 dB  |
63   | Recommended overlap                   |            84.1 %  |
64 
65 Included in CMSIS-DSP with authorization from professor
66 Gerhard Heinzel.
67 
68 @par Original article:
69 Spectrum and spectral density estimation by the Discrete Fourier
70 transform (DFT), including a comprehensive list of window
71 functions and some new
72 flat-top windows.
73 
74 @par Authors:
75 G. Heinzel, A. Rudiger and R. Schilling,
76 Max-Planck-Institut fur Gravitationsphysik
77 (Albert-Einstein-Institut)
78 Teilinstitut Hannover
79  */
80 
81 
82 
arm_hft248d_f64(float64_t * pDst,uint32_t blockSize)83 void arm_hft248d_f64(
84         float64_t * pDst,
85         uint32_t blockSize)
86 {
87    float64_t k = 2. / ((float64_t) blockSize);
88    float64_t w;
89 
90    for(uint32_t i=0;i<blockSize;i++)
91    {
92     w = PI_F64 * (i * k);
93         w =
94     (1.0 -
95      1.985844164102 * cos (w) +
96      1.791176438506 * cos (2. * w) -
97      1.282075284005 * cos (3. * w) +
98      0.667777530266 * cos (4. * w) -
99      0.240160796576 * cos (5. * w) +
100      0.056656381764 * cos (6. * w) -
101      0.008134974479 * cos (7. * w) +
102      0.000624544650 * cos (8. * w) -
103      0.000019808998 * cos (9. * w) +
104      0.000000132974 * cos (10. * w));
105      pDst[i] = w;
106    }
107 }
108 
109 /**
110   @} end of WindowFlat group
111  */
112 
113