1 /* ----------------------------------------------------------------------
2  * Project:      CMSIS DSP Library
3  * Title:        arm_hft144d_f32.c
4  * Description:  Floating-point (f32) Hft144d 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   @defgroup WindowHFT144D Hft144d window function (144.1 dB)
46 
47  */
48 
49 /**
50   @ingroup WindowHFT144D
51  */
52 
53 /**
54   @brief         Hft144d window generating function (f32).
55   @param[out]    pDst       points to the output generated window
56   @param[in]     blockSize  number of samples in the window
57 
58   @par Parameters of the window
59 
60   | Parameter                             | Value              |
61   | ------------------------------------: | -----------------: |
62   | Peak sidelobe level                   |          144.1 dB  |
63   | Normalized equivalent noise bandwidth |       4.5386 bins  |
64   | 3 dB bandwidth                        |       4.4697 bins  |
65   | Flatness                              |         0.0021 dB  |
66   | Recommended overlap                   |            79.9 %  |
67 
68 Included in CMSIS-DSP with authorization from professor
69 Gerhard Heinzel.
70 
71 @par Original article:
72 Spectrum and spectral density estimation by the Discrete Fourier
73 transform (DFT), including a comprehensive list of window
74 functions and some new
75 flat-top windows.
76 
77 @par Authors:
78 G. Heinzel, A. Rudiger and R. Schilling,
79 Max-Planck-Institut fur Gravitationsphysik
80 (Albert-Einstein-Institut)
81 Teilinstitut Hannover
82  */
83 
84 
85 
arm_hft144d_f32(float32_t * pDst,uint32_t blockSize)86 ARM_DSP_ATTRIBUTE void arm_hft144d_f32(
87         float32_t * pDst,
88         uint32_t blockSize)
89 {
90    float32_t k = 2.0f / ((float32_t) blockSize);
91    float32_t w;
92 
93    for(uint32_t i=0;i<blockSize;i++)
94    {
95      w = PI * (i * k);
96         w =
97     (1.0f -
98      1.96760033f * cosf (w) +
99      1.57983607f * cosf (2.f * w) -
100      0.81123644f * cosf (3.f * w) +
101      0.22583558f * cosf (4.f * w) -
102      0.02773848f * cosf (5.f * w) + 0.00090360f * cosf (6.f * w));
103 
104      pDst[i] = w;
105    }
106 }
107 
108 /**
109   @} end of WindowFlat group
110  */
111 
112