Skip to main content

A Python package for performing spectral analysis, audio signal processing, and related computations.

Project description

Spectral Sound Analysis

License

This package is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

License

https://creativecommons.org/licenses/by-nc-nd/4.0/)


Overview

Spectral Sound Analysis is a Python package for performing spectral and harmonic analysis of audio signals. It provides tools for analyzing audio recordings, calculating spectral power, evaluating harmonic densities, and visualizing results. This package is designed for researchers, musicians, and engineers working in fields such as acoustics, musicology, and psychoacoustics.


Important Remarks

This package is designed to work exclusively with short audio files, each containing only a single musical note.

For optimal results:

  • Remove initial transients: Ensure the starting portion of the sound is removed to focus on the steady-state of the note.
  • Apply sound attenuation: Fade out the ending of the sound to avoid abrupt cuts.

Each audio file must include the note name and octave in its filename, enclosed in single quotes. Examples: Violin_'A4'.wav, Oboe_'Bb4'.mp3, Cello_'G#4'.aif.

Additional Tools

In addition to the main package containing the essential Python modules, the following tools are provided to assist users in preparing audio files for analysis:

  • cut_fade.py: This script allows automatic processing of audio files by:

    • Removing silence;
    • Applying fade-in and fade-out effects;
    • Defining the intended sound length;
    • Converting audio modes (stereo to mono or vice versa).
    • Supported formats: .WAV, .AIF, .AIFF, .MP3;
    • Supported bit depths: 16-bit, 24-bit, 32-bit, 64-bit.
  • comma_create.py: This script automatically adds single quotes (') around note names in audio file names for compatibility with the package requirements.


Features

  • FFT Analysis: Extract spectral features from audio signals.
  • Spectral Power Computation: Visualize the power of spectral components.
  • Harmonic Analysis: Detect fundamental frequencies and harmonics.
  • Density Metrics: Evaluate harmonic densities with customizable weighting functions.
  • Batch Processing: Compile results from multiple audio files into Excel reports.
  • Visualization: Generate 2D and 3D spectrograms and plots.
  • Supported Audio Formats: .wav, .mp3, .flac, .aif, .aiff.

Installation

For developers, you can install the package in editable mode using:

pip install -e .

---
##Requirements
This package requires the following Python libraries:

numpy
scipy
matplotlib
pandas
librosa
PyQt5
Dependencies will be automatically installed when you install the package.
Requires Python 3.8 or higher.

---

##Acknowledgments

This work was funded by:
Foundation for Science and Technology (FCT) - Portugal
Under the DOI 10.54499/2020.08817.BD 8D 
(https://doi.org/10.54499/2020.08817.BD) 


And also supported by:

Universidade NOVA de Lisboa
Centre for the Study of Sociology and Musical Aesthetics (CESEM)
Contemporary Music Group Investigation (GIMC)
In2Past

---

Contributing
At the moment, contributions are not accepted as the project is under active development. Future versions may include guidelines for contributors.

---

Contact
If you have questions or feedback, feel free to reach out to the author:

---

Author: Luis Miguel da Luz Raimundo
ORCID Profile: https://orcid.org/0000-0003-1712-6358


Email Addresses:
lmr.2020@gmail.com
luisraimundo@fcsh.unl.pt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spectral_sound_analysis-1.0.2.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spectral_sound_analysis-1.0.2-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file spectral_sound_analysis-1.0.2.tar.gz.

File metadata

  • Download URL: spectral_sound_analysis-1.0.2.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.0

File hashes

Hashes for spectral_sound_analysis-1.0.2.tar.gz
Algorithm Hash digest
SHA256 255ba105479a51de0b36229af2f45f2dcdeac7a7a35acce4294d2636e7cee66e
MD5 3c52445c6ed805fca5c35d0d603e7990
BLAKE2b-256 68bef76f1be86df72d79e3737f1b587023792d1239a3cbb9484a64c922315b8c

See more details on using hashes here.

File details

Details for the file spectral_sound_analysis-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for spectral_sound_analysis-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 02d0b095d18043af7147e6564a91b8e9c730b7a0d8b725a38d21582c266e7dd9
MD5 0b630bafd60a3e3700dba8f41799ba65
BLAKE2b-256 13c58df5417a16fafc0e0a2fc7169971182ec767083b233acf6970fd6490e9b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page