Dividend9853
commited on
Commit
•
a056889
1
Parent(s):
8cf8037
Upload 5 files
Browse files
lws/index.html
CHANGED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta name="generator" content="simple503 version 0.4.0" />
|
5 |
+
<meta name="pypi:repository-version" content="1.0" />
|
6 |
+
<meta charset="UTF-8" />
|
7 |
+
<title>
|
8 |
+
Links for lws
|
9 |
+
</title>
|
10 |
+
</head>
|
11 |
+
<body>
|
12 |
+
<h1>
|
13 |
+
Links for lws
|
14 |
+
</h1>
|
15 |
+
<a href="https://huggingface.co/hanamizuki-ai/pypi-wheels/resolve/main/lws/lws-1.2.8-cp311-cp311-win_amd64.whl#sha256=50ef93cf3ebc4005bbb3f7c6f1838a8a139a1ac553c4ae8d8b6c10f8e17060c3" data-dist-info-metadata="sha256=2f2413fad3f61684da1821265c3a376b4b150ad264127b8a121d9e93d051a4db">
|
16 |
+
lws-1.2.8-cp311-cp311-win_amd64.whl
|
17 |
+
</a>
|
18 |
+
<br />
|
19 |
+
<a href="https://huggingface.co/hanamizuki-ai/pypi-wheels/resolve/main/lws/lws-1.2.8-cp310-cp310-win_amd64.whl#sha256=e8fb971799e059dc2f76e083baf3aed6fb8df6848231af140b0561b8ad6f3b16" data-dist-info-metadata="sha256=2f2413fad3f61684da1821265c3a376b4b150ad264127b8a121d9e93d051a4db">
|
20 |
+
lws-1.2.8-cp310-cp310-win_amd64.whl
|
21 |
+
</a>
|
22 |
+
<br />
|
23 |
+
</body>
|
24 |
+
</html>
|
lws/lws-1.2.8-cp310-cp310-win_amd64.whl
ADDED
Binary file (125 kB). View file
|
|
lws/lws-1.2.8-cp310-cp310-win_amd64.whl.metadata
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.1
|
2 |
+
Name: lws
|
3 |
+
Version: 1.2.8
|
4 |
+
Summary: Fast spectrogram phase reconstruction using Local Weighted Sums
|
5 |
+
Home-page: https://github.com/Jonathan-LeRoux/lws
|
6 |
+
Download-URL: https://github.com/Jonathan-LeRoux/lws/archive/1.2.8.tar.gz
|
7 |
+
Author: Jonathan Le Roux
|
8 |
+
Author-email: [email protected]
|
9 |
+
License: Apache 2.0
|
10 |
+
Keywords: phase,reconstruction,stft,short-term Fourier Transform,spectrogram
|
11 |
+
Classifier: Programming Language :: Python
|
12 |
+
Classifier: Intended Audience :: Developers
|
13 |
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
|
14 |
+
Classifier: Programming Language :: Python :: 2
|
15 |
+
Classifier: Programming Language :: Python :: 2.7
|
16 |
+
Classifier: Programming Language :: Python :: 3
|
17 |
+
Classifier: Programming Language :: Python :: 3.5
|
18 |
+
Classifier: Programming Language :: Python :: 3.6
|
19 |
+
Classifier: Programming Language :: Python :: 3.7
|
20 |
+
Classifier: Programming Language :: Python :: 3.8
|
21 |
+
Classifier: Programming Language :: Python :: 3.9
|
22 |
+
Classifier: Programming Language :: Python :: 3.10
|
23 |
+
Classifier: Programming Language :: Python :: 3.11
|
24 |
+
Classifier: Programming Language :: Python :: 3.12
|
25 |
+
Classifier: Programming Language :: Python :: 3.13
|
26 |
+
Description-Content-Type: text/markdown
|
27 |
+
Requires-Dist: numpy
|
28 |
+
|
29 |
+
LWS
|
30 |
+
===
|
31 |
+
|
32 |
+
### Fast spectrogram phase recovery using Local Weighted Sums ###
|
33 |
+
|
34 |
+
Author: Jonathan Le Roux -- 2008-2023
|
35 |
+
|
36 |
+
[![PyPI version](https://badge.fury.io/py/lws.svg)](https://badge.fury.io/py/lws)
|
37 |
+
|
38 |
+
LWS is a C/C++ library for which this package is a Python wrapper.
|
39 |
+
A Matlab/Mex wrapper is also available.
|
40 |
+
|
41 |
+
License
|
42 |
+
-------
|
43 |
+
|
44 |
+
Copyright (C) 2008-2023 Jonathan Le Roux
|
45 |
+
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
|
46 |
+
|
47 |
+
Citing this code
|
48 |
+
----------------
|
49 |
+
|
50 |
+
If you use this code, please cite the following papers:
|
51 |
+
|
52 |
+
### Batch LWS ###
|
53 |
+
|
54 |
+
Jonathan Le Roux, Hirokazu Kameoka, Nobutaka Ono, Shigeki Sagayama,
|
55 |
+
"Fast Signal Reconstruction from Magnitude STFT Spectrogram Based on Spectrogram Consistency,"
|
56 |
+
in Proc. International Conference on Digital Audio Effects (DAFx), pp. 397--403, Sep. 2010.
|
57 |
+
|
58 |
+
@InProceedings{LeRoux2010DAFx09,
|
59 |
+
author = {Jonathan {Le Roux} and Hirokazu Kameoka and Nobutaka Ono and Shigeki Sagayama},
|
60 |
+
title = {Fast Signal Reconstruction from Magnitude {STFT} Spectrogram Based on Spectrogram Consistency},
|
61 |
+
booktitle = {Proc. International Conference on Digital Audio Effects (DAFx)},
|
62 |
+
year = 2010,
|
63 |
+
pages = {397--403},
|
64 |
+
month = sep
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
### Online LWS, "No future" LWS ###
|
69 |
+
|
70 |
+
Jonathan Le Roux, Hirokazu Kameoka, Nobutaka Ono, Shigeki Sagayama,
|
71 |
+
"Phase initialization schemes for faster spectrogram-consistency-based signal reconstruction,"
|
72 |
+
in Proc. of ASJ Autumn Meeting, 3-10-3, Sep. 2010.
|
73 |
+
|
74 |
+
@InProceedings{LeRoux2010ASJ09,
|
75 |
+
author = {Jonathan {Le Roux} and Hirokazu Kameoka and Nobutaka Ono and Shigeki Sagayama},
|
76 |
+
title = {Phase Initialization Schemes for Faster Spectrogram-Consistency-Based Signal Reconstruction},
|
77 |
+
year = 2010,
|
78 |
+
booktitle = {Proc. Acoustical Society of Japan Autumn Meeting (ASJ)},
|
79 |
+
number = {3-10-3},
|
80 |
+
month = mar
|
81 |
+
}
|
82 |
+
|
83 |
+
|
84 |
+
Installation:
|
85 |
+
-------------
|
86 |
+
|
87 |
+
1) The easiest way to install `lws` is via `pip`:
|
88 |
+
|
89 |
+
```sh
|
90 |
+
pip install lws
|
91 |
+
```
|
92 |
+
|
93 |
+
2) To compile from source using cython (required if one modifies the code):
|
94 |
+
|
95 |
+
```sh
|
96 |
+
cd python
|
97 |
+
LWS_USE_CYTHON=1 make
|
98 |
+
```
|
99 |
+
|
100 |
+
3) To compile from source using the pre-generated c source file (which was obtained with cython):
|
101 |
+
|
102 |
+
```sh
|
103 |
+
cd python
|
104 |
+
make
|
105 |
+
```
|
106 |
+
|
107 |
+
4) Alternatively, one can first use cython to create a tarball, which can then be installed with pip:
|
108 |
+
|
109 |
+
```sh
|
110 |
+
cd python
|
111 |
+
make sdist
|
112 |
+
pip install dist/lws-1.2.7.tar.gz
|
113 |
+
```
|
114 |
+
|
115 |
+
**Note:** On Windows, the Microsoft Visual C++ Compiler for your version of Python needs to be installed. See [this page](https://wiki.python.org/moin/WindowsCompilers) for more details.
|
116 |
+
|
117 |
+
Usage
|
118 |
+
-----
|
119 |
+
|
120 |
+
```python
|
121 |
+
import lws
|
122 |
+
import numpy as np
|
123 |
+
|
124 |
+
lws_processor=lws.lws(512,128, mode="speech") # 512: window length; 128: window shift
|
125 |
+
X = lws_processor.stft(x) # where x is a single-channel waveform
|
126 |
+
X0 = np.abs(X) # Magnitude spectrogram
|
127 |
+
print('{:6}: {:5.2f} dB'.format('Abs(X)', lws_processor.get_consistency(X0)))
|
128 |
+
X1 = lws_processor.run_lws(X0) # reconstruction from magnitude (in general, one can reconstruct from an initial complex spectrogram)
|
129 |
+
print('{:6}: {:5.2f} dB'.format('LWS', lws_processor.get_consistency(X1)))
|
130 |
+
```
|
131 |
+
|
132 |
+
Options
|
133 |
+
-------
|
134 |
+
|
135 |
+
```python
|
136 |
+
lws_processor=lws.lws(awin_or_fsize, fshift, L = 5, swin = None, look_ahead = 3,
|
137 |
+
nofuture_iterations = 0, nofuture_alpha = 1, nofuture_beta = 0.1, nofuture_gamma = 1,
|
138 |
+
online_iterations = 0, online_alpha = 1, online_beta = 0.1, online_gamma = 1,
|
139 |
+
batch_iterations = 100, batch_alpha = 100, batch_beta = 0.1, batch_gamma = 1,
|
140 |
+
symmetric_win = True, mode= None, fftsize=None, perfectrec=True)
|
141 |
+
```
|
142 |
+
|
143 |
+
* `awin_or_fsize`: either the analysis window, or a window length (in which case the sqrt(hann) window is used); the analysis window should be symmetric for the computations to be correct.
|
144 |
+
* `fshift`: window shift
|
145 |
+
* `L`: approximation order in the phase reconstruction algorithm, 5 should be good.
|
146 |
+
* `swin`: synthesis window (if None, it gets computed from the analysis window for perfect reconstruction)
|
147 |
+
* `look_ahead`: number of look-ahead frames in RTISI-LA-like algorithm, 3 should be good.
|
148 |
+
* `xxx_iterations`, `xxx_alpha`, `xxx_beta`, `xxx_gamma`: number of iterations of algorithm xxx (where xxx is one of `nofuture`, `online`, or `batch`), and parameters alpha/beta/gamma of the decreasing sparsity curve that is used to determine which bins get updated at each iteration. Any bin with magnitude larger than a given threshold is updated, others are ignored (`thresholds = alpha * np.exp(- beta * np.arange(iterations)**gamma)`)
|
149 |
+
* `symmetric_win`: determines whether to use a symmetric hann window or not
|
150 |
+
* `mode`: `None`, `'speech'`, or `'music'`. This sets default numbers of iterations of each algorithm that seem to be good for speech and music signals. Disclaimer: your mileage may vary.
|
151 |
+
* `fftsize`: can be set longer than frame size to do 0-padding in the FFT. Note that 0-padding will be done symmetrically on the left and right of the window to enforce symmetry in the analysis window.
|
152 |
+
* `perfectrec`: whether to pad with zeros on each side to ensure perfect reconstruction at the boundaries too.
|
153 |
+
|
154 |
+
Three steps are implemented, and they can be turned on/off independently by appropriately setting the corresponding number of iterations:
|
155 |
+
|
156 |
+
* "no future" LWS: phase initialization using LWS updates that only involve past frames
|
157 |
+
* online LWS: phase estimation using online LWS updates, corresponding to a fast time-frequency domain version of RTISI-LA
|
158 |
+
* LWS: phase estimation using batch LWS updates on the whole spectrogram
|
159 |
+
|
160 |
+
|
161 |
+
|
162 |
+
|
163 |
+
Remarks
|
164 |
+
-------
|
165 |
+
|
166 |
+
1) The .cpp files are actually C code with some C99 style comments, but the .cpp extension is needed on Windows for mex to acknowledge the c99 flag (with .c, it is discarded, and -ansi used instead, leading to compilation errors)
|
167 |
+
|
168 |
+
2) Because the module is a C extension, it cannot be reloaded (see <http://bugs.python.org/issue1144263>). In Jupyter Notebooks, in particular, autoreload will not work, and the kernel has to be restarted.
|
169 |
+
|
170 |
+
|
171 |
+
Acknowledgements
|
172 |
+
----------------
|
173 |
+
|
174 |
+
The recipe to wrap the LWS C code as a python module was largely inspired by Martin Sosic's post: http://martinsosic.com/development/2016/02/08/wrapping-c-library-as-python-module.html
|
lws/lws-1.2.8-cp311-cp311-win_amd64.whl
ADDED
Binary file (135 kB). View file
|
|
lws/lws-1.2.8-cp311-cp311-win_amd64.whl.metadata
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.1
|
2 |
+
Name: lws
|
3 |
+
Version: 1.2.8
|
4 |
+
Summary: Fast spectrogram phase reconstruction using Local Weighted Sums
|
5 |
+
Home-page: https://github.com/Jonathan-LeRoux/lws
|
6 |
+
Download-URL: https://github.com/Jonathan-LeRoux/lws/archive/1.2.8.tar.gz
|
7 |
+
Author: Jonathan Le Roux
|
8 |
+
Author-email: [email protected]
|
9 |
+
License: Apache 2.0
|
10 |
+
Keywords: phase,reconstruction,stft,short-term Fourier Transform,spectrogram
|
11 |
+
Classifier: Programming Language :: Python
|
12 |
+
Classifier: Intended Audience :: Developers
|
13 |
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
|
14 |
+
Classifier: Programming Language :: Python :: 2
|
15 |
+
Classifier: Programming Language :: Python :: 2.7
|
16 |
+
Classifier: Programming Language :: Python :: 3
|
17 |
+
Classifier: Programming Language :: Python :: 3.5
|
18 |
+
Classifier: Programming Language :: Python :: 3.6
|
19 |
+
Classifier: Programming Language :: Python :: 3.7
|
20 |
+
Classifier: Programming Language :: Python :: 3.8
|
21 |
+
Classifier: Programming Language :: Python :: 3.9
|
22 |
+
Classifier: Programming Language :: Python :: 3.10
|
23 |
+
Classifier: Programming Language :: Python :: 3.11
|
24 |
+
Classifier: Programming Language :: Python :: 3.12
|
25 |
+
Classifier: Programming Language :: Python :: 3.13
|
26 |
+
Description-Content-Type: text/markdown
|
27 |
+
Requires-Dist: numpy
|
28 |
+
|
29 |
+
LWS
|
30 |
+
===
|
31 |
+
|
32 |
+
### Fast spectrogram phase recovery using Local Weighted Sums ###
|
33 |
+
|
34 |
+
Author: Jonathan Le Roux -- 2008-2023
|
35 |
+
|
36 |
+
[![PyPI version](https://badge.fury.io/py/lws.svg)](https://badge.fury.io/py/lws)
|
37 |
+
|
38 |
+
LWS is a C/C++ library for which this package is a Python wrapper.
|
39 |
+
A Matlab/Mex wrapper is also available.
|
40 |
+
|
41 |
+
License
|
42 |
+
-------
|
43 |
+
|
44 |
+
Copyright (C) 2008-2023 Jonathan Le Roux
|
45 |
+
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
|
46 |
+
|
47 |
+
Citing this code
|
48 |
+
----------------
|
49 |
+
|
50 |
+
If you use this code, please cite the following papers:
|
51 |
+
|
52 |
+
### Batch LWS ###
|
53 |
+
|
54 |
+
Jonathan Le Roux, Hirokazu Kameoka, Nobutaka Ono, Shigeki Sagayama,
|
55 |
+
"Fast Signal Reconstruction from Magnitude STFT Spectrogram Based on Spectrogram Consistency,"
|
56 |
+
in Proc. International Conference on Digital Audio Effects (DAFx), pp. 397--403, Sep. 2010.
|
57 |
+
|
58 |
+
@InProceedings{LeRoux2010DAFx09,
|
59 |
+
author = {Jonathan {Le Roux} and Hirokazu Kameoka and Nobutaka Ono and Shigeki Sagayama},
|
60 |
+
title = {Fast Signal Reconstruction from Magnitude {STFT} Spectrogram Based on Spectrogram Consistency},
|
61 |
+
booktitle = {Proc. International Conference on Digital Audio Effects (DAFx)},
|
62 |
+
year = 2010,
|
63 |
+
pages = {397--403},
|
64 |
+
month = sep
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
### Online LWS, "No future" LWS ###
|
69 |
+
|
70 |
+
Jonathan Le Roux, Hirokazu Kameoka, Nobutaka Ono, Shigeki Sagayama,
|
71 |
+
"Phase initialization schemes for faster spectrogram-consistency-based signal reconstruction,"
|
72 |
+
in Proc. of ASJ Autumn Meeting, 3-10-3, Sep. 2010.
|
73 |
+
|
74 |
+
@InProceedings{LeRoux2010ASJ09,
|
75 |
+
author = {Jonathan {Le Roux} and Hirokazu Kameoka and Nobutaka Ono and Shigeki Sagayama},
|
76 |
+
title = {Phase Initialization Schemes for Faster Spectrogram-Consistency-Based Signal Reconstruction},
|
77 |
+
year = 2010,
|
78 |
+
booktitle = {Proc. Acoustical Society of Japan Autumn Meeting (ASJ)},
|
79 |
+
number = {3-10-3},
|
80 |
+
month = mar
|
81 |
+
}
|
82 |
+
|
83 |
+
|
84 |
+
Installation:
|
85 |
+
-------------
|
86 |
+
|
87 |
+
1) The easiest way to install `lws` is via `pip`:
|
88 |
+
|
89 |
+
```sh
|
90 |
+
pip install lws
|
91 |
+
```
|
92 |
+
|
93 |
+
2) To compile from source using cython (required if one modifies the code):
|
94 |
+
|
95 |
+
```sh
|
96 |
+
cd python
|
97 |
+
LWS_USE_CYTHON=1 make
|
98 |
+
```
|
99 |
+
|
100 |
+
3) To compile from source using the pre-generated c source file (which was obtained with cython):
|
101 |
+
|
102 |
+
```sh
|
103 |
+
cd python
|
104 |
+
make
|
105 |
+
```
|
106 |
+
|
107 |
+
4) Alternatively, one can first use cython to create a tarball, which can then be installed with pip:
|
108 |
+
|
109 |
+
```sh
|
110 |
+
cd python
|
111 |
+
make sdist
|
112 |
+
pip install dist/lws-1.2.7.tar.gz
|
113 |
+
```
|
114 |
+
|
115 |
+
**Note:** On Windows, the Microsoft Visual C++ Compiler for your version of Python needs to be installed. See [this page](https://wiki.python.org/moin/WindowsCompilers) for more details.
|
116 |
+
|
117 |
+
Usage
|
118 |
+
-----
|
119 |
+
|
120 |
+
```python
|
121 |
+
import lws
|
122 |
+
import numpy as np
|
123 |
+
|
124 |
+
lws_processor=lws.lws(512,128, mode="speech") # 512: window length; 128: window shift
|
125 |
+
X = lws_processor.stft(x) # where x is a single-channel waveform
|
126 |
+
X0 = np.abs(X) # Magnitude spectrogram
|
127 |
+
print('{:6}: {:5.2f} dB'.format('Abs(X)', lws_processor.get_consistency(X0)))
|
128 |
+
X1 = lws_processor.run_lws(X0) # reconstruction from magnitude (in general, one can reconstruct from an initial complex spectrogram)
|
129 |
+
print('{:6}: {:5.2f} dB'.format('LWS', lws_processor.get_consistency(X1)))
|
130 |
+
```
|
131 |
+
|
132 |
+
Options
|
133 |
+
-------
|
134 |
+
|
135 |
+
```python
|
136 |
+
lws_processor=lws.lws(awin_or_fsize, fshift, L = 5, swin = None, look_ahead = 3,
|
137 |
+
nofuture_iterations = 0, nofuture_alpha = 1, nofuture_beta = 0.1, nofuture_gamma = 1,
|
138 |
+
online_iterations = 0, online_alpha = 1, online_beta = 0.1, online_gamma = 1,
|
139 |
+
batch_iterations = 100, batch_alpha = 100, batch_beta = 0.1, batch_gamma = 1,
|
140 |
+
symmetric_win = True, mode= None, fftsize=None, perfectrec=True)
|
141 |
+
```
|
142 |
+
|
143 |
+
* `awin_or_fsize`: either the analysis window, or a window length (in which case the sqrt(hann) window is used); the analysis window should be symmetric for the computations to be correct.
|
144 |
+
* `fshift`: window shift
|
145 |
+
* `L`: approximation order in the phase reconstruction algorithm, 5 should be good.
|
146 |
+
* `swin`: synthesis window (if None, it gets computed from the analysis window for perfect reconstruction)
|
147 |
+
* `look_ahead`: number of look-ahead frames in RTISI-LA-like algorithm, 3 should be good.
|
148 |
+
* `xxx_iterations`, `xxx_alpha`, `xxx_beta`, `xxx_gamma`: number of iterations of algorithm xxx (where xxx is one of `nofuture`, `online`, or `batch`), and parameters alpha/beta/gamma of the decreasing sparsity curve that is used to determine which bins get updated at each iteration. Any bin with magnitude larger than a given threshold is updated, others are ignored (`thresholds = alpha * np.exp(- beta * np.arange(iterations)**gamma)`)
|
149 |
+
* `symmetric_win`: determines whether to use a symmetric hann window or not
|
150 |
+
* `mode`: `None`, `'speech'`, or `'music'`. This sets default numbers of iterations of each algorithm that seem to be good for speech and music signals. Disclaimer: your mileage may vary.
|
151 |
+
* `fftsize`: can be set longer than frame size to do 0-padding in the FFT. Note that 0-padding will be done symmetrically on the left and right of the window to enforce symmetry in the analysis window.
|
152 |
+
* `perfectrec`: whether to pad with zeros on each side to ensure perfect reconstruction at the boundaries too.
|
153 |
+
|
154 |
+
Three steps are implemented, and they can be turned on/off independently by appropriately setting the corresponding number of iterations:
|
155 |
+
|
156 |
+
* "no future" LWS: phase initialization using LWS updates that only involve past frames
|
157 |
+
* online LWS: phase estimation using online LWS updates, corresponding to a fast time-frequency domain version of RTISI-LA
|
158 |
+
* LWS: phase estimation using batch LWS updates on the whole spectrogram
|
159 |
+
|
160 |
+
|
161 |
+
|
162 |
+
|
163 |
+
Remarks
|
164 |
+
-------
|
165 |
+
|
166 |
+
1) The .cpp files are actually C code with some C99 style comments, but the .cpp extension is needed on Windows for mex to acknowledge the c99 flag (with .c, it is discarded, and -ansi used instead, leading to compilation errors)
|
167 |
+
|
168 |
+
2) Because the module is a C extension, it cannot be reloaded (see <http://bugs.python.org/issue1144263>). In Jupyter Notebooks, in particular, autoreload will not work, and the kernel has to be restarted.
|
169 |
+
|
170 |
+
|
171 |
+
Acknowledgements
|
172 |
+
----------------
|
173 |
+
|
174 |
+
The recipe to wrap the LWS C code as a python module was largely inspired by Martin Sosic's post: http://martinsosic.com/development/2016/02/08/wrapping-c-library-as-python-module.html
|