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()
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")
Next Steps¶
- Check out various applications in the Cookbook
- Look up detailed functions in the API Reference
- Understand the library's design philosophy in the Theory Background
Recipes by Use Case¶
This section provides links to tutorial notebooks that demonstrate more detailed features and application examples of the Wandas library.
- 00_setup.ipynb: Setup and basic configuration
- 01_io_basics.ipynb: File reading/writing and basic operations
- 02_signal_processing_basics.ipynb: Basic signal processing
- 03_visualization.ipynb: Data visualization
- 04_time_frequency.ipynb: Time-frequency analysis
- 05_lazy_and_dask.ipynb: Lazy evaluation and large-scale data processing with Dask
- 06_metadata_history.ipynb: Utilizing metadata and processing history
- 07_batch_processing.ipynb: Batch processing for multiple files
- 08_extending_api.ipynb: Adding custom functions and extending the API
- 08_interoperability.ipynb: Integration with other libraries
- 09_case_studies.ipynb: Practical use case studies
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.