Group Activity Report
Group Activity Report
(MAT2001)
Winter Semester 2024-2025
Submitted by:
• Lakshya Sahu (23BAI10250)
• Pratham Kashyap (23BAI10455)
• Garv Anand (23BAI10605)
• Priyanshu Ranjan (23BAI10691)
• Shrish (23BAI11284)
Submitted to:
Dr. Sheerin Kayenat
Table of Content
S.no Topics
1. Introduction
• Objective
• Overview of Signal Processing and Image Compression
• Scope and Mathematical Applications
2. Libraries Used
• NumPy • Sounddevice
• Matplotlib • PIL
• SciPy • Scikit-learn
• Soundfile
3. Test Data
• Description of Audio Signals (Noisy, Impulse, Step)
• Description of Image Pattern
4. Data Preparation
• Generating Test Signals
• Creating the Test Image Pattern
5. Audio Filtering Module
• Filter Design (Lowpass, Highpass, Bandpass)
• Applying Digital Filters
7. Visualization
• Time and Frequency Domain Plots
• Original vs Compressed Image
8. Code Implementation
• Signal Generation Scripts
• Filtering and Compression Scripts
9. Results
• Filtered Audio Outputs
• Compressed Image and Ratio
10. Conclusion
• Summary of Observations
• Potential Improvements and Future Scope
Project Report: Multimodal Signal Processing and
Compression Using Python
Introduction
Ø Audio Signals:
Ø Image Pattern:
Ø The Audio Filtering Module processes signals like impulse, step, and noisy
waveforms using digital filters (low-pass, high-pass, band-pass) designed
with SciPy. The filtered results are visualized in both time and frequency
domains, showcasing noise reduction and signal clarity.
Ø The Image Compression Module uses PCA (Principal Component Analysis)
to reduce the dimensionality of image data. Each color channel is
compressed independently, retaining essential features while minimizing
file size.
Ø The Compression Ratio is computed by dividing the original image size by
the compressed size, highlighting the efficiency of the method.
Visualization
In the plot:
Ø 🔵 Blue Dots: Show the actual compressed pixel values against original
ones.
Ø 🔴 Red Line: Represents perfect reconstruction (ideal 1:1 mapping).
Ø The closer the dots are to the red line, the more accurate the compression.
This visualization helps assess how well the model captures the trend and
highlights the overall correlation between variables.
Digital Filters - Frequency and Time Domain Visualization
The plots demonstrate the effect of a low-pass filter on an audio signal in both
time and frequency domains.
This graph represents the analysis of a chirp signal, which is a signal in which the
frequency increases with time.
Ø Shows the frequency content after applying FFT (Fast Fourier Transform).
Ø Frequencies are spread across a wide band (up to ~8000 Hz), confirming a
wide frequency sweep.
Ø Magnitude is relatively constant across that band (~800), showing equal
energy distribution.
This dual-view (time and frequency) confirms that the chirp signal was generated
and analyzed correctly.
Code Implementation
The project includes two main code components: signal generation and
processing scripts.
The Signal Generation Scripts create synthetic audio signals such as impulse, step,
and chirp signals using NumPy and SciPy. These signals are saved as WAV files and
visualized in both time and frequency domains.
The Filtering and Compression Scripts apply digital filters (lowpass, highpass,
bandpass) to these signals using Butterworth filter design from SciPy. For images,
PCA-based compression is implemented by reducing dimensionality and
reconstructing images using selected principal components, along with
compression ratio calculation to evaluate efficiency.
Here are concise Python code snippets for both Signal Generation and
Filtering/Compression modules:
t = np.linspace(0, 2, 44100 * 2)
signal = chirp(t, f0=20, f1=20000, t1=2, method='linear')
sf.write("chirp_signal.wav", signal, 44100)
plt.subplot(2, 1, 1)
plt.plot(t, signal, color='blue')
plt.title("Chirp Signal - Time Domain")
plt.xlabel("Time [s]"); plt.ylabel("Amplitude")
plt.subplot(2, 1, 2)
fft = np.abs(np.fft.rfft(signal))
freq = np.fft.rfftfreq(len(t), 1/44100)
plt.plot(freq, fft, color='red')
plt.title("Chirp Signal - Frequency Domain (FFT)")
plt.xlabel("Frequency [Hz]"); plt.ylabel("Magnitude")
plt.tight_layout()
plt.show()
Filtering Script (DigitalFilter Class Sample)
from scipy.signal import butter, lfilter
class DigitalFilter:
def __init__(self, filter_type, cutoff, fs, order=5):
self.b, self.a = butter(order, np.array(cutoff) / (0.5 *
fs), btype=filter_type)
Conclusion
This project explored foundational techniques in signal processing and data
compression using Python. Audio filtering using digital filters improved signal
clarity, while PCA-based image compression achieved meaningful data reduction.
Python libraries such as NumPy, SciPy, Matplotlib, and scikit-learn enabled
efficient development and visualization.
Future work could include real-time signal filtering, color image compression, or
using neural networks for more adaptive and intelligent compression and
enhancement systems across multiple modalities.
Contributions
• Shrish (23BAI11284)
Handled data cleaning and preparation, enabling smoother model
performance. Ensuring all modules received well-structured and clean
input for accurate processing.