diffsptk 2.0.0__tar.gz → 3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. {diffsptk-2.0.0 → diffsptk-3.0.0}/.gitignore +3 -4
  2. diffsptk-3.0.0/CITATION.cff +26 -0
  3. {diffsptk-2.0.0 → diffsptk-3.0.0}/LICENSE +1 -1
  4. {diffsptk-2.0.0 → diffsptk-3.0.0}/PKG-INFO +211 -42
  5. {diffsptk-2.0.0 → diffsptk-3.0.0}/README.md +193 -28
  6. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/__init__.py +4 -2
  7. diffsptk-3.0.0/diffsptk/functional.py +2743 -0
  8. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/__init__.py +46 -5
  9. diffsptk-3.0.0/diffsptk/modules/acorr.py +116 -0
  10. diffsptk-3.0.0/diffsptk/modules/acr2csm.py +142 -0
  11. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/alaw.py +39 -26
  12. diffsptk-3.0.0/diffsptk/modules/ap.py +630 -0
  13. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/b2mc.py +44 -24
  14. diffsptk-3.0.0/diffsptk/modules/base.py +57 -0
  15. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/c2acr.py +38 -19
  16. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/c2mpir.py +43 -22
  17. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/c2ndps.py +48 -29
  18. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/cdist.py +41 -27
  19. diffsptk-3.0.0/diffsptk/modules/chroma.py +134 -0
  20. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/cqt.py +44 -39
  21. diffsptk-3.0.0/diffsptk/modules/csm2acr.py +111 -0
  22. diffsptk-3.0.0/diffsptk/modules/dct.py +125 -0
  23. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/decimate.py +37 -25
  24. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/delay.py +49 -33
  25. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/delta.py +56 -40
  26. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/dequantize.py +43 -28
  27. diffsptk-3.0.0/diffsptk/modules/df2.py +137 -0
  28. diffsptk-3.0.0/diffsptk/modules/dfs.py +147 -0
  29. diffsptk-3.0.0/diffsptk/modules/dht.py +108 -0
  30. diffsptk-3.0.0/diffsptk/modules/drc.py +188 -0
  31. diffsptk-3.0.0/diffsptk/modules/dst.py +121 -0
  32. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/entropy.py +33 -21
  33. diffsptk-3.0.0/diffsptk/modules/excite.py +199 -0
  34. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/fbank.py +91 -70
  35. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/fftcep.py +53 -27
  36. diffsptk-3.0.0/diffsptk/modules/flux.py +120 -0
  37. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/frame.py +53 -25
  38. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/freqt.py +49 -35
  39. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/freqt2.py +51 -36
  40. diffsptk-3.0.0/diffsptk/modules/gammatone.py +230 -0
  41. diffsptk-3.0.0/diffsptk/modules/gmm.py +451 -0
  42. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/gnorm.py +46 -25
  43. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/grpdelay.py +41 -47
  44. diffsptk-3.0.0/diffsptk/modules/hilbert.py +110 -0
  45. diffsptk-3.0.0/diffsptk/modules/hilbert2.py +115 -0
  46. diffsptk-3.0.0/diffsptk/modules/histogram.py +129 -0
  47. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/ialaw.py +37 -26
  48. diffsptk-3.0.0/diffsptk/modules/ica.py +187 -0
  49. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/icqt.py +43 -38
  50. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/idct.py +37 -22
  51. diffsptk-3.0.0/diffsptk/modules/idht.py +96 -0
  52. diffsptk-3.0.0/diffsptk/modules/idst.py +96 -0
  53. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/ifreqt2.py +47 -37
  54. diffsptk-3.0.0/diffsptk/modules/igammatone.py +207 -0
  55. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/ignorm.py +40 -25
  56. diffsptk-3.0.0/diffsptk/modules/imdct.py +205 -0
  57. diffsptk-3.0.0/diffsptk/modules/imdst.py +92 -0
  58. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/imglsadf.py +10 -16
  59. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/imsvq.py +12 -6
  60. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/interpolate.py +39 -24
  61. diffsptk-3.0.0/diffsptk/modules/ipnorm.py +90 -0
  62. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/ipqmf.py +26 -19
  63. diffsptk-3.0.0/diffsptk/modules/is2par.py +89 -0
  64. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/istft.py +71 -39
  65. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/iulaw.py +34 -23
  66. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/ivq.py +12 -6
  67. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/lar2par.py +35 -15
  68. diffsptk-3.0.0/diffsptk/modules/lbg.py +343 -0
  69. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/levdur.py +45 -17
  70. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/linear_intpl.py +36 -19
  71. diffsptk-3.0.0/diffsptk/modules/lpc.py +116 -0
  72. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/lpc2lsp.py +78 -59
  73. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/lpc2par.py +42 -25
  74. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/lpccheck.py +38 -25
  75. diffsptk-3.0.0/diffsptk/modules/lsp2lpc.py +163 -0
  76. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/lsp2sp.py +91 -78
  77. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/lspcheck.py +49 -34
  78. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/magic_intpl.py +36 -25
  79. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/mc2b.py +45 -26
  80. diffsptk-3.0.0/diffsptk/modules/mcep.py +245 -0
  81. diffsptk-3.0.0/diffsptk/modules/mcpf.py +162 -0
  82. diffsptk-3.0.0/diffsptk/modules/mdct.py +214 -0
  83. diffsptk-3.0.0/diffsptk/modules/mdst.py +89 -0
  84. diffsptk-3.0.0/diffsptk/modules/mfcc.py +207 -0
  85. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/mgc2mgc.py +187 -185
  86. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/mgc2sp.py +80 -66
  87. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/mgcep.py +106 -86
  88. diffsptk-3.0.0/diffsptk/modules/mglsadf.py +540 -0
  89. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/mlpg.py +45 -33
  90. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/mlsacheck.py +93 -84
  91. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/mpir2c.py +47 -26
  92. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/msvq.py +24 -19
  93. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/ndps2c.py +51 -32
  94. diffsptk-3.0.0/diffsptk/modules/nmf.py +267 -0
  95. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/norm0.py +31 -12
  96. diffsptk-3.0.0/diffsptk/modules/par2is.py +92 -0
  97. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/par2lar.py +37 -15
  98. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/par2lpc.py +38 -26
  99. diffsptk-3.0.0/diffsptk/modules/pca.py +216 -0
  100. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/phase.py +32 -17
  101. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/pitch.py +150 -79
  102. diffsptk-3.0.0/diffsptk/modules/pitch_spec.py +532 -0
  103. diffsptk-3.0.0/diffsptk/modules/plp.py +279 -0
  104. diffsptk-3.0.0/diffsptk/modules/pnorm.py +121 -0
  105. diffsptk-3.0.0/diffsptk/modules/pol_root.py +115 -0
  106. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/poledf.py +44 -20
  107. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/pqmf.py +50 -36
  108. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/quantize.py +46 -28
  109. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/rlevdur.py +38 -26
  110. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/rmse.py +36 -23
  111. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/root_pol.py +58 -38
  112. diffsptk-3.0.0/diffsptk/modules/smcep.py +272 -0
  113. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/snr.py +39 -30
  114. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/spec.py +50 -47
  115. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/stft.py +84 -41
  116. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/ulaw.py +36 -23
  117. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/unframe.py +55 -47
  118. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/vq.py +21 -17
  119. diffsptk-3.0.0/diffsptk/modules/wht.py +126 -0
  120. diffsptk-3.0.0/diffsptk/modules/window.py +160 -0
  121. diffsptk-3.0.0/diffsptk/modules/yingram.py +196 -0
  122. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/zcross.py +41 -20
  123. {diffsptk-2.0.0 → diffsptk-3.0.0}/diffsptk/modules/zerodf.py +38 -20
  124. {diffsptk-2.0.0/diffsptk/misc → diffsptk-3.0.0/diffsptk}/signals.py +26 -23
  125. diffsptk-3.0.0/diffsptk/third_party/librosa/LICENSE +15 -0
  126. diffsptk-3.0.0/diffsptk/third_party/librosa/__init__.py +2 -0
  127. diffsptk-3.0.0/diffsptk/third_party/librosa/constantq.py +95 -0
  128. diffsptk-3.0.0/diffsptk/third_party/librosa/filters.py +299 -0
  129. diffsptk-3.0.0/diffsptk/third_party/librosa/util.py +172 -0
  130. diffsptk-3.0.0/diffsptk/third_party/world/LICENSE +39 -0
  131. diffsptk-3.0.0/diffsptk/third_party/world/__init__.py +1 -0
  132. diffsptk-3.0.0/diffsptk/third_party/world/common.py +150 -0
  133. diffsptk-3.0.0/diffsptk/utils/__init__.py +3 -0
  134. diffsptk-3.0.0/diffsptk/utils/private.py +293 -0
  135. diffsptk-3.0.0/diffsptk/utils/public.py +172 -0
  136. diffsptk-3.0.0/diffsptk/version.py +1 -0
  137. {diffsptk-2.0.0 → diffsptk-3.0.0}/pyproject.toml +34 -26
  138. diffsptk-2.0.0/.github/workflows/ci.yml +0 -57
  139. diffsptk-2.0.0/.github/workflows/stale.yml +0 -23
  140. diffsptk-2.0.0/Makefile +0 -122
  141. diffsptk-2.0.0/UPLOAD +0 -18
  142. diffsptk-2.0.0/codecov.yml +0 -11
  143. diffsptk-2.0.0/diffsptk/functional.py +0 -1897
  144. diffsptk-2.0.0/diffsptk/misc/__init__.py +0 -5
  145. diffsptk-2.0.0/diffsptk/misc/utils.py +0 -340
  146. diffsptk-2.0.0/diffsptk/modules/acorr.py +0 -110
  147. diffsptk-2.0.0/diffsptk/modules/ap.py +0 -338
  148. diffsptk-2.0.0/diffsptk/modules/dct.py +0 -86
  149. diffsptk-2.0.0/diffsptk/modules/df2.py +0 -103
  150. diffsptk-2.0.0/diffsptk/modules/dfs.py +0 -112
  151. diffsptk-2.0.0/diffsptk/modules/excite.py +0 -130
  152. diffsptk-2.0.0/diffsptk/modules/gmm.py +0 -340
  153. diffsptk-2.0.0/diffsptk/modules/lbg.py +0 -195
  154. diffsptk-2.0.0/diffsptk/modules/lpc.py +0 -74
  155. diffsptk-2.0.0/diffsptk/modules/lsp2lpc.py +0 -120
  156. diffsptk-2.0.0/diffsptk/modules/mcep.py +0 -138
  157. diffsptk-2.0.0/diffsptk/modules/mcpf.py +0 -103
  158. diffsptk-2.0.0/diffsptk/modules/mfcc.py +0 -139
  159. diffsptk-2.0.0/diffsptk/modules/mglsadf.py +0 -411
  160. diffsptk-2.0.0/diffsptk/modules/pca.py +0 -130
  161. diffsptk-2.0.0/diffsptk/modules/plp.py +0 -172
  162. diffsptk-2.0.0/diffsptk/modules/pol_root.py +0 -78
  163. diffsptk-2.0.0/diffsptk/modules/smcep.py +0 -176
  164. diffsptk-2.0.0/diffsptk/modules/window.py +0 -125
  165. diffsptk-2.0.0/diffsptk/modules/yingram.py +0 -174
  166. diffsptk-2.0.0/diffsptk/version.py +0 -1
