modusa 0.4.26__py3-none-any.whl → 0.4.28__py3-none-any.whl
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.
- modusa/__init__.py +3 -1
- modusa/tools/__init__.py +3 -1
- modusa/tools/plotter.py +2 -2
- modusa/tools/synth.py +53 -0
- {modusa-0.4.26.dist-info → modusa-0.4.28.dist-info}/METADATA +1 -1
- {modusa-0.4.26.dist-info → modusa-0.4.28.dist-info}/RECORD +10 -9
- pyproject.toml +1 -1
- {modusa-0.4.26.dist-info → modusa-0.4.28.dist-info}/WHEEL +0 -0
- {modusa-0.4.26.dist-info → modusa-0.4.28.dist-info}/entry_points.txt +0 -0
- {modusa-0.4.26.dist-info → modusa-0.4.28.dist-info}/licenses/LICENSE.md +0 -0
modusa/__init__.py
CHANGED
modusa/tools/__init__.py
CHANGED
modusa/tools/plotter.py
CHANGED
@@ -539,7 +539,7 @@ class Fig:
|
|
539
539
|
text_obj = curr_row[0].text(
|
540
540
|
(start + end) / 2, text_yloc, tag,
|
541
541
|
ha='center', va='center',
|
542
|
-
fontsize=
|
542
|
+
fontsize=9, color="black", zorder=10, clip_on=True
|
543
543
|
)
|
544
544
|
|
545
545
|
text_obj.set_clip_path(rect)
|
@@ -556,7 +556,7 @@ class Fig:
|
|
556
556
|
text_obj = curr_row[0].text(
|
557
557
|
(start + end) / 2, text_yloc, tag,
|
558
558
|
ha='center', va='center',
|
559
|
-
fontsize=
|
559
|
+
fontsize=9, color="black", zorder=10, clip_on=True
|
560
560
|
)
|
561
561
|
|
562
562
|
text_obj.set_clip_path(rect)
|
modusa/tools/synth.py
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
|
3
|
+
#---------------------------------
|
4
|
+
# Author: Ankit Anand
|
5
|
+
# Date: 22/10/25
|
6
|
+
# Email: ankit0.anand0@gmail.com
|
7
|
+
#---------------------------------
|
8
|
+
|
9
|
+
def synth_f0(f0, f0t, sr, nharm=0):
|
10
|
+
"""
|
11
|
+
Synthesize f0 contour so that you can
|
12
|
+
hear it back.
|
13
|
+
|
14
|
+
Parameters
|
15
|
+
----------
|
16
|
+
f0: ndarray
|
17
|
+
- Fundamental frequency (f0) contour in Hz.
|
18
|
+
f0t: ndarray
|
19
|
+
- Timestamps in seconds
|
20
|
+
sr: int
|
21
|
+
- Sampling rate in Hz for the synthesized audio.
|
22
|
+
nharm: int
|
23
|
+
- Number of harmonics
|
24
|
+
- Default: 0 => Only fundamental frequency (No harmonics)
|
25
|
+
|
26
|
+
Returns
|
27
|
+
-------
|
28
|
+
ndarray
|
29
|
+
- Syntesized audio.
|
30
|
+
sr
|
31
|
+
- Sampling rate of the synthesized audio
|
32
|
+
"""
|
33
|
+
|
34
|
+
# Create new time axis
|
35
|
+
t = np.arange(0, f0t[-1], 1 / sr)
|
36
|
+
|
37
|
+
# Interpolate the f0 to match the sampling time points
|
38
|
+
f0_interp = np.interp(t, f0t, f0)
|
39
|
+
|
40
|
+
# Compute phase by integrating frequency over time
|
41
|
+
phase = 2 * np.pi * np.cumsum(f0_interp) / sr
|
42
|
+
|
43
|
+
# Start with fundamental
|
44
|
+
y = np.sin(phase)
|
45
|
+
|
46
|
+
# Add harmonics if requested
|
47
|
+
for n in range(2, nharm + 2): # from 2nd to (nharm+1)th harmonic
|
48
|
+
y += np.sin(n * phase) / n**2 # dividing by n to reduce harmonic amplitude
|
49
|
+
|
50
|
+
# Normalize output to avoid clipping
|
51
|
+
y /= np.max(np.abs(y))
|
52
|
+
|
53
|
+
return y, sr
|
@@ -1,10 +1,10 @@
|
|
1
1
|
LICENSE.md,sha256=JTaXAjx5awk76VArKCx5dUW8vmLEWsL_ZlR7-umaHbA,1078
|
2
2
|
README.md,sha256=Ybe2rcDecfSCiUpec2n7btQvgyi4R9JG0bfdwSWijWk,981
|
3
|
-
modusa-0.4.
|
4
|
-
modusa-0.4.
|
5
|
-
modusa-0.4.
|
6
|
-
modusa-0.4.
|
7
|
-
modusa/__init__.py,sha256=
|
3
|
+
modusa-0.4.28.dist-info/METADATA,sha256=SbjrOO2aDmiL4sber_0ROvDBgfc54nFeN11oa_Up76w,1442
|
4
|
+
modusa-0.4.28.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
|
5
|
+
modusa-0.4.28.dist-info/entry_points.txt,sha256=fmKpleVXj6CdaBVL14WoEy6xx7JQCs85jvzwTi3lePM,73
|
6
|
+
modusa-0.4.28.dist-info/licenses/LICENSE.md,sha256=JTaXAjx5awk76VArKCx5dUW8vmLEWsL_ZlR7-umaHbA,1078
|
7
|
+
modusa/__init__.py,sha256=m0Vh3SouHLacDwiiEV8oJ2ehpbETV8J6u-CqYAJws5E,359
|
8
8
|
modusa/config.py,sha256=bTqK4t00FZqERVITrxW_q284aDDJAa9aMSfFknfR-oU,280
|
9
9
|
modusa/decorators.py,sha256=8zeNX_wE37O6Vp0ysR4-WCZaEL8mq8dyCF_I5DHOzks,5905
|
10
10
|
modusa/devtools/generate_docs_source.py,sha256=UDflHsk-Yh9-3YJTVBzKL32y8hcxiRgAlFEBTMiDqwM,3301
|
@@ -42,7 +42,7 @@ modusa/models/t_ax.py,sha256=ZUhvZPUW1TkdZYuUd6Ucm-vsv0JqtZ9yEe3ab67Ma6w,8022
|
|
42
42
|
modusa/models/tds.py,sha256=FAGfibjyyE_lkEuQp-vSCuqQnopOjmy_IXqUjRlg9kc,11677
|
43
43
|
modusa/plugins/__init__.py,sha256=r1Bf5mnrVKRIwxboutY1iGzDy4EPQhqpk1kSW7iJj_Q,54
|
44
44
|
modusa/plugins/base.py,sha256=Bh_1Bja7fOymFsCgwhXDbV6ys3D8muNrPwrfDrG_G_A,2382
|
45
|
-
modusa/tools/__init__.py,sha256=
|
45
|
+
modusa/tools/__init__.py,sha256=YWbsQ40Pcu3Md2lNoKe4JnFtvpMGUVEwE92PoDkc6v4,371
|
46
46
|
modusa/tools/_plotter_old.py,sha256=KGow7mihA2H1WNq7s5bpivhCgGo2qVIeDaO6iabpsrg,19294
|
47
47
|
modusa/tools/ann_loader.py,sha256=m6Qu6jXnQ8LfUhKItoHSaHlGxUyzUJlGEyu4_50qJ8w,3099
|
48
48
|
modusa/tools/audio_converter.py,sha256=415qBoPm2sBIuBSI7m1XBKm0AbmVmPydIPPr-uO8D3c,1778
|
@@ -52,7 +52,8 @@ modusa/tools/audio_recorder.py,sha256=K_LGqsPdjTdf3figEZTSQLmgMzYWgz18HTO8C1j5fE
|
|
52
52
|
modusa/tools/audio_saver.py,sha256=ldzfr_AydsHTnKbxmBLJblN-hLzTmOlppOm306xI4Ug,510
|
53
53
|
modusa/tools/base.py,sha256=C0ESJ0mIfjjRlAkRbSetNtMoOfS6IrHBjexRp3l_Mh4,1293
|
54
54
|
modusa/tools/math_ops.py,sha256=ZZ7U4DgqT7cOeE7_Lzi_Qq-48WYfwR9_osbZwTmE9eg,8690
|
55
|
-
modusa/tools/plotter.py,sha256=
|
55
|
+
modusa/tools/plotter.py,sha256=QfF8kCi79nS-J5lQyEuH_BbAmTo-PdfjDbnK9yTAmRE,30863
|
56
|
+
modusa/tools/synth.py,sha256=-oaCQbz21ZaleIxJ4uZP-c8b9Wjrwhi33STDKu9uLDg,1202
|
56
57
|
modusa/tools/youtube_downloader.py,sha256=hB_X8-7nOHXOlxg6vv3wyhBLoAsWyomrULP6_uCQL7s,1698
|
57
58
|
modusa/utils/__init__.py,sha256=1oLL20yLB1GL9IbFiZD8OReDqiCpFr-yetIR6x1cNkI,23
|
58
59
|
modusa/utils/config.py,sha256=cuGbqbovx5WDQq5rw3hIKcv3CnE5NttjacSOWnP1yu4,576
|
@@ -60,5 +61,5 @@ modusa/utils/excp.py,sha256=L9vhaGjKpv9viJYdmC9n5ndmk2GVbUBuFyZyhAQZmWY,906
|
|
60
61
|
modusa/utils/logger.py,sha256=K0rsnObeNKCxlNeSnVnJeRhgfmob6riB2uyU7h3dDmA,571
|
61
62
|
modusa/utils/np_func_cat.py,sha256=TyIFgRc6bARRMDnZxlVURO5Z0I-GWhxRONYyIv-Vwxs,1007
|
62
63
|
modusa/utils/plot.py,sha256=s_vNdxvKfwxEngvJPgrF1PcmxZNnNaaXPViHWjyjJ-c,5335
|
63
|
-
pyproject.toml,sha256=
|
64
|
-
modusa-0.4.
|
64
|
+
pyproject.toml,sha256=jsT7XGIUHSiP4RZosRROYMuLhngW6uHfTcwYtAgAZNw,1413
|
65
|
+
modusa-0.4.28.dist-info/RECORD,,
|
pyproject.toml
CHANGED
File without changes
|
File without changes
|
File without changes
|