Spectral analysis and signal intelligence β Fourier, wavelet, and AI-powered spectrum characterisation for scientific and engineering applications.
Topics: astronomy Β· astrophysics-ml Β· attention-mechanism Β· deep-learning Β· dimensionality-reduction Β· machine-learning Β· neural-networks Β· spectroscopy Β· astronomical-spectra Β· spectral-line-identification
SpectraNova is a comprehensive spectral analysis platform that combines classical signal processing (Fourier transform, Short-Time Fourier Transform, Continuous Wavelet Transform) with machine learning methods (spectral clustering, anomaly detection, classification from spectral features) for a wide range of spectral data types: audio signals, vibration data, optical spectra, electromagnetic spectra, and time-series measurements from scientific instruments.
The platform is designed to serve multiple user communities simultaneously. For signal processing engineers, it provides a rigorous implementation of spectral estimation methods (periodogram, Welch's method, multitaper) with window function comparison and resolution-variance trade-off analysis. For data scientists, it provides a feature extraction pipeline that converts raw spectra into ML-ready feature vectors and feeds them into scikit-learn classifiers and anomaly detectors. For domain scientists, it provides a configurable analysis pipeline for specific spectral formats including astronomical spectra (FITS), vibrational spectra (CSV from spectrometers), and audio recordings.
A key strength of SpectraNova is its wavelet analysis module: unlike Fourier analysis, which assumes stationarity, the Continuous Wavelet Transform (CWT) provides time-frequency localisation β revealing how the frequency content of a signal evolves over time. This makes it particularly powerful for analysing non-stationary signals like seismic data, financial time series, and biomedical signals.
Spectral analysis is a universal analytical tool that appears in physics, engineering, biology, finance, and astronomy β yet each domain typically uses domain-specific software with limited cross-pollination of methods. SpectraNova was built to provide a domain-agnostic spectral analysis environment that makes the mathematical machinery of signal processing accessible to any discipline working with time-series or spectral data.
Signal Input (time-series / spectrum data)
β
Preprocessing: detrending, normalisation, windowing
β
ββββββββββββββββββββββββββββββββββββββββββββββββ
β Classical Spectral Analysis: β
β βββ FFT / Periodogram / Welch's method β
β βββ STFT (spectrogram) β
β βββ CWT (time-frequency wavelet map) β
ββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββββββββββββββββββ
β ML Analysis: β
β βββ Feature extraction (spectral centroid, β
β β bandwidth, rolloff, MFCC, peaks) β
β βββ Spectral classification (RF / SVM) β
β βββ Anomaly detection (Isolation Forest) β
ββββββββββββββββββββββββββββββββββββββββββββββββ
β
Interactive Plotly / Matplotlib visualisation
Comparison of periodogram, Welch's method, multitaper estimation, and Lomb-Scargle (for unevenly sampled data) β with resolution and variance trade-off visualisation.
STFT spectrogram with configurable window function (Hann, Hamming, Blackman, Kaiser), window length, and hop size β displayed as an interactive Plotly heatmap with log frequency axis.
CWT with Morlet, Mexican Hat, and Paul wavelet families for time-frequency analysis of non-stationary signals, with scalogram (wavelet power spectrum) visualisation.
Automatic computation of 20+ spectral features per signal: centroid, bandwidth, spectral rolloff, flatness, kurtosis, MFCCs (for audio), and peak frequency/amplitude pairs.
Train a RandomForest or SVM classifier on spectral feature vectors for signal type classification (e.g., bearing fault type, material identification, instrument recognition).
Isolation Forest and One-Class SVM anomaly detection on spectral features β flagging measurements that deviate significantly from the baseline distribution for quality control applications.
Side-by-side comparison of Hann, Hamming, Blackman, Flat-top, and Kaiser window functions with their frequency domain characteristics (main lobe width, side lobe level, scalloping loss).
Process directories of signal files with the same analysis configuration, outputting feature CSVs and spectral plots for each file β suitable for large-scale spectral databases.
| Library / Tool | Role | Why This Choice |
|---|---|---|
| NumPy / SciPy | Signal processing core | FFT, Welch, STFT, window functions, filtering |
| PyWavelets | Wavelet transforms | CWT, DWT, scalogram computation |
| LibROSA | Audio spectral features | MFCC, spectral centroid, chromagram |
| scikit-learn | ML classification/anomaly | RandomForest, SVM, Isolation Forest on spectral features |
| Plotly | Interactive visualisation | Spectrograms, CWT scalograms, feature comparison charts |
| Matplotlib | Static publication figures | High-resolution spectral plots for reports |
| Astropy (optional) | Astronomical spectra | FITS file I/O and Lomb-Scargle for unevenly sampled data |
- Python 3.9+ (or Node.js 18+ for TypeScript/JavaScript projects)
- A virtual environment manager (
venv,conda, or equivalent) - API keys as listed in the Configuration section
git clone https://github.com/Devanik21/SpectraNova.git
cd SpectraNova
python -m venv venv && source venv/bin/activate
pip install numpy scipy pywavelets librosa scikit-learn plotly matplotlib pandas streamlit
streamlit run app.py# Analyse a signal file
streamlit run app.py
# FFT analysis from CLI
python spectral_analysis.py --input signal.wav --method welch --window hann
# CWT scalogram
python wavelet_analysis.py --input vibration.csv --wavelet morlet --scales 32
# Train spectral classifier
python train_classifier.py --data spectra_labelled/ --model rf
# Batch processing
python batch_analyse.py --input_dir ./spectra/ --output features.csv| Variable | Default | Description |
|---|---|---|
DEFAULT_METHOD |
welch |
PSD estimation: periodogram, welch, multitaper |
WINDOW_FUNCTION |
hann |
Spectral window: hann, hamming, blackman, kaiser |
WAVELET_FAMILY |
morlet |
CWT wavelet: morlet, mexh, paul |
N_MFCC |
13 |
Number of MFCC coefficients to extract |
ANOMALY_CONTAMINATION |
0.05 |
Expected anomaly fraction for Isolation Forest |
Copy
.env.exampleto.envand populate required values before running.
SpectraNova/
βββ README.md
βββ requirements.txt
βββ app.py
βββ ...
- Hilbert-Huang Transform for adaptive analysis of nonlinear, non-stationary signals
- Neural spectral analysis: 1D-CNN trained on spectral images for end-to-end classification
- Real-time analysis mode with streaming input from audio devices or serial port sensors
- Spectral database: store and query labelled spectra with metadata for reference comparison
- Publication-ready figure generator with configurable DPI, font size, and colour scheme
Contributions, issues, and suggestions are welcome.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-idea - Commit your changes:
git commit -m 'feat: add your idea' - Push to your branch:
git push origin feature/your-idea - Open a Pull Request with a clear description
Please follow conventional commit messages and add documentation for new features.
CWT computation time scales with the number of scales and signal length β large signals with many scales may take 10β60 seconds. For real-time applications, prefer STFT or DWT (faster) over CWT. Spectral analysis results depend critically on preprocessing choices (detrending, windowing) β document these carefully in any scientific publication.
Devanik Debnath
B.Tech, Electronics & Communication Engineering
National Institute of Technology Agartala
This project is open source and available under the MIT License.
Built with curiosity, depth, and care β because good projects deserve good documentation.