https://github.com/estaheri7/signal_final_project
This application allows users to visualize the spectrogram and waveform of various synthetic and real audio signals as the final project for Signals & Systems course at Amirkabir University.
https://github.com/estaheri7/signal_final_project
signal-processing spectrogram
Last synced: 12 days ago
JSON representation
This application allows users to visualize the spectrogram and waveform of various synthetic and real audio signals as the final project for Signals & Systems course at Amirkabir University.
- Host: GitHub
- URL: https://github.com/estaheri7/signal_final_project
- Owner: Estaheri7
- Created: 2025-06-04T16:39:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-10T12:02:20.000Z (about 1 year ago)
- Last Synced: 2025-10-30T22:30:41.149Z (9 months ago)
- Topics: signal-processing, spectrogram
- Language: Python
- Homepage:
- Size: 1.27 MB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spectrogram Viewer GUI π΅π
This is a Python-based GUI application that allows users to visualize the **spectrogram** and **waveform** of various synthetic and real audio signals. The app is built using `Tkinter` for the GUI and `matplotlib` for visualizations. It also uses `scipy`, `numpy`, and `sounddevice` for signal processing and playback.
## π Features
- Select from various synthetic signals:
- Linear Chirp
- Exponential Chirp
- Piecewise Sinusoid
- Piecewise Sum of Sinusoids
- Load and analyze `.wav` audio files.
- Visualize **spectrogram** with adjustable parameters:
- Window length
- Overlap
- Window type (Rectangular, Hamming, Hann)
- View waveform of loaded audio files.
- Play loaded audio using system sound.
- Detect high-energy regions in audio based on energy threshold.
## πΌοΈ Screenshots
1. **Main GUI window**

2. **Spectrogram of a Linear Chirp**

3. **Waveform & Spectrogram view of an audio file**


## π οΈ Installation
### 1. Clone the Repository
```bash
git clone https://github.com/Estaheri7/Signal_Final_Project
cd spectrogram-viewer
```
### 2. Install Dependencies
Make sure you have Python 3.8+ installed.
```bash
pip install numpy matplotlib scipy sounddevice
```
If you're using `tkinter` for the first time, itβs usually preinstalled with Python. If not:
- On Ubuntu/Debian:
```bash
sudo apt-get install python3-tk
```
- On macOS:
Tkinter should be included with the Python installer from [python.org](https://www.python.org/).
### 3. Run the App
```bash
python main.py
```
## π Project Structure
```bash
.
βββ app.py # GUI logic and signal visualization
βββ signals.py # Synthetic signal generators
βββ main.py # App launcher
βββ README.md # You're here!
```
## π§ Usage Instructions
1. **Choose a Signal Type** from the dropdown.
2. **Set Parameters**:
- Window Length (e.g., 256)
- Overlap (e.g., 128)
- Window Type (hann, hamming, rectangular)
3. **Click 'Plot Spectrogram'** to generate the frequency-time plot.
4. To work with real audio:
- Click **Load Audio File**
- View **Waveform**
- Click **Play Audio**
- Use **Detect High-Energy Region** to analyze loud sections.
## π Notes
- Audio files must be `.wav` format.
- Stereo audio files will be downmixed to mono (first channel only).
- Energy thresholding in high-energy detection is based on 60% of the peak window energy.