Welcome to the Audio Filtering Project, where we explore the magic of audio signal processing! This project demonstrates the impact of various filters—low-pass, high-pass, band-pass, band-stop, peak, and notch—on different audio signals. The MATLAB scripts provided allow you to add noise to your audio tracks, create custom audio files, and apply filters to manipulate frequency components.
We use a tenth-order Butterworth filter to achieve high-quality filtering and utilize a bilinear transform for implementing the band-stop filter. Additionally, a new script enables the generation of custom audio signals with user-defined types, frequencies, and durations. This project provides a hands-on tool to analyze and compare the sound before and after filtering, showcasing both time-domain and frequency-domain effects.
- Visualize & Hear: Apply and hear the effects of six different filters on audio signals.
- Frequency Domain Exploration: Understand how these filters impact the frequency spectrum and the time-domain representation.
- Compare Audios: Perform in-depth comparisons between filtered and original audio to understand the filtering behavior.
Here's a breakdown of the directory structure for easy navigation:
audio-signal-processing-and-filtering
│
├── README.md # Project documentation (this file)
├── LICENSE # License information
├── multiple_filters.m # MATLAB script for applying multiple filters
├── add_noise_to_audio.m # MATLAB script to add noise to audio files
├── custom_audio.m # MATLAB script for generating custom audio signals
└── audio # Directory containing audio files
├── Harpsichord_Melody.mp3 # Original harpsichord melody
├── JazzTrio.wav # Original jazz trio audio file
├── JazzTrioNoisy.wav # Noisy version of JazzTrio.wav
├── White_Noise.wav # White noise audio sample
To run this project, you will need:
- MATLAB
- Audio Processing Toolbox
- Signal Processing Toolbox
Script: add_noise_to_audio.m
This script lets you add noise to an audio file, producing interesting new variants for filtering! The noise consists of sinusoidal signals of user-specified frequencies.
- Example: Noise is added to the
JazzTrio.wavfile to generateJazzTrioNoisy.wav.
Script: custom_audio.m
Once noise has been added to the audio, create a custom audio file with specified signal type, frequency, and duration. This step is crucial for generating tailored audio inputs for further filtering.
Script: multiple_filters.m
Apply one of the six filters to an audio file: low-pass, high-pass, band-pass, band-stop, peak, or notch. Customize the filter settings and analyze the results through comprehensive visualization.
- Audio Selection: Choose from various audio files such as
White_Noise.wav,Harpsichord_Melody.mp3, orJazzTrioNoisy.wav. - Filter Type: Select one of the following filters:
- Low-Pass Filter: Passes frequencies below a cutoff frequency.
- High-Pass Filter: Passes frequencies above a cutoff frequency.
- Band-Pass Filter: Passes frequencies within a specified range.
- Band-Stop Filter: Attenuates frequencies within a specific range.
- Peak Filter: Boosts frequencies around a central frequency.
- Notch Filter: Attenuates a narrow band of frequencies around a center frequency.
- Filter Design: The script designs a tenth-order Butterworth filter with specified frequency ranges.
- Analyze Results: View enhanced plots of the frequency response, power spectral density, and group delay. Additionally, hear both the original and filtered versions of the audio.
This project is licensed under the MIT License. For more details, see the LICENSE file.