Skip to main content

Generate Chladni plate resonant pattern signatures from WAV audio waveforms using Fourier peak frequency estimation

Project description

WAV → Fourier → Chladni Pattern

An interactive tool to analyze WAV audio files, perform discrete Fourier analysis to extract dominant peak frequencies, and map those peaks to physical resonant modes on a square Chladni vibrating plate.

For the mathematical background of plate vibration models, see this paper on Chladni Plates.

Project Structure

  • voca-spectral.py — The main interactive Python pipeline script (3-step TUI: input selection, Fourier peak analysis, and visualizer exporting).
  • fourier_analysis.html — Dynamic HTML report template displaying audio waveform and FFT spectrum charts (Chart.js).
  • chladni_simulator.html — Interactive 2D vibrating plate simulator displaying nodal sand patterns corresponding to the wave equation.
  • fourier_transform_analysis.md — Document summarizing Fourier transform calculations and eigenvalue mapping.

Features

  • WAV Audio Analysis — Parse 16-bit PCM mono WAV waveforms and compute dominant peak frequencies using discrete Fourier analysis.
  • Mac-Native UI Dialogs — Native macOS file picker window dialogs (osascript) for importing audio and selecting export folders, with terminal fallback prompts for Windows/Linux.
  • Immediate Validation — Immediate WAV format parsing and corruption checks during step 1 before starting computation.
  • Vector SVG Exports — Generate resolution-independent SVG designs of the resulting nodal sand patterns for graphic/branding usage.
  • Portable Web Visualizers — Export standalone HTML dashboards to inspect audio waveforms, FFT spectra, and simulated 2D plate nodal lines.
  • Zero External Python Dependencies — Built entirely on the standard Python library (no numpy/scipy/matplotlib required to run the core script).

Advanced Wave Mechanics

This project models Chladni sand patterns using Cartesian standing wave solutions of the multi-dimensional wave equation.

The Cartesian Wave Equation

For a square vibrating plate $\Omega = {(x,y) \in \mathbb{R}^2 \mid -L \le x, y \le L}$, the displacement $u(x, y, t)$ is modeled by:

$$u_{tt} = c^2\nabla^2u = c^2\left(\frac{\partial^2u}{\partial x^2} + \frac{\partial^2u}{\partial y^2}\right)$$

Assuming clamped boundary conditions at the edges, the standing wave solutions (eigenmodes) can be approximated by:

$$u(x, y, t) = \sum_{n=1}^{\infty}\sum_{m=1}^{\infty} w_{nm} \cdot \left(\sin\left(\frac{n\pi x}{L}\right)\sin\left(\frac{m\pi y}{L}\right) + \beta\sin\left(\frac{m\pi x}{L}\right)\sin\left(\frac{n\pi y}{L}\right)\right)\cos(\omega_{nm} t)$$

Where:

  • $n, m$ are the integer mode parameters (eigenvalues).
  • $w_{nm}$ is the weight of each mode, mapped directly from the dominant audio frequency amplitudes computed via Fourier analysis.
  • $\beta$ is the symmetry factor (typically $\pm 1$ for square plates).
  • The sand particles accumulate at the nodal lines where the plate displacement is zero, i.e., $u(x,y,t) \approx 0$.

Installation & Running

Since the core pipeline runs entirely on the Python standard library, there are no third-party Python libraries to install.

1. Install via pip

You can install the package directly as a global CLI tool from the repository folder:

pip install .

Once installed, you can launch the pipeline from anywhere using the global command:

wav-fourier-chladni

2. Alternative: Run the source script directly

If you do not want to install it globally, you can execute the script directly from the source directory:

python3 wav_fourier_chladni/cli.py

3. Prerequisites (Optional)

To run the core analysis and visualizers, you only need Python 3 installed.

If you wish to use the live microphone recording feature:

  • macOS: brew install sox or ensure ffmpeg is in your system path.
  • Linux: sudo apt install alsa-utils (for arecord) or sox.

The script will guide you through:

  1. Audio Selection: Pick a WAV file using a native macOS window picker or record live from the microphone.
  2. Analysis: Performs the discrete Fourier calculations.
  3. Resonant Signatures: Renders an ASCII art preview of the pattern in the terminal, and lets you choose to export SVG files or HTML dashboards.

🤝 Contributing

Got ideas? Found a bug?

PRs and issues are very welcome! This is a community tool and it gets better when more people chip in. Even small improvements — better selectors, new step actions, docs fixes — make a real difference.

Open an issue or just submit a PR. Let's build it together. 🙌


📄 License

MIT


Built by Ganidhu and Baymax

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

wav_fourier_chladni-1.0.0.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

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

wav_fourier_chladni-1.0.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wav_fourier_chladni-1.0.0.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for wav_fourier_chladni-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a96c05a5685e22716a26ce56a62a63e9d164d0ba9c92444fd41c67ac12540baf
MD5 d885e33868433ef2d8a56e9a87333f7c
BLAKE2b-256 5ec2340e5a7ecef5480e0f224efc4ed7cbf45ab7a34b094ab5c925af479338b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wav_fourier_chladni-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06f0b2825421cafc104527d3226e53c0f0e95e1c979a0a6bc5414b655bbe7cef
MD5 df46e48b1c3ca32937db49b01c428dc4
BLAKE2b-256 ec34a98fe0ad309997f38be79cac8993e2554106633c4cfc0ef7246edaaf84bd

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