| 1 | #cxx . . $ `<file>/LPC/LineSpectralFrequencies.h`/ifndef _LineSpectralFrequencies_h_ |
| 2 | #define _LineSpectralFrequencies_h_cxx . . $ `LPC/LineSpectralFrequencies.h:2:9`! |
| 3 | /* LineSpectralFrequencies.h |
| 4 | * |
| 5 | * Copyright (C) 2016-2020 David Weenink |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or (at |
| 10 | * your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | */ |
| 21 | |
| 22 | #include "LPC.h"cxx . . $ `<file>/LPC/LPC.h`/ |
| 23 | #include "Matrix.h"cxx . . $ `<file>/fon/Matrix.h`/ |
| 24 | #include "Graphics.h"cxx . . $ `<file>/sys/Graphics.h`/ |
| 25 | |
| 26 | #include "LineSpectralFrequencies_def.h"cxx . . $ `<file>/LPC/LineSpectralFrequencies_def.h`/ |
| 27 | |
| 28 | /* |
| 29 | From Sampled: |
| 30 | xmin, xmax : range of time (s) |
| 31 | x1 : position of first frame (s) |
| 32 | dx : step size (s) |
| 33 | nx : number of frames |
| 34 | */ |
| 35 | |
| 36 | void LineSpectralFrequencies_initcxx . . $ LineSpectralFrequencies_init(c644db288e7ccf7c). (LineSpectralFrequenciescxx . . $ LineSpectralFrequencies# me, double tmin, double tmax, integercxx . . $ integer# nt, double dt, double t1, integercxx . . $ integer# numberOfFrequencies, double maximumFrequency); |
| 37 | |
| 38 | autoLineSpectralFrequenciescxx . . $ autoLineSpectralFrequencies# LineSpectralFrequencies_createcxx . . $ LineSpectralFrequencies_create(e0310cab48391c2c). (double tmin, double tmax, integercxx . . $ integer# nt, double dt, double t1, integercxx . . $ integer# numberOfFrequencies, double maximumFrequency); |
| 39 | |
| 40 | void LineSpectralFrequencies_drawFrequenciescxx . . $ LineSpectralFrequencies_drawFrequencies(c884bf9331942823). (LineSpectralFrequenciescxx . . $ LineSpectralFrequencies# me, Graphicscxx . . $ Graphics# g, double fromTime, double toTime, double fmin, double fmax, bool garnish); |
| 41 | |
| 42 | autoMatrixcxx . . $ autoMatrix# LineSpectralFrequencies_downto_Matrixcxx . . $ LineSpectralFrequencies_downto_Matrix(26532d3b0576dd26). (LineSpectralFrequenciescxx . . $ LineSpectralFrequencies# me); |
| 43 | |
| 44 | /******************* Frames ************************************************/ |
| 45 | |
| 46 | void LineSpectralFrequencies_Frame_initcxx . . $ LineSpectralFrequencies_Frame_init(b16022a24ee3fbdc). (LineSpectralFrequencies_Framecxx . . $ LineSpectralFrequencies_Frame# me, integercxx . . $ integer# numberOfFrequencies); |
| 47 | |
| 48 | static inline autoVECcxx . . $ autoVEC# LineSpectralFrequencies_listFrequenciesInFramecxx . . $ LineSpectralFrequencies_listFrequenciesInFrame(a05a74793422c32a). (LineSpectralFrequenciescxx . . $ LineSpectralFrequencies# me, integercxx . . $ integer# frameNumber) { |
| 49 | mycxx . . $ `melder/melder.h:44:9`! checkIndexcxx . . $ structSampled#checkIndex(1624ee8275b10bda). (frameNumber); |
| 50 | autoVECcxx . . $ autoVEC# result = zero_VECcxx . . $ zero_VEC(e4395f764b859b1e). (mycxx . . $ `melder/melder.h:44:9`! maximumNumberOfFrequenciescxx . . $ structLineSpectralFrequencies#maximumNumberOfFrequencies.); |
| 51 | result.allcxx . . $ autovector#all(a26726dad87555bb).() <<=cxx . . $ `operator<<=`(adea042513329390). mycxx . . $ `melder/melder.h:44:9`! d_framescxx . . $ structLineSpectralFrequencies#d_frames. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).frameNumber]. frequenciescxx . . $ structLineSpectralFrequencies_Frame#frequencies..getcxx . . $ autovector#get(e8d1da7fe68a6585).(); |
| 52 | return resultcxx . . $ autovector#autovector(d33c649a3aceae2f).; |
| 53 | } |
| 54 | |
| 55 | static inline autoMATcxx . . $ autoMAT# LineSpectralFrequencies_listAllFrequenciescxx . . $ LineSpectralFrequencies_listAllFrequencies(6b5f13525b987d32). (LineSpectralFrequenciescxx . . $ LineSpectralFrequencies# me) { |
| 56 | autoMATcxx . . $ autoMAT# result = zero_MATcxx . . $ zero_MAT(3d09731056d2b97d). (mycxx . . $ `melder/melder.h:44:9`! maximumNumberOfFrequenciescxx . . $ structLineSpectralFrequencies#maximumNumberOfFrequencies., mycxx . . $ `melder/melder.h:44:9`! nxcxx . . $ structSampled#nx.); |
| 57 | for (integercxx . . $ integer# iframe = 1; iframe <= mycxx . . $ `melder/melder.h:44:9`! nxcxx . . $ structSampled#nx.; iframe ++) { |
| 58 | LineSpectralFrequencies_Framecxx . . $ LineSpectralFrequencies_Frame# lsf = & mycxx . . $ `melder/melder.h:44:9`! d_framescxx . . $ structLineSpectralFrequencies#d_frames. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).iframe]; |
| 59 | result.columncxx . . $ automatrix#column(a8b9553e85c2b1fc). (iframe).partcxx . . $ vectorview#part(fd45ed87dd839590). (1, lsf -> numberOfFrequenciescxx . . $ structLineSpectralFrequencies_Frame#numberOfFrequencies.) <<=cxx . . $ `operator<<=`(adea042513329390). lsfcxx . . $ constvectorview#constvectorview(eac9d6ec4c4bfecd). -> frequenciescxx . . $ structLineSpectralFrequencies_Frame#frequencies..getcxx . . $ autovector#get(e8d1da7fe68a6585).(); |
| 60 | } |
| 61 | return resultcxx . . $ automatrix#automatrix(a69681c49ef9c9eb).; |
| 62 | } |
| 63 | |
| 64 | |
| 65 | #endif /* _LineSpectralFrequencies_h_ */ |