This repository contains a Jupyter Notebook (ee200_231035(2).ipynb) that demonstrates practical applications of signal processing in two distinct domains: Image Processing and Audio Signal Processing.
The project applies Fourier Transforms, filter design, and spectral analysis to manipulate media files programmatically.
The notebook is divided into two main sections:
This section creates a "Hybrid Image"βan optical illusion that looks like one object from up close and another from far away.
- Technique: Uses 2D Fast Fourier Transforms (FFT) to manipulate spatial frequencies.
- Process:
- Low-pass filter: Applied to the "Dog" image to retain only low frequencies (smooth, blurry shapes).
- High-pass filter: Applied to the "Cat" image to retain only high frequencies (sharp details/edges).
- Combination: The frequency domains are merged and converted back to the spatial domain using inverse FFT.
- Result: A hybrid image where the "Dog" appears from a distance, and the "Cat" appears when viewed closely.
This section processes a mixed audio track to isolate a specific instrument (Saxophone) using digital filtering.
- Technique: Bandpass filtering using
scipy.signal. - Process:
- Input: Reads a WAV file (
song_with_2piccolo.wav). - Filter Design: Implements a 4th-order Butterworth bandpass filter with cutoff frequencies at 1150 Hz and 1800 Hz to target the saxophone's frequency range.
- Spectral Analysis:
- Plots the Power Spectral Density (PSD) to compare original vs. filtered signals.
- Generates a Bode Plot to visualize the filter's frequency response.
- Creates a Pole-Zero Plot for stability analysis.
- Displays a Spectrogram to visualize frequency changes over time.
- Input: Reads a WAV file (
- Output: Saves the filtered audio as
saxophone_only.wav.
To run this notebook, you will need the following Python libraries:
numpy
matplotlib
scipy
PillowYou can install them using pip:
pip install numpy matplotlib scipy Pillow- Clone the repository:
git clone https://github.com/sriramd23/EE200-course-project.git
- Add Input Files:
Ensure the following files are in the same directory as the notebook:
cat_gray.jpg(High-frequency source)dog_gray.jpg(Low-frequency source)song_with_2piccolo.wav(Audio source)
- Run the Notebook:
Open
ee200_231035(2).ipynbin Jupyter Notebook or Google Colab and run all cells.
The notebook generates the following outputs:
- Visualizations:
- Hybrid Image and Frequency Spectra.
- PSD Comparison Plot (
psd_comparison.png). - Bode Plot (
bode_plot.png). - Pole-Zero Plot (
pole_zero_plot.png). - Spectrogram (
spectrogram.png).
- Audio:
saxophone_only.wav: The processed audio file containing the isolated instrument.
sriram dhanasekaran Course: EE200