@@ -1,17 +1,16 @@
1
1
  # project
2
+ .venv/
2
3
  dist/
3
- venv/
4
4
 
5
5
  # codecov
6
6
  .coverage
7
7
  coverage.xml
8
8
 
9
9
  # docs
10
- _build/
10
+ build/
11
11
 
12
12
  # tools
13
- tools/SPTK/
14
- tools/taplo/
13
+ tools/**/
15
14
 
16
15
  # misc
17
16
  __pycache__/
@@ -0,0 +1,26 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it as below."
3
+ authors:
4
+ - family-names: "SPTK Working Group"
5
+ title: "diffsptk"
6
+ url: "https://github.com/sp-nitech/diffsptk"
7
+ preferred-citation:
8
+ type: conference-paper
9
+ title: "SPTK4: An open-source software toolkit for speech signal processing"
10
+ authors:
11
+ - family-names: "Yoshimura"
12
+ given-names: "Takenori"
13
+ - family-names: "Fujimoto"
14
+ given-names: "Takato"
15
+ - family-names: "Oura"
16
+ given-names: "Keiichiro"
17
+ - family-names: "Tokuda"
18
+ given-names: "Keiichi"
19
+ collection-title: "12th ISCA Speech Synthesis Workshop"
20
+ collection-type: proceedings
21
+ doi: 10.21437/SSW.2023-33
22
+ month: 8
23
+ start: 211
24
+ end: 217
25
+ year: 2023
26
+ url: "https://www.isca-archive.org/ssw_2023/yoshimura23_ssw.pdf"
@@ -187,7 +187,7 @@
187
187
  same "printed page" as the copyright notice for easier
