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.0.tar.gz (25.0 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.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spectral_sound_analysis-1.0.0.tar.gz
  • Upload date:
  • Size: 25.0 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.0.tar.gz
Algorithm Hash digest
SHA256 19bcd8e6f600739cbca1de883f2566dd54ca83836be4d6003e98a446d68e13a4
MD5 e723819dac89e8e665c1a7a2b68c2918
BLAKE2b-256 d91e6b3fee2e2d4f21ad561ec54e0e52beac664d509cad38ff8671d8e9895aa4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spectral_sound_analysis-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73303b15aa4835bf2be8067312fe2b923b75565988b61b7f7e3b823a6007f2bd
MD5 5beaff6f7f8d3d87d56d3a7c4638c360
BLAKE2b-256 f14ae716a54cb1b111e5903ab0204893f1d3e068c2d05dc2e66ed0285b7fecb1

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