Skip to main content

SpectroMap is a peak detection algorithm that computes the constellation map for a given signal

Project description

SpectroMap

SpectroMap is a peak detection algorithm that computes the constellation map (or audio fingerprint) of a given signal.

Installation

You can install the SpectroMap library from GitHub:

git clone https://github.com/Aaron-AALG/spectromap.git
python3 -m pip install -e spectromap

You can also install it directly from PyPI:

pip install spectromap

Usage

This packages contains the spectromap object that manages the full process of audio fingerprinting extraction. Given a signal Y, we just have to instantiate the class with Y and the corresponding kwargs (if needed).

spectrogram object

An example to apply SpectroMap over a signal is:

import numpy as np
from spectromap.functions.spectromap import spectromap

y = np.random.rand(44100)
kwargs = {'fs': 22050, 'nfft': 512, 'noverlap':64}

# Instantiate the SpectroMap object
SMap = spectromap(y, **kwargs)

# Get the spectrogram representation plus its time and frequency bands
f, t, S = SMap.get_spectrogram()

# Extract the topological prominent elements from the spectrogram, known as "Peak detection".
# We get the coordinates (time, freq) of the peaks and the matrix with just these peaks.
fraction = 0.15 # Fraction of spectrogram to compute local comparisons
condition = 2   # Axis to analyze (0: Time, 1: Frequency, 2: Time+Frequency)
id_peaks, peaks = SMap.peak_matrix(fraction, condition)

# Get the peaks coordinates as as (s, Hz, dB)-array.
extraction_t_f_dB = SMap.from_peaks_to_array()

peak_search function

In case you desire to compute the spectrogram by yourself, then you can make use of the peak search function instead.

from spectromap.functions.spectromap import peak_search

fraction = 0.05 # Fraction of spectrogram to compute local comparisons
condition = 2   # Axis to analyze (0: Time, 1: Frequency, 2: Time+Frequency)
id_peaks, peaks = peak_search(spectrogram, fraction, condition)

Cite this work

If you use SpectroMap in your research I would appreciate a citation to the following paper:

@misc{https://doi.org/10.48550/arxiv.2211.00982,
doi = {10.48550/ARXIV.2211.00982},
url = {https://arxiv.org/abs/2211.00982},
author = {López-García, Aarón},
title = {SpectroMap: Peak detection algorithm for audio fingerprinting},
publisher = {arXiv},
year = {2022},
copyright = {Creative Commons Attribution 4.0 International}
}

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

SpectroMap-1.0.2.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

SpectroMap-1.0.2-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: SpectroMap-1.0.2.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for SpectroMap-1.0.2.tar.gz
Algorithm Hash digest
SHA256 94b723ed9c89a941d4e4ddf98c185b79c57674086368048c02e18ebe9e5f4e8c
MD5 0c8f6511f26e5611bdc7055ccd5a4062
BLAKE2b-256 1e5e6e911d18e742bc8bf6d40a709b46ad5de30441a7b2c4d0080fe6613f1137

See more details on using hashes here.

File details

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

File metadata

  • Download URL: SpectroMap-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for SpectroMap-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 55caefa09ca36d2de06df11789260bb512bda0f50e0cc7af0974a002a82a7283
MD5 9546d26e91e5916dcb276f64b2841f33
BLAKE2b-256 0a1913598b8d93658d6d8f20c601bfa7261ae723b061fbe6fc6ed2673747b505

See more details on using hashes here.

Supported by

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