188
188
  identification within third-party archives.
189
189
 
190
- Copyright [yyyy] [name of copyright owner]
190
+ Copyright 2022 SPTK Working Group
191
191
 
192
192
  Licensed under the Apache License, Version 2.0 (the "License");
193
193
  you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: diffsptk
3
- Version: 2.0.0
3
+ Version: 3.0.0
4
4
  Summary: Speech signal processing modules for machine learning
5
5
  Project-URL: Homepage, https://sp-tk.sourceforge.net/
6
6
  Project-URL: Documentation, https://sp-nitech.github.io/diffsptk/latest/
@@ -13,24 +13,28 @@ Keywords: dsp,pytorch,signal processing,sptk
13
13
  Classifier: License :: OSI Approved :: Apache Software License
14
14
  Classifier: Programming Language :: Python
15
15
  Classifier: Programming Language :: Python :: 3 :: Only
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
18
16
  Classifier: Programming Language :: Python :: 3.10
19
17
  Classifier: Programming Language :: Python :: 3.11
20
- Requires-Python: >=3.8
21
- Requires-Dist: librosa>=0.10.1
22
- Requires-Dist: numpy
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: numpy>=1.23.0
22
+ Requires-Dist: penn>=0.0.1
23
+ Requires-Dist: pylstraight>=0.1.0
24
+ Requires-Dist: scipy>=1.12.0
23
25
  Requires-Dist: soundfile>=0.10.2
