• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ----------------------------------------------------------------------
2  * Project:      CMSIS DSP Library
3  * Title:        arm_hft248d_f32.c
4  * Description:  Floating-point (f32) 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   @defgroup WindowHFT248D Hft248d window function (248.4 dB)
46 
47  */
48 
49 /**
50   @ingroup WindowHFT248D
51  */
52 
53 /**
54   @brief         Hft248d 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   @return        none
58 
59   @par Parameters of the window
60 
61   | Parameter                             | Value              |
62   | ------------------------------------: | -----------------: |
63   | Peak sidelobe level                   |          248.4 dB  |
64   | Normalized equivalent noise bandwidth |       5.6512 bins  |
65   | 3 dB bandwidth                        |       5.5567 bins  |
66   | Flatness                              |         0.0009 dB  |
67   | Recommended overlap                   |            84.1 %  |
68 
69 Included in CMSIS-DSP with authorization from professor
70 Gerhard Heinzel.
71 
72 @par Original article:
73 Spectrum and spectral density estimation by the Discrete Fourier
74 transform (DFT), including a comprehensive list of window
75 functions and some new
76 flat-top windows.
77 
78 @par Authors:
79 G. Heinzel, A. Rudiger and R. Schilling,
80 Max-Planck-Institut fur Gravitationsphysik
81 (Albert-Einstein-Institut)
82 Teilinstitut Hannover
83  */
84 
85 
86 
arm_hft248d_f32(float32_t * pDst,uint32_t blockSize)87 void arm_hft248d_f32(
88         float32_t * pDst,
89         uint32_t blockSize)
90 {
91    float32_t k = 2.0f / ((float32_t) blockSize);
92    float32_t w;
93 
94    for(uint32_t i=0;i<blockSize;i++)
95    {
96     w = PI * (i * k);
97         w =
98     (1.0f -
99      1.985844164102f * cosf (w) +
100      1.791176438506f * cosf (2.f * w) -
101      1.282075284005f * cosf (3.f * w) +
102      0.667777530266f * cosf (4.f * w) -
103      0.240160796576f * cosf (5.f * w) +
104      0.056656381764f * cosf (6.f * w) -
105      0.008134974479f * cosf (7.f * w) +
106      0.000624544650f * cosf (8.f * w) -
107      0.000019808998f * cosf (9.f * w) +
108      0.000000132974f * cosf (10.f * w));
109      pDst[i] = w;
110    }
111 }
112 
113 /**
114   @} end of WindowFlat group
115  */
116 
117