Collection of Python scripts for advanced audio processing, including EQ gain application and custom noise generation for simulated aircraft.
This repository contains three Python scripts to assist in audio processing:
-
headset-filter.py: This script applies EQ gains to an input WAV file and writes the processed audio to an output file. It can work with both mono and stereo files. It uses Fast Fourier Transform (FFT) to transform the audio data to the frequency domain, applies the EQ gains, and uses Inverse FFT to transform the data back to the time domain. -
generate_noise.py: Advanced noise generator that creates perceptually realistic aircraft noise by matching:- Spectral envelope (via STFT)
- Temporal modulation per frequency band
- Higher-order statistics (kurtosis) for transient realism
- Power Spectral Density (PSD) with smoothed fine-tuning
- Loudness (RMS + true peak limiting)
The output can be filtered with the Bose Aviation Headset X EQ curve to simulate what a pilot hears. Supports mono/stereo, quality tiers (
low,medium,high), and reproducible output via--seed. -
split_stereo_wav.py: This script takes a stereo WAV file as input and splits it into two separate WAV files, one for the left channel and one for the right channel.
python3 headset-filter.py <input_file> <output_file>input_file: The input wav file.output_file: The output wav file. Default isoutput.wav.
python3 generate_noise.py <input_file> [-o output_file] [-l length] [-f] [-q quality] [-s seed]input_file: Path to the input WAV file.-o, --output_file: Path to the output WAV file. Default isoutput.wav.-l, --length: Desired length of the processed audio in seconds. Default is 15.-f, --filter: Apply Bose Aviation Headset X filter to the output.-q, --quality: STFT quality:low,medium,high. Default ishigh.-s, --seed: Random seed for reproducible noise generation.
python3 split_stereo_wav.py <input_file.wav>input_file.wav: The stereo input wav file.- The script will create two files named
<input_file>-left.wavand<input_file>-right.wavin the same directory as the input file.
All scripts require Python 3 and the following Python packages:
| Script | Required Packages |
|---|---|
generate_noise.py |
numpy, scipy |
headset-filter.py |
numpy, scipy |
split_stereo_wav.py |
pydub |
# Core scientific packages (for generate_noise.py and headset-filter.py)
pip3 install numpy scipy# Audio manipulation (for split_stereo_wav.py)
pip3 install pydubNote: pydub requires ffmpeg for WAV handling. Install it via your system package manager:
# macOS (with Homebrew)
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpegThe EQ gains used in the scripts are based on the Bose Aviation Headset X. You can modify these values as per your requirement.