Skip to main content

RhythmoScope - Speech Rhythm Modulation Spectrum

RhythmoScope is a Python library for automatic speech rhythm modelisation. This project rely on the Envelope Modulation Spectrum (EMS) for analysing the main regularities of speech at different levels. This library is the result of my PhD thesis under the supervision of Corine Astésano and Jérôme Farinas.

🛠 Installation

Rhythmoscope should work with Python 3.9 and above. The library can be installed through the following pip command:

pip install rhythmoscope

🔬 Basic usage

EMS

As an example, we'll extract and plot the EMS of a speech signal from a .wav file (examples wav files can be found in /examples/audios):

from rhythmoscope.ems import EMSExtractor
from rhythmoscope.envelope import LowPassEnvelope

Envelope = LowPassEnvelope(cut_frequency=10, order=3, initial_bandpass=(300, 1000)) # Define envelope extractor
Extractor = EMSExtractor(Envelope=Envelope, min_freq=0, max_freq=10) # Define EMS extractor parameters

EMS = Extractor.from_file("example.wav", start=0, end=4) # Extract EMS on the first 4 seconds of the audio

fig = EMS.plot()
fig.show()

It produce the following output which represent the Envelope Modulation Spectrum of a signal (examples wav files can be found in /examples/audios):

EMS_example

Rhythm spectrogram

from rhythmoscope.ems import EMSExtractor
from rhythmoscope.signal import RollingWindow
from rhythmoscope.spectrogram import RhythmSpectrogramExtractor

EMS = EMSExtractor(min_freq=0, max_freq=15) # Define EMS extractor parameters
Window = RollingWindow(window_size=3, hop_size=0.5) # Define parameters of the spectrogram rolling window (in seconds)

SpectroExtract = RhythmSpectrogramExtractor(EMS, Window) # Define Spectrogram extractore parameters
spectrogram = SpectroExtract.from_file("count.wav") # Extract spectrogram

fig = spectrogram.plot()
fig.show()

It produce the following output which represent the Rhythm Spectrogram of a signal:

Spectrogram_example

Each red line correspond to a regular rhythm at a given time. The rhythmic evolution in this example comes from the fact that the words spoken are mono-syllabic in the first half and bi-syllabic in the second.

🔗 Related work

💬 Citation

If RhythmoScope has been useful to you, and you would like to cite, please refer to my PhD thesis:

@phdthesis{vaysse2023thesis,
  TITLE = {{Caract{\'e}risation automatique du rythme de la parole : application aux cancers des voies a{\'e}ro-digestives sup{\'e}rieures et {\`a} la maladie de Parkinson}},
  AUTHOR = {Vaysse, Robin},
  URL = {https://theses.hal.science/tel-04198849},
  NUMBER = {2023TOU30062},
  SCHOOL = {{Universit{\'e} Paul Sabatier - Toulouse III}},
  YEAR = {2023},
  MONTH = Mar,
  TYPE = {Theses},
  PDF = {https://theses.hal.science/tel-04198849/file/2023TOU30062b.pdf},
  HAL_ID = {tel-04198849},
  HAL_VERSION = {v1},
}

📝 License

RhythmoScope is a free and open-source software licensed under the 3-clause BSD license.

Release files for rhythmoscope 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rhythmoscope 0.1.1
File Size Uploaded
rhythmoscope-0.1.1.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rhythmoscope 0.1.1
File Interpreter ABI Platform
rhythmoscope-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 27.5 kB

Release files / rhythmoscope-0.1.1.tar.gz

Download URL rhythmoscope-0.1.1.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
807cf16b4f77d83eecbbb754f67df8bcb09969faf424a5cf4f807b4f1b853e25
BLAKE2b-256 checksum
How to use checksums
7abb6ed3acc932befcafec2ecea7bcef53c3a4120f549a0fd1bc6dc6e4e9db78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Linux/6.5.0-35-generic

Release files / rhythmoscope-0.1.1-py3-none-any.whl

Download URL rhythmoscope-0.1.1-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a983451446c8d2bea2c35ff01ae9210bf89a036ca9371220c139d206069a7f8
BLAKE2b-256 checksum
How to use checksums
621afedad808d7c66d6ed60b54a7be164807d9cedb9cde1afd3d25bfbbb11c7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.9 Linux/6.5.0-35-generic

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page