24
- Requires-Dist: torch>=1.11.0
25
- Requires-Dist: torchaudio>=0.11.0
26
- Requires-Dist: torchcrepe>=0.0.21
27
- Requires-Dist: torchlpc>=0.2.0
28
- Requires-Dist: vector-quantize-pytorch<=1.12.12,>=0.8.0
26
+ Requires-Dist: torch>=2.3.1
27
+ Requires-Dist: torchaudio>=2.3.1
28
+ Requires-Dist: torchcomp>=0.2.0
29
+ Requires-Dist: torchlpc>=0.6.0
30
+ Requires-Dist: tqdm>=4.63.0
31
+ Requires-Dist: vector-quantize-pytorch>=1.14.9
29
32
  Provides-Extra: dev
30
33
  Requires-Dist: build; extra == 'dev'
31
- Requires-Dist: grayskull; extra == 'dev'
32
- Requires-Dist: isort; extra == 'dev'
34
+ Requires-Dist: codespell; extra == 'dev'
35
+ Requires-Dist: mdformat; extra == 'dev'
33
36
  Requires-Dist: numpydoc; extra == 'dev'
37
+ Requires-Dist: pkginfo; extra == 'dev'
34
38
  Requires-Dist: pydata-sphinx-theme; extra == 'dev'
35
39
  Requires-Dist: pytest; extra == 'dev'
36
40
  Requires-Dist: pytest-cov; extra == 'dev'
@@ -39,49 +43,49 @@ Requires-Dist: sphinx; extra == 'dev'
39
43
  Requires-Dist: twine; extra == 'dev'
40
44
  Description-Content-Type: text/markdown
41
45
 
42
- diffsptk
43
- ========
46
+ # diffsptk
47
+
44
48
  *diffsptk* is a differentiable version of [SPTK](https://github.com/sp-nitech/SPTK) based on the PyTorch framework.
45
49
 
46
50
  [![Latest Manual](https://img.shields.io/badge/docs-latest-blue.svg)](https://sp-nitech.github.io/diffsptk/latest/)
47
- [![Stable Manual](https://img.shields.io/badge/docs-stable-blue.svg)](https://sp-nitech.github.io/diffsptk/2.0.0/)
51
+ [![Stable Manual](https://img.shields.io/badge/docs-stable-blue.svg)](https://sp-nitech.github.io/diffsptk/3.0.0/)
48
52
  [![Downloads](https://static.pepy.tech/badge/diffsptk)](https://pepy.tech/project/diffsptk)
49
53
  [![Python Version](https://img.shields.io/pypi/pyversions/diffsptk.svg)](https://pypi.python.org/pypi/diffsptk)
50
- [![PyTorch Version](https://img.shields.io/badge/pytorch-1.11.0%20%7C%202.2.1-orange.svg)](https://pypi.python.org/pypi/diffsptk)
54
+ [![PyTorch Version](https://img.shields.io/badge/pytorch-2.3.1%20%7C%202.6.0-orange.svg)](https://pypi.python.org/pypi/diffsptk)
51
55
  [![PyPI Version](https://img.shields.io/pypi/v/diffsptk.svg)](https://pypi.python.org/pypi/diffsptk)
52
56
  [![Codecov](https://codecov.io/gh/sp-nitech/diffsptk/branch/master/graph/badge.svg)](https://app.codecov.io/gh/sp-nitech/diffsptk)
53
57
  [![License](https://img.shields.io/github/license/sp-nitech/diffsptk.svg)](https://github.com/sp-nitech/diffsptk/blob/master/LICENSE)
54
58
  [![GitHub Actions](https://github.com/sp-nitech/diffsptk/workflows/package/badge.svg)](https://github.com/sp-nitech/diffsptk/actions)
55
59
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
56
60
 
61
+ ## Requirements
57
62
 
58
- Requirements
59
- ------------
60
- - Python 3.8+
61
- - PyTorch 1.11.0+
63
+ - Python 3.10+
64
+ - PyTorch 2.3.1+
62
65
 
66
+ ## Documentation
63
67
 
64
- Documentation
65
- -------------
66
- - See [this page](https://sp-nitech.github.io/diffsptk/latest/) for a reference manual.
68
+ - See [this page](https://sp-nitech.github.io/diffsptk/3.0.0/) for the reference manual.
67
69
  - Our [paper](https://www.isca-speech.org/archive/ssw_2023/yoshimura23_ssw.html) is available on the ISCA Archive.
68
70
 
71
+ ## Installation
69
72
 
70
- Installation
71
- ------------
72
73
  The latest stable release can be installed through PyPI by running
74
+
73
75
  ```sh
74
76
  pip install diffsptk
75
77
  ```
78
+
76
79
  The development release can be installed from the master branch:
80
+
77
81
  ```sh
78
82
  pip install git+https://github.com/sp-nitech/diffsptk.git@master
79
83
  ```
80
84
 
85
+ ## Examples
81
86
 
82
- Examples
83
- --------
84
87
  ### Mel-cepstral analysis and synthesis
88
+
85
89
  ```python
86
90
  import diffsptk
87
91
 
@@ -99,11 +103,16 @@ X = stft(x)
99
103
 
100
104
  # Estimate mel-cepstrum of x.
101
105
  alpha = diffsptk.get_alpha(sr)
102
- mcep = diffsptk.MelCepstralAnalysis(cep_order=M, fft_length=n_fft, alpha=alpha, n_iter=10)
106
+ mcep = diffsptk.MelCepstralAnalysis(
107
+ fft_length=n_fft,
108
+ cep_order=M,
109
+ alpha=alpha,
110
+ n_iter=10,
111
+ )
103
112
  mc = mcep(X)
104
113
 
105
114
  # Reconstruct x.
106
- mlsa = diffsptk.MLSA(filter_order=M, frame_period=fp, alpha=alpha, taylor_order=30)
115
+ mlsa = diffsptk.MLSA(filter_order=M, frame_period=fp, alpha=alpha, taylor_order=20)
107
116
  x_hat = mlsa(mlsa(x, -mc), mc)
108
117
 
109
118
  # Write reconstructed waveform.
@@ -114,7 +123,14 @@ error = (x_hat - x).abs().sum()
114
123
  print(error)
115
124
 
116
125
  # Extract pitch of x.
117
- pitch = diffsptk.Pitch(frame_period=fp, sample_rate=sr, f_min=80, f_max=180)
126
+ pitch = diffsptk.Pitch(
127
+ frame_period=fp,
128
+ sample_rate=sr,
129
+ f_min=80,
130
+ f_max=180,
131
+ voicing_threshold=0.4,
132
+ out_format="pitch",
133
+ )
118
134
  p = pitch(x)
119
135
 
120
136
  # Generate excitation signal.
@@ -131,7 +147,109 @@ diffsptk.write("voiced.wav", x_voiced, sr)
131
147
  diffsptk.write("unvoiced.wav", x_unvoiced, sr)
132
148
  ```
133
149
 
150
+ ### WORLD analysis and mel-cepstral synthesis
151
+
152
+ ```python
153
+ import diffsptk
154
+
155
+ fp = 80 # Frame period.
156
+ n_fft = 1024 # FFT length.
157
+ M = 24 # Mel-cepstrum dimensions.
158
+
159
+ # Read waveform.
160
+ x, sr = diffsptk.read("assets/data.wav")
161
+
162
+ # Extract F0 of x, or prepare well-estimated F0.
163
+ pitch = diffsptk.Pitch(
164
+ frame_period=fp,
165
+ sample_rate=sr,
166
+ f_min=80,
167
+ f_max=180,
168
+ voicing_threshold=0.4,
169
+ out_format="f0",
170
+ )
171
+ f0 = pitch(x)
172
+
173
+ # Extract aperiodicity of x by D4C.
174
+ ap = diffsptk.Aperiodicity(
175
+ frame_period=fp,
176
+ sample_rate=sr,
177
+ fft_length=n_fft,
178
+ algorithm="d4c",
179
+ out_format="a",
180
+ )
181
+ A = ap(x, f0)
182
+
183
+ # Extract spectral envelope of x by CheapTrick.
184
+ pitch_spec = diffsptk.PitchAdaptiveSpectralAnalysis(
185
+ frame_period=fp,
186
+ sample_rate=sr,
187
+ fft_length=n_fft,
188
+ algorithm="cheap-trick",
189
+ out_format="power",
190
+ )
191
+ H = pitch_spec(x, f0)
192
+
193
+ # Estimate mel-cepstrum of x.
194
+ alpha = diffsptk.get_alpha(sr)
195
+ mcep = diffsptk.MelCepstralAnalysis(fft_length=n_fft, cep_order=M, alpha=alpha)
196
+ mc_a = mcep(A)
197
+ mc_h = mcep(H)
198
+
199
+ # Generate excitation signals.
200
+ excite = diffsptk.ExcitationGeneration(frame_period=fp, unvoiced_region="zeros")
201
+ p = (sr / f0).nan_to_num(posinf=0)
202
+ pulse = excite(p)
203
+ noise = diffsptk.nrand(len(pulse) - 1)
204
+
205
+ # Make mixed excitation signal and reconstruct x.
206
+ mlsa = diffsptk.MLSA(filter_order=M, frame_period=fp, alpha=alpha, taylor_order=20)
207
+ e_p = pulse - mlsa(pulse, mc_a)
208
+ e_a = mlsa(noise, mc_a)
209
+ e = e_p + e_a
210
+ x_hat = mlsa(e, mc_h)
211
+
212
+ # Write reconstructed waveform.
213
+ diffsptk.write("reconst.wav", x_hat, sr)
214
+ ```
215
+
216
+ ### LPC analysis and synthesis
217
+
218
+ ```python
219
+ import diffsptk
220
+
221
+ fl = 400 # Frame length.
222
+ fp = 80 # Frame period.
223
+ M = 24 # LPC dimensions.
224
+
225
+ # Read waveform.
226
+ x, sr = diffsptk.read("assets/data.wav")
227
+
228
+ # Estimate LPC of x.
229
+ frame = diffsptk.Frame(frame_length=fl, frame_period=fp)
230
+ window = diffsptk.Window(in_length=fl)
231
+ lpc = diffsptk.LPC(frame_length=fl, lpc_order=M, eps=1e-6)
232
+ a = lpc(window(frame(x)))
233
+
234
+ # Convert to inverse filter coefficients.
235
+ norm0 = diffsptk.AllPoleToAllZeroDigitalFilterCoefficients(filter_order=M)
236
+ b = norm0(a)
237
+
238
+ # Reconstruct x.
239
+ zerodf = diffsptk.AllZeroDigitalFilter(filter_order=M, frame_period=fp)
240
+ poledf = diffsptk.AllPoleDigitalFilter(filter_order=M, frame_period=fp)
241
+ x_hat = poledf(zerodf(x, b), a)
242
+
243
+ # Write reconstructed waveform.
244
+ diffsptk.write("reconst.wav", x_hat, sr)
245
+
246
+ # Compute error.
247
+ error = (x_hat - x).abs().sum()
248
+ print(error)
249
+ ```
250
+
134
251
  ### Mel-spectrogram, MFCC, and PLP extraction
252
+
135
253
  ```python
136
254
  import diffsptk
137
255
 
@@ -148,10 +266,10 @@ x, sr = diffsptk.read("assets/data.wav")
148
266
  stft = diffsptk.STFT(frame_length=fl, frame_period=fp, fft_length=n_fft)
149
267
  X = stft(x)
150
268
 
151
- # Extract mel-spectrogram.
269
+ # Extract log mel-spectrogram.
152
270
  fbank = diffsptk.MelFilterBankAnalysis(
153
- n_channel=n_channel,
154
271
  fft_length=n_fft,
272
+ n_channel=n_channel,
155
273
  sample_rate=sr,
156
274
  )
157
275
  Y = fbank(X)
@@ -159,9 +277,9 @@ print(Y.shape)
159
277
 
160
278
  # Extract MFCC.
161
279
  mfcc = diffsptk.MFCC(
280
+ fft_length=n_fft,
162
281
  mfcc_order=M,
163
282
  n_channel=n_channel,
164
- fft_length=n_fft,
165
283
  sample_rate=sr,
166
284
  )
167
285
  Y = mfcc(X)
@@ -169,9 +287,9 @@ print(Y.shape)
169
287
 
170
288
  # Extract PLP.
171
289
  plp = diffsptk.PLP(
290
+ fft_length=n_fft,
172
291
  plp_order=M,
173
292
  n_channel=n_channel,
174
- fft_length=n_fft,
175
293
  sample_rate=sr,
176
294
  )
177
295
  Y = plp(X)
@@ -179,6 +297,7 @@ print(Y.shape)
179
297
  ```
180
298
 
181
299
  ### Subband decomposition
300
+
182
301
  ```python
183
302
  import diffsptk
184
303
 
@@ -191,12 +310,36 @@ x, sr = diffsptk.read("assets/data.wav")
191
310
  # Decompose x.
192
311
  pqmf = diffsptk.PQMF(K, M)
193
312
  decimate = diffsptk.Decimation(K)
194
- y = decimate(pqmf(x), dim=-1)
313
+ y = decimate(pqmf(x))
195
314
 
196
315
  # Reconstruct x.
197
316
  interpolate = diffsptk.Interpolation(K)
198
317
  ipqmf = diffsptk.IPQMF(K, M)
199
- x_hat = ipqmf(interpolate(K * y, dim=-1)).reshape(-1)
318
+ x_hat = ipqmf(interpolate(K * y)).reshape(-1)
319
+
320
+ # Write reconstructed waveform.
321
+ diffsptk.write("reconst.wav", x_hat, sr)
322
+
323
+ # Compute error.
324
+ error = (x_hat - x).abs().sum()
325
+ print(error)
326
+ ```
327
+
328
+ ### Gammatone filter bank analysis and synthesis
329
+
330
+ ```python
331
+ import diffsptk
332
+
333
+ # Read waveform.
334
+ x, sr = diffsptk.read("assets/data.wav")
335
+
336
+ # Decompose x.
337
+ gammatone = diffsptk.GammatoneFilterBankAnalysis(sr)
338
+ y = gammatone(x)
339
+
340
+ # Reconstruct x.
341
+ igammatone = diffsptk.GammatoneFilterBankSynthesis(sr)
342
+ x_hat = igammatone(y).reshape(-1)
200
343
 
201
344
  # Write reconstructed waveform.
202
345
  diffsptk.write("reconst.wav", x_hat, sr)
@@ -207,6 +350,7 @@ print(error)
207
350
  ```
208
351
 
209
352
  ### Constant-Q transform
353
+
210
354
  ```python
211
355
  import diffsptk
212
356
  import librosa # This is to get sample audio.
@@ -234,7 +378,34 @@ error = (x_hat - x).abs().sum()
234
378
  print(error)
235
379
  ```
236
380
 
381
+ ### Modified discrete cosine transform
382
+
383
+ ```python
384
+ import diffsptk
385
+
386
+ fl = 512 # Frame length.
387
+
388
+ # Read waveform.
389
+ x, sr = diffsptk.read("assets/data.wav")
390
+
391
+ # Transform x.
392
+ mdct = diffsptk.MDCT(fl)
393
+ c = mdct(x)
394
+
395
+ # Reconstruct x.
396
+ imdct = diffsptk.IMDCT(fl)
397
+ x_hat = imdct(c, out_length=x.size(0))
398
+
399
+ # Write reconstructed waveform.
400
+ diffsptk.write("reconst.wav", x_hat, sr)
401
+
402
+ # Compute error.
403
+ error = (x_hat - x).abs().sum()
404
+ print(error)
405
+ ```
406
+
237
407
  ### Vector quantization
408
+
238
409
  ```python
239
410
  import diffsptk
240
411
 
@@ -253,14 +424,12 @@ error = (x_hat - x).abs().sum()
253
424
  print(error)
254
425
  ```
255
426
 
427
+ ## License
256
428
 
257
- License
258
- -------
259
429
  This software is released under the Apache License 2.0.
260
430
 
431
+ ## Citation
261
432
 
262
- Reference
263
- ---------
264
433
  ```bibtex
265
434
  @InProceedings{sp-nitech2023sptk,
266
435
  author = {Takenori Yoshimura and Takato Fujimoto and Keiichiro Oura and Keiichi Tokuda},