Debian Codegraph @

melder/NUMfilter.cpp

raw symbols SCIP
1 /* NUMfilter.cpp
2 *
3 * Copyright (C) 1992-2008,2011,2012,2014-2020 Paul Boersma
4 *
5 * This code is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 *
10 * This code is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this work. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include "melder.h"cxx . . $ `<file>/melder/melder.h`/
20
21 void NUMfbtoacxx . . $ NUMfbtoa(14709244db55ea9c). (double formant, double bandwidth, double dt, double *a1, double *a2) {
22 *a1 = 2.0 * expcxx . . $ exp(fee4f1d22bc8e617). (- NUMpicxx . . $ NUMpi. * bandwidth * dt) * coscxx . . $ cos(fee4f1d22bc8e617). (2.0 * NUMpicxx . . $ NUMpi. * formant * dt);
23 *a2 = expcxx . . $ exp(fee4f1d22bc8e617). (- 2.0 * NUMpicxx . . $ NUMpi. * bandwidth * dt);
24 }
25
26 void VECfilterSecondOrderSection_a_inplacecxx . . $ VECfilterSecondOrderSection_a_inplace(963991e5268b1933). (VECVUcxx . . $ VECVU# const& x, double a1, double a2) {
27 x [cxx . . $ vectorview#`operator[]`(8a4599b8835d1ce1).2] += a1 * x [cxx . . $ vectorview#`operator[]`(8a4599b8835d1ce1).1];
28 for (integercxx . . $ integer# i = 3; i <= x.sizecxx . . $ vectorview#size.; i ++)
29 x [cxx . . $ vectorview#`operator[]`(8a4599b8835d1ce1).i] += a1 * x [cxx . . $ vectorview#`operator[]`(8a4599b8835d1ce1).i - 1] - a2 * x [cxx . . $ vectorview#`operator[]`(8a4599b8835d1ce1).i - 2];
30 }
31
32 void VECfilterSecondOrderSection_fb_inplacecxx . . $ VECfilterSecondOrderSection_fb_inplace(1af0a15671a05e99). (VECVUcxx . . $ VECVU# const& x, double dt, double formant, double bandwidth) {
33 double a1, a2;
34 NUMfbtoacxx . . $ NUMfbtoa(14709244db55ea9c). (formant, bandwidth, dt, & a1, & a2);
35 VECfilterSecondOrderSection_a_inplacecxx . . $ VECfilterSecondOrderSection_a_inplace(963991e5268b1933). (x, a1, a2);
36 }
37
38 double NUMftopreemphasiscxx . . $ NUMftopreemphasis(d8e7e0733fa41c87). (double f, double dt) {
39 return expcxx . . $ exp(fee4f1d22bc8e617). (- 2.0 * NUMpicxx . . $ NUMpi. * f * dt);
40 }
41
42 void VECpreemphasize_a_inplacecxx . . $ VECpreemphasize_a_inplace(cb3d2a9455fe8b3e). (VECVUcxx . . $ VECVU# const& x, double preemphasis) {
43 for (integercxx . . $ integer# i = x.sizecxx . . $ vectorview#size.; i >= 2; i --)
44 x [cxx . . $ vectorview#`operator[]`(8a4599b8835d1ce1).i] -= preemphasis * x [cxx . . $ vectorview#`operator[]`(8a4599b8835d1ce1).i - 1];
45 }
46
47 void VECdeemphasize_a_inplacecxx . . $ VECdeemphasize_a_inplace(cb3d2a9455fe8b3e). (VECVUcxx . . $ VECVU# const& x, double preemphasis) {
48 for (integercxx . . $ integer# i = 2; i <= x.sizecxx . . $ vectorview#size.; i ++)
49 x [cxx . . $ vectorview#`operator[]`(8a4599b8835d1ce1).i] += preemphasis * x [cxx . . $ vectorview#`operator[]`(8a4599b8835d1ce1).i - 1];
50 }
51
52 void VECpreemphasize_f_inplacecxx . . $ VECpreemphasize_f_inplace(963991e5268b1933). (VECVUcxx . . $ VECVU# const& x, double dt, double frequency) {
53 VECpreemphasize_a_inplacecxx . . $ VECpreemphasize_a_inplace(cb3d2a9455fe8b3e). (x, NUMftopreemphasiscxx . . $ NUMftopreemphasis(d8e7e0733fa41c87). (frequency, dt));
54 }
55
56 void VECdeemphasize_f_inplacecxx . . $ VECdeemphasize_f_inplace(963991e5268b1933). (VECVUcxx . . $ VECVU# const& x, double dt, double frequency) {
57 VECdeemphasize_a_inplacecxx . . $ VECdeemphasize_a_inplace(cb3d2a9455fe8b3e). (x, NUMftopreemphasiscxx . . $ NUMftopreemphasis(d8e7e0733fa41c87). (frequency, dt));
58 }
59
60 /* End of file NUMfilter.cpp */