Skip to content

Tutorial

This tutorial will teach you the basics of the Wandas library in 5 minutes.

Installation

pip install git+https://github.com/endolith/waveform-analysis.git@master
pip install wandas

Basic Usage

1. Import the Library

import wandas as wd

2. Load Audio Files

# Load a WAV file
url = "https://github.com/kasahart/wandas/raw/main/examples/data/summer_streets1.wav"

audio = wd.read_wav(url)
print(f"Sampling rate: {audio.sampling_rate} Hz")
print(f"Number of channels: {len(audio)}")
print(f"Duration: {audio.duration} s")

Sampling rate: 44100 Hz
Number of channels: 2
Duration: 15.0 s

3. Visualize Signals

# Display waveform
audio.describe()
2025-10-15T18:38:25.516360 image/svg+xml Matplotlib v3.10.0, https://matplotlib.org/

4. Basic Signal Processing

# Apply a low-pass filter (passing frequencies below 1kHz)
filtered = audio.low_pass_filter(cutoff=1000)

# Visualize and compare results
filtered.previous.plot(title="Original")
filtered.plot(title="filtered")
2025-10-15T18:38:26.722304 image/svg+xml Matplotlib v3.10.0, https://matplotlib.org/ 2025-10-15T18:38:27.328925 image/svg+xml Matplotlib v3.10.0, https://matplotlib.org/

Next Steps

Recipes by Use Case

This section provides links to tutorial notebooks that demonstrate more detailed features and application examples of the Wandas library.

Hint

Each notebook focuses on a specific topic. Refer to them sequentially or as needed based on your interests. For basic usage of Wandas, please also see the "Basic Usage" section at the beginning of this document.