• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ----------------------------------------------------------------------
2  * Project:      CMSIS DSP Library
3  * Title:        arm_hft90d_f64.c
4  * Description:  Floating-point (f64) Hft90d 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 /**
34   @ingroup groupWindow
35  */
36 
37 
38 
39 /**
40   @defgroup WindowFlat Flat-top window functions
41 
42   Use those windows when you need to estimate the
43   amplitude of a tone.
44 
45   If just just need to detect a tone or estimate the
46   noise, you can use the regular windows.
47 
48  */
49 
50 
51 /**
52   @addtogroup WindowFlat
53   @{
54  */
55 
56 
57 /**
58   @ingroup WindowHFT90D
59  */
60 
61 /**
62   @brief         Hft90d window generating function (f64).
63   @param[out]    pDst       points to the output generated window
64   @param[in]     blockSize  number of samples in the window
65   @return        none
66 
67   @par Parameters of the window
68 
69   | Parameter                             | Value              |
70   | ------------------------------------: | -----------------: |
71   | Peak sidelobe level                   |           90.2 dB  |
72   | Normalized equivalent noise bandwidth |       3.8832 bins  |
73   | 3 dB bandwidth                        |       3.8320 bins  |
74   | Flatness                              |        -0.0039 dB  |
75   | Recommended overlap                   |            76.0 %  |
76 
77 Included in CMSIS-DSP with authorization from professor
78 Gerhard Heinzel.
79 
80 @par Original article:
81 Spectrum and spectral density estimation by the Discrete Fourier
82 transform (DFT), including a comprehensive list of window
83 functions and some new
84 flat-top windows.
85 
86 @par Authors:
87 G. Heinzel, A. Rudiger and R. Schilling,
88 Max-Planck-Institut fur Gravitationsphysik
89 (Albert-Einstein-Institut)
90 Teilinstitut Hannover
91  */
92 
93 
94 
arm_hft90d_f64(float64_t * pDst,uint32_t blockSize)95 void arm_hft90d_f64(
96         float64_t * pDst,
97         uint32_t blockSize)
98 {
99    float64_t k = 2. / ((float64_t) blockSize);
100    float64_t w;
101 
102    for(uint32_t i=0;i<blockSize;i++)
103    {
104      w = PI_F64 * (i * k);
105      w =
106     1.0 -
107      1.942604 * cos (w) +
108      1.340318 * cos (2 * w) -
109      0.440811 * cos (3 * w) + 0.043097 * cos (4 * w);
110 
111      pDst[i] = w;
112    }
113 }
114 
115 /**
116   @} end of WindowFlat group
117  */
118 
119