diffsptk 2.3.0__tar.gz → 2.4.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 (125) hide show
  1. {diffsptk-2.3.0 → diffsptk-2.4.0}/PKG-INFO +6 -5
  2. {diffsptk-2.3.0 → diffsptk-2.4.0}/README.md +3 -3
  3. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/functional.py +42 -2
  4. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/misc/utils.py +6 -2
  5. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/__init__.py +4 -0
  6. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/c2mpir.py +1 -1
  7. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/cqt.py +2 -2
  8. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/fbank.py +1 -1
  9. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/freqt2.py +1 -1
  10. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/gmm.py +1 -1
  11. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/ica.py +1 -1
  12. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/icqt.py +2 -2
  13. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/ifreqt2.py +1 -1
  14. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/imglsadf.py +5 -2
  15. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/lbg.py +2 -2
  16. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/mglsadf.py +217 -74
  17. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/mlpg.py +3 -1
  18. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/nmf.py +1 -1
  19. diffsptk-2.4.0/diffsptk/modules/wht.py +115 -0
  20. diffsptk-2.4.0/diffsptk/version.py +1 -0
  21. {diffsptk-2.3.0 → diffsptk-2.4.0}/pyproject.toml +10 -10
  22. diffsptk-2.3.0/diffsptk/version.py +0 -1
  23. {diffsptk-2.3.0 → diffsptk-2.4.0}/.gitignore +0 -0
  24. {diffsptk-2.3.0 → diffsptk-2.4.0}/CITATION.cff +0 -0
  25. {diffsptk-2.3.0 → diffsptk-2.4.0}/LICENSE +0 -0
  26. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/__init__.py +0 -0
  27. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/misc/__init__.py +0 -0
  28. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/misc/signals.py +0 -0
  29. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/acorr.py +0 -0
  30. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/acr2csm.py +2 -2
  31. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/alaw.py +0 -0
  32. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/ap.py +1 -1
  33. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/b2mc.py +1 -1
  34. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/c2acr.py +0 -0
  35. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/c2ndps.py +0 -0
  36. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/cdist.py +0 -0
  37. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/chroma.py +1 -1
  38. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/csm2acr.py +0 -0
  39. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/dct.py +0 -0
  40. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/decimate.py +0 -0
  41. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/delay.py +0 -0
  42. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/delta.py +1 -1
  43. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/dequantize.py +0 -0
  44. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/df2.py +0 -0
  45. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/dfs.py +1 -1
  46. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/dht.py +0 -0
  47. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/drc.py +1 -1
  48. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/dst.py +0 -0
  49. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/entropy.py +0 -0
  50. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/excite.py +1 -1
  51. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/fftcep.py +1 -1
  52. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/flux.py +0 -0
  53. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/frame.py +1 -1
  54. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/freqt.py +0 -0
  55. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/gammatone.py +0 -0
  56. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/gnorm.py +0 -0
  57. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/grpdelay.py +1 -1
  58. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/hilbert.py +0 -0
  59. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/hilbert2.py +0 -0
  60. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/histogram.py +0 -0
  61. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/ialaw.py +0 -0
  62. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/idct.py +0 -0
  63. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/idht.py +0 -0
  64. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/idst.py +0 -0
  65. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/igammatone.py +1 -1
  66. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/ignorm.py +0 -0
  67. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/imdct.py +0 -0
  68. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/imdst.py +0 -0
  69. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/imsvq.py +0 -0
  70. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/interpolate.py +0 -0
  71. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/ipnorm.py +0 -0
  72. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/ipqmf.py +1 -1
  73. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/istft.py +0 -0
  74. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/iulaw.py +0 -0
  75. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/ivq.py +0 -0
  76. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/lar2par.py +0 -0
  77. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/levdur.py +0 -0
  78. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/linear_intpl.py +1 -1
  79. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/lpc.py +0 -0
  80. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/lpc2lsp.py +1 -1
  81. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/lpc2par.py +0 -0
  82. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/lpccheck.py +0 -0
  83. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/lsp2lpc.py +1 -1
  84. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/lsp2sp.py +0 -0
  85. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/lspcheck.py +0 -0
  86. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/magic_intpl.py +0 -0
  87. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/mc2b.py +0 -0
  88. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/mcep.py +0 -0
  89. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/mcpf.py +0 -0
  90. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/mdct.py +1 -1
  91. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/mdst.py +0 -0
  92. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/mfcc.py +0 -0
  93. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/mgc2mgc.py +1 -1
  94. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/mgc2sp.py +0 -0
  95. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/mgcep.py +0 -0
  96. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/mlsacheck.py +0 -0
  97. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/mpir2c.py +0 -0
  98. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/msvq.py +0 -0
  99. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/ndps2c.py +0 -0
  100. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/norm0.py +0 -0
  101. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/par2lar.py +0 -0
  102. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/par2lpc.py +0 -0
  103. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/pca.py +0 -0
  104. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/phase.py +0 -0
  105. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/pitch.py +1 -1
  106. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/plp.py +0 -0
  107. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/pnorm.py +0 -0
  108. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/pol_root.py +1 -1
  109. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/poledf.py +0 -0
  110. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/pqmf.py +1 -1
  111. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/quantize.py +0 -0
  112. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/rlevdur.py +1 -1
  113. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/rmse.py +0 -0
  114. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/root_pol.py +0 -0
  115. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/smcep.py +0 -0
  116. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/snr.py +0 -0
  117. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/spec.py +0 -0
  118. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/stft.py +0 -0
  119. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/ulaw.py +0 -0
  120. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/unframe.py +1 -1
  121. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/vq.py +0 -0
  122. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/window.py +1 -1
  123. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/yingram.py +1 -1
  124. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/zcross.py +0 -0
  125. {diffsptk-2.3.0 → diffsptk-2.4.0}/diffsptk/modules/zerodf.py +1 -1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: diffsptk
3
- Version: 2.3.0
3
+ Version: 2.4.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/
@@ -31,10 +31,11 @@ Requires-Dist: tqdm>=4.15.0
31
31
  Requires-Dist: vector-quantize-pytorch>=1.14.9
32
32
  Provides-Extra: dev
33
33
  Requires-Dist: build; extra == 'dev'
34
+ Requires-Dist: codespell; extra == 'dev'
34
35
  Requires-Dist: docstrfmt; extra == 'dev'
35
- Requires-Dist: isort; extra == 'dev'
36
36
  Requires-Dist: mdformat; extra == 'dev'
37
37
  Requires-Dist: numpydoc; extra == 'dev'
38
+ Requires-Dist: pkginfo; extra == 'dev'
38
39
  Requires-Dist: pydata-sphinx-theme; extra == 'dev'
39
40
  Requires-Dist: pytest; extra == 'dev'
40
41
  Requires-Dist: pytest-cov; extra == 'dev'
@@ -48,10 +49,10 @@ Description-Content-Type: text/markdown
48
49
  *diffsptk* is a differentiable version of [SPTK](https://github.com/sp-nitech/SPTK) based on the PyTorch framework.
49
50
 
50
51
  [![Latest Manual](https://img.shields.io/badge/docs-latest-blue.svg)](https://sp-nitech.github.io/diffsptk/latest/)
51
- [![Stable Manual](https://img.shields.io/badge/docs-stable-blue.svg)](https://sp-nitech.github.io/diffsptk/2.3.0/)
52
+ [![Stable Manual](https://img.shields.io/badge/docs-stable-blue.svg)](https://sp-nitech.github.io/diffsptk/2.4.0/)
52
53
  [![Downloads](https://static.pepy.tech/badge/diffsptk)](https://pepy.tech/project/diffsptk)
53
54
  [![Python Version](https://img.shields.io/pypi/pyversions/diffsptk.svg)](https://pypi.python.org/pypi/diffsptk)
54
- [![PyTorch Version](https://img.shields.io/badge/pytorch-2.0.0%20%7C%202.5.1-orange.svg)](https://pypi.python.org/pypi/diffsptk)
55
+ [![PyTorch Version](https://img.shields.io/badge/pytorch-2.0.0%20%7C%202.6.0-orange.svg)](https://pypi.python.org/pypi/diffsptk)
55
56
  [![PyPI Version](https://img.shields.io/pypi/v/diffsptk.svg)](https://pypi.python.org/pypi/diffsptk)
56
57
  [![Codecov](https://codecov.io/gh/sp-nitech/diffsptk/branch/master/graph/badge.svg)](https://app.codecov.io/gh/sp-nitech/diffsptk)
57
58
  [![License](https://img.shields.io/github/license/sp-nitech/diffsptk.svg)](https://github.com/sp-nitech/diffsptk/blob/master/LICENSE)
@@ -65,7 +66,7 @@ Description-Content-Type: text/markdown
65
66
 
66
67
  ## Documentation
67
68
 
68
- - See [this page](https://sp-nitech.github.io/diffsptk/latest/) for a reference manual.
69
+ - See [this page](https://sp-nitech.github.io/diffsptk/latest/) for the reference manual.
69
70
  - Our [paper](https://www.isca-speech.org/archive/ssw_2023/yoshimura23_ssw.html) is available on the ISCA Archive.
70
71
 
71
72
  ## Installation
@@ -3,10 +3,10 @@
3
3
  *diffsptk* is a differentiable version of [SPTK](https://github.com/sp-nitech/SPTK) based on the PyTorch framework.
4
4
 
5
5
  [![Latest Manual](https://img.shields.io/badge/docs-latest-blue.svg)](https://sp-nitech.github.io/diffsptk/latest/)
6
- [![Stable Manual](https://img.shields.io/badge/docs-stable-blue.svg)](https://sp-nitech.github.io/diffsptk/2.3.0/)
6
+ [![Stable Manual](https://img.shields.io/badge/docs-stable-blue.svg)](https://sp-nitech.github.io/diffsptk/2.4.0/)
7
7
  [![Downloads](https://static.pepy.tech/badge/diffsptk)](https://pepy.tech/project/diffsptk)
8
8
  [![Python Version](https://img.shields.io/pypi/pyversions/diffsptk.svg)](https://pypi.python.org/pypi/diffsptk)
9
- [![PyTorch Version](https://img.shields.io/badge/pytorch-2.0.0%20%7C%202.5.1-orange.svg)](https://pypi.python.org/pypi/diffsptk)
9
+ [![PyTorch Version](https://img.shields.io/badge/pytorch-2.0.0%20%7C%202.6.0-orange.svg)](https://pypi.python.org/pypi/diffsptk)
10
10
  [![PyPI Version](https://img.shields.io/pypi/v/diffsptk.svg)](https://pypi.python.org/pypi/diffsptk)
11
11
  [![Codecov](https://codecov.io/gh/sp-nitech/diffsptk/branch/master/graph/badge.svg)](https://app.codecov.io/gh/sp-nitech/diffsptk)
12
12
  [![License](https://img.shields.io/github/license/sp-nitech/diffsptk.svg)](https://github.com/sp-nitech/diffsptk/blob/master/LICENSE)
@@ -20,7 +20,7 @@
20
20
 
21
21
  ## Documentation
22
22
 
23
- - See [this page](https://sp-nitech.github.io/diffsptk/latest/) for a reference manual.
23
+ - See [this page](https://sp-nitech.github.io/diffsptk/latest/) for the reference manual.
24
24
  - Our [paper](https://www.isca-speech.org/archive/ssw_2023/yoshimura23_ssw.html) is available on the ISCA Archive.
25
25
 
26
26
  ## Installation
@@ -584,7 +584,7 @@ def fbank(x, n_channel, sample_rate, f_min=0, f_max=None, floor=1e-5, out_format
584
584
  Minimum mel-filter bank output in linear scale.
585
585
 
586
586
  out_format : ['y', 'yE', 'y,E']
587
- `y` is mel-filber bank outpus and `E` is energy. If this is `yE`, the two output
587
+ `y` is mel-filber bank output and `E` is energy. If this is `yE`, the two output
588
588
  tensors are concatenated and return the tensor instead of the tuple.
589
589
 
590
590
  Returns
@@ -711,7 +711,7 @@ def freqt(c, out_order, alpha=0):
711
711
  Order of output cepstrum, :math:`M_2`.
712
712
 
713
713
  alpha : float in (-1, 1)
714
- Frquency warping factor, :math:`\\alpha`.
714
+ Frequency warping factor, :math:`\\alpha`.
715
715
 
716
716
  Returns
717
717
  -------
@@ -1203,6 +1203,26 @@ def iulaw(y, abs_max=1, mu=255):
1203
1203
  return nn.MuLawExpansion._func(y, abs_max=abs_max, mu=mu)
1204
1204
 
1205
1205
 
1206
+ def iwht(y, wht_type="natural"):
1207
+ """Compute inverse WHT.
1208
+
1209
+ Parameters
1210
+ ----------
1211
+ y : Tensor [shape=(..., L)]
1212
+ Input.
1213
+
1214
+ wht_type : ['sequency', 'natural', 'dyadic']
1215
+ Order of coefficients of Walsh matrix.
1216
+
1217
+ Returns
1218
+ -------
1219
+ out : Tensor [shape=(..., L)]
1220
+ Inverse WHT output.
1221
+
1222
+ """
1223
+ return nn.InverseWalshHadamardTransform._func(y, wht_type=wht_type)
1224
+
1225
+
1206
1226
  def lar2par(g):
1207
1227
  """Convert LAR to PARCOR.
1208
1228
 
@@ -2266,6 +2286,26 @@ def unframe(
2266
2286
  )
2267
2287
 
2268
2288
 
2289
+ def wht(x, wht_type="natural"):
2290
+ """Compute WHT.
2291
+
2292
+ Parameters
2293
+ ----------
2294
+ x : Tensor [shape=(..., L)]
2295
+ Input signal.
2296
+
2297
+ wht_type : ['sequency', 'natural', 'dyadic']
2298
+ Order of coefficients of Walsh matrix.
2299
+
2300
+ Returns
2301
+ -------
2302
+ out : Tensor [shape=(..., L)]
2303
+ WHT output.
2304
+
2305
+ """
2306
+ return nn.WalshHadamardTransform._func(x, wht_type=wht_type)
2307
+
2308
+
2269
2309
  def window(x, out_length=None, *, window="blackman", norm="power"):
2270
2310
  """Apply window function.
2271
2311
 
@@ -14,16 +14,16 @@
14
14
  # limitations under the License. #
15
15
  # ------------------------------------------------------------------------ #
16
16
 
17
- from importlib import import_module
18
17
  import logging
19
18
  import math
19
+ from importlib import import_module
20
20
 
21
21
  import numpy as np
22
22
  import soundfile as sf
23
23
  import torch
24
- from torch import nn
25
24
  import torch.nn.functional as F
26
25
  import torchaudio
26
+ from torch import nn
27
27
 
28
28
  UNVOICED_SYMBOL = 0
29
29
  TWO_PI = math.tau
@@ -64,6 +64,10 @@ def get_generator(seed=None):
64
64
  return generator
65
65
 
66
66
 
67
+ def is_power_of_two(n):
68
+ return (n != 0) and (n & (n - 1) == 0)
69
+
70
+
67
71
  def next_power_of_two(n):
68
72
  return 1 << (n - 1).bit_length()
69
73
 
@@ -136,6 +136,10 @@ from .stft import ShortTimeFourierTransform as STFT
136
136
  from .ulaw import MuLawCompression
137
137
  from .unframe import Unframe
138
138
  from .vq import VectorQuantization
139
+ from .wht import WalshHadamardTransform
140
+ from .wht import WalshHadamardTransform as WHT
141
+ from .wht import WalshHadamardTransform as InverseWalshHadamardTransform
142
+ from .wht import WalshHadamardTransform as IWHT
139
143
  from .window import Window
140
144
  from .yingram import Yingram
141
145
  from .zcross import ZeroCrossingAnalysis
@@ -77,7 +77,7 @@ class CepstrumToMinimumPhaseImpulseResponse(nn.Module):
77
77
  @staticmethod
78
78
  def _forward(c, ir_length, n_fft):
79
79
  C = torch.fft.fft(c, n=n_fft)
80
- h = torch.fft.ifft(cexp(C))[..., :ir_length].real
80
+ h = torch.fft.ifft(cexp(C)).real[..., :ir_length]
81
81
  return h
82
82
 
83
83
  _func = _forward
@@ -32,8 +32,8 @@
32
32
 
33
33
  import numpy as np
34
34
  import torch
35
- from torch import nn
36
35
  import torchaudio
36
+ from torch import nn
37
37
 
38
38
  from ..misc.utils import Lambda
39
39
  from ..misc.utils import delayed_import
@@ -78,7 +78,7 @@ class ConstantQTransform(nn.Module):
78
78
  Window function for the basis.
79
79
 
80
80
  scale : bool
81
- If True, scale the CQT responce by the length of filter.
81
+ If True, scale the CQT response by the length of filter.
82
82
 
83
83
  res_type : ['kaiser_best', 'kaiser_fast'] or None
84
84
  Resampling type.
@@ -50,7 +50,7 @@ class MelFilterBankAnalysis(nn.Module):
50
50
  If True, use power spectrum instead of amplitude spectrum.
51
51
 
52
52
  out_format : ['y', 'yE', 'y,E']
53
- `y` is mel-filber bank outpus and `E` is energy. If this is `yE`, the two output
53
+ `y` is mel-filber bank output and `E` is energy. If this is `yE`, the two output
54
54
  tensors are concatenated and return the tensor instead of the tuple.
55
55
 
56
56
  References
@@ -22,7 +22,7 @@ from ..misc.utils import to
22
22
 
23
23
 
24
24
  class SecondOrderAllPassFrequencyTransform(nn.Module):
25
- """Second-order all-pass frequecy transform module.
25
+ """Second-order all-pass frequency transform module.
26
26
 
27
27
  Parameters
28
28
  ----------
@@ -338,7 +338,7 @@ class GaussianMixtureModeling(nn.Module):
338
338
 
339
339
  # Check convergence.
340
340
  if self.verbose:
341
- self.logger.info(f"iter {n+1:5d}: average = {log_likelihood / T:g}")
341
+ self.logger.info(f"iter {n + 1:5d}: average = {log_likelihood / T:g}")
342
342
  change = log_likelihood - prev_log_likelihood
343
343
  if n and change < self.eps:
344
344
  break
@@ -148,7 +148,7 @@ class IndependentComponentAnalysis(nn.Module):
148
148
  similarity = torch.diagonal(torch.matmul(W, prev_W.T)).abs()
149
149
  criterion = (similarity - 1).abs().max()
150
150
  if self.verbose:
151
- self.logger.info(f" iter {n+1:5d}: criterion = {criterion:g}")
151
+ self.logger.info(f" iter {n + 1:5d}: criterion = {criterion:g}")
152
152
  if criterion < self.eps:
153
153
  break
154
154
 
@@ -32,8 +32,8 @@
32
32
 
33
33
  import numpy as np
34
34
  import torch
35
- from torch import nn
36
35
  import torchaudio
36
+ from torch import nn
37
37
 
38
38
  from ..misc.utils import delayed_import
39
39
  from ..misc.utils import get_resample_params
@@ -77,7 +77,7 @@ class InverseConstantQTransform(nn.Module):
77
77
  Window function for the basis.
78
78
 
79
79
  scale : bool
80
- If True, scale the CQT responce by the length of filter.
80
+ If True, scale the CQT response by the length of filter.
81
81
 
82
82
  res_type : ['kaiser_best', 'kaiser_fast'] or None
83
83
  Resampling type.
@@ -23,7 +23,7 @@ from .freqt2 import SecondOrderAllPassFrequencyTransform
23
23
 
24
24
 
25
25
  class SecondOrderAllPassInverseFrequencyTransform(nn.Module):
26
- """Second-order all-pass inverse frequecy transform module.
26
+ """Second-order all-pass inverse frequency transform module.
27
27
 
28
28
  Parameters
29
29
  ----------
@@ -35,8 +35,11 @@ class PseudoInverseMGLSADigitalFilter(nn.Module):
35
35
  y : Tensor [shape=(..., T)]
36
36
  Audio signal.
37
37
 
38
- mc : Tensor [shape=(..., T/P, M+1)]
39
- Mel-generalized cepstrum, not MLSA digital filter coefficients.
38
+ mc : Tensor [shape=(..., T/P, M+1)] or [shape=(..., T/P, N+M+1)]
39
+ Mel-generalized cepstrum, not MLSA digital filter coefficients. Note that
40
+ the mixed-phase case assumes that the coefficients are of the form
41
+ c_{-N}, ..., c_{0}, ..., c_{M}, where M is the order of the minimum-phase
42
+ part and N is the order of the maximum-phase part.
40
43
 
41
44
  Returns
42
45
  -------
@@ -172,7 +172,7 @@ class LindeBuzoGrayAlgorithm(nn.Module):
172
172
  x = to_dataloader(x, self.batch_size)
173
173
  device = self.vq.codebook.device
174
174
 
175
- # Initalize codebook.
175
+ # Initialize codebook.
176
176
  if self.init == "none":
177
177
  pass
178
178
  elif self.init == "mean":
@@ -223,7 +223,7 @@ class LindeBuzoGrayAlgorithm(nn.Module):
223
223
  # E-step: evaluate model.
224
224
  indices, distance = e_step(x)
225
225
  if self.verbose:
226
- self.logger.info(f" iter {n+1:5d}: distance = {distance:g}")
226
+ self.logger.info(f" iter {n + 1:5d}: distance = {distance:g}")
227
227
 
228
228
  # Check convergence.
229
229
  change = (prev_distance - distance).abs()