Skip to main content

SpectralAudit

PyPI Python CI License: Apache-2.0

Inspect unusual frequency patterns in music — offline, deterministically, without AI models.

SpectralAudit is an open-source Python library by Eduardo J. Barrios. It measures high-frequency energy, abrupt spectral cutoffs and narrow, periodically spaced peaks that persist across song excerpts. Research links some periodic spectral artifacts to music-generation architectures including ones evaluated on Suno and Udio [1]. SpectralAudit implements independent DSP heuristics, not a published detector or a verified Suno-specific signature.

Not proof of AI origin. A matching pattern does not establish that a song was generated by Suno, Udio or any other model. Instruments, synthesizers, EQ, compression and resampling can produce or obscure similar features. No AI-generation probability is returned.

Install

Python 3.11+:

pip install -U spectralaudit

Quick start

Analyze a WAV or FLAC file; export JSON, Markdown or plain text:

# Default output: readable text in the terminal
spectralaudit fingerprint song.wav
# Choose one output format:
spectralaudit analyze song.wav --json report.json
spectralaudit analyze song.wav --markdown report.md
spectralaudit analyze song.wav --text report.txt

Inspect only the persistent spectral fingerprint (5–16 kHz by default):

spectralaudit fingerprint song.wav --json fingerprint.json

Other available commands:

spectralaudit spectrum song.wav
spectralaudit batch ./songs --json batch.json

Python API:

from spectralaudit import analyze, analyze_fingerprint, load_audio

report = analyze("song.wav")
pattern = report.findings["synthetic_patterns"]
print(pattern["candidate_pattern"])
print(pattern["estimated_spacing_hz"])
print(pattern["persistence_fraction"])
print(pattern["interpretation"])
report.to_json("report.json")
report.to_markdown("report.md")
report.to_text("report.txt")

audio = load_audio("song.wav")
custom = analyze_fingerprint(audio.mono, audio.rate, low_hz=5000, high_hz=16000)

What does it measure?

  • Band power and cutoff: Welch PSD, high-frequency ratios and possible rolloffs, respecting Nyquist.
  • Persistent peak patterns: spectral-envelope residuals, peak frequencies and spacing, autocorrelation in frequency, and support from consecutive time windows.
  • Possible alternative causes: limited bandwidth, filtering, clipping, harmonics.
  • Auditable output: JSON, Markdown and plain text with the complete numerical evidence; no HTML reports. No network connection, LLM, classifier or pretrained model.

candidate_pattern=true means only that the recording satisfies experimental DSP thresholds. It does not certify AI authorship. No real-world Suno-versus-human sensitivity/specificity benchmark has yet been established for SpectralAudit. See methods, limitations, and validation.

Reproducible example

A real synthetic test WAV is committed to this repository. It is generated by conventional Python DSP, not by Suno or another AI system:

spectralaudit fingerprint examples/assets/synthetic_spectral_comb.wav --json report.json

Actual numerical output from the included synthetic file:

candidate_pattern: true
peak_count: 21
estimated_spacing_hz: 441.43
persistence_fraction: 1.0
origin_attribution: not_supported

Its generator intentionally adds tones spaced 440 Hz apart over deterministic noise. Finding those peaks verifies the measurement algorithm, not real-world detection accuracy on Suno or human music.

Stereo improvement (v0.3): if channel averaging would nearly cancel opposite-phase audio, the analyzer uses the strongest channel and records this choice in analysis_signal.

Scientific references

These works motivated development. SpectralAudit does not claim to reproduce their detectors or reported accuracy.

  1. Afchar, D., Meseguer-Brocal, G., Akesbi, K., & Hennequin, R. (2025). A Fourier Explanation of AI-music Artifacts. ISMIR 2025, 739–746. DOI: 10.5281/zenodo.17811475. Architectural periodicity and empirical examples using Suno and Udio.
  2. Cros Vila, L., Sturm, B. L. T., Casini, L., & Dalmazzo, D. (2025). The AI Music Arms Race: On the Detection of AI-Generated Music. Transactions of the International Society for Music Information Retrieval, 8(1). DOI: 10.5334/tismir.254. Robustness and technical confounders.
  3. Dugelay, E., Barand, T., Campeas, B., Laouar, A., Afchar, D., & Hennequin, R. (2026). Improved Robustness in AI-Generated Music Detection. arXiv:2607.27454. Spectral sensitivity to speed and pitch transformations.
  4. Welch, P. D. (1967). The Use of Fast Fourier Transform for the Estimation of Power Spectra. IEEE Transactions on Audio and Electroacoustics, 15(2), 70–73. DOI: 10.1109/TAU.1967.1161901. PSD estimation.
  5. Harris, F. J. (1978). On the use of windows for harmonic analysis with the discrete Fourier transform. Proceedings of the IEEE, 66(1), 51–83. DOI: 10.1109/PROC.1978.10837. Spectral windows.

Full bibliography, implementation independence and licensing caveats: REFERENCES.md.

Author, citation and license

Copyright © 2026 Eduardo J. Barrios. Licensed under the open-source Apache License 2.0; see NOTICE.

Research users: please cite Eduardo J. Barrios and the exact software version. GitHub provides citation metadata in CITATION.cff; see CITING.md. Academic citation is requested, not an additional Apache-2.0 restriction.

Metadata

Release files for spectralaudit 0.3.0

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

Source distribution (sdist)

Source distribution for spectralaudit 0.3.0
File Size Uploaded Provenance Actions
spectralaudit-0.3.0.tar.gz 501.2 kB With provenance Details for spectralaudit-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 523.7 kB

Release files / spectralaudit-0.3.0.tar.gz

Download URL spectralaudit-0.3.0.tar.gz
Size 501.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5cfc46b4cccac870e353e2f5a578b232b1391b2535a4ac81d14e8149c8bd174b
BLAKE2b-256 checksum
How to use checksums
cfe54fffc0591804114ca7587022829ab5083d35391842e80cc568383cb27138
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / spectralaudit-0.3.0-py3-none-any.whl

Download URL spectralaudit-0.3.0-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18f6d28d65fe6fe6ca1d2f34e5fe448cfd5b494818d26d2bd8c87af5c84a4ae0
BLAKE2b-256 checksum
How to use checksums
170095000dad9c20f470ec0dc9836d689254127ba568b1f5368f0ccc97507439
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Security for spectralaudit 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for spectralaudit-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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