Author: heychandur
Language: MATLAB
Current version: V0.5
Offline audio-file noise reduction using an STFT-based Wiener-filter pipeline. The project evolves from basic audio inspection to configurable noise reduction with preview, refilter, and save controls.
Scope: This project processes a recorded audio file. It is not real-time active noise cancellation with a separate reference microphone.
- Load supported audio files with MATLAB's
audioread. - Convert multichannel input to mono and remove DC offset.
- Apply a 55 Hz high-pass filter and optional 50 Hz mains-hum harmonic notch filters.
- Estimate a noise profile from the first five seconds of the current input.
- Apply STFT-based Wiener filtering, gain smoothing, spectral gating, level correction, and peak protection.
- Play the input and filtered output in sequence before asking what to do.
- Choose Save, Refilter, or Cancel after preview.
- Refilter the most recently processed output, not the original recording.
- Display waveform and spectrogram comparisons.
- Prevent saving over the selected source file.
- MATLAB with Signal Processing Toolbox functions used by the scripts, including
butter,filtfilt,stft,istft,hamming, andspectrogram. - An audio recording supported by MATLAB's
audioread. - For V0.5's default settings, an input of at least five seconds.
- Clone or download this repository.
- Open MATLAB and set the Current Folder to
src/v0.5-configurable-noise-profile. - Run
v05_wiener_noise_reduction.m. - Select the noisy audio file.
- Listen to the original and processed previews.
- Choose Save to export the result, Refilter to run another pass, or Cancel to exit without saving.
The save dialog supports WAV and MP3 choices; actual encoding support depends on the MATLAB version and system. WAV is a good default for compatibility.
- Read and validate the selected recording.
- Convert the input to mono and remove its mean.
- Apply high-pass filtering and optional mains-hum notch filters.
- Estimate noise from the first five seconds of the current pass.
- Apply the STFT-based Wiener gain and spectral gate.
- Reconstruct the output, apply limited level correction, and prevent excessive peaks.
- Play the comparison, then save, refilter, or cancel.
- The first five seconds are used as the noise estimate and should contain mostly background noise. Speech or music in this segment may be suppressed.
- Repeated refiltering can damage desired audio. Listen to each pass before saving.
- Stereo input is reduced to mono, so stereo spatial information is not retained.
- Lower output volume alone does not prove better noise reduction. Evaluate both by listening and, where possible, against a clean reference.
- Performance has not been claimed as validated on every MATLAB release. Run the script in your target MATLAB environment.
.
├── docs/
│ └── version-history.md
├── src/
│ ├── v0.1-basic-audio/
│ ├── v0.2-noise-analysis/
│ ├── v0.3-wiener-filter/
│ ├── v0.4-preview-refilter-save/
│ └── v0.5-configurable-noise-profile/
├── .gitignore
├── LICENSE
├── README.md
└── VERSION.md
See VERSION.md for the current version and docs/version-history.md for the milestone-by-milestone history.
heychandur — GitHub profile
