SkillAgentSearch skills...

Jscipy

Java Scientific Computing Library - Signal Processing, FFT, Filters, PSD, DCT, SciPy-like APIs for JVM & Android used in Machine Learning and Data Science.

Install / Use

/learn @hissain/Jscipy

README

<div align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="docs/logo_landscape_dark.jpg"> <source media="(prefers-color-scheme: light)" srcset="docs/logo_landscape.jpg"> <img alt="jSciPy Logo" src="docs/logo_landscape.jpg" width="500"> </picture> <h1>jSciPy: Java Scientific Computing Library</h1>

Build Status Javadoc Maven Central Discord codecov License

</div>

jSciPy is a comprehensive Java Scientific Computing and Signal Processing Library designed for Machine Learning on the JVM and Android. Inspired by Python's SciPy, it provides high-performance implementations of essential algorithms.

It currently includes modules for:

  • Signal Processing: Butterworth, Chebyshev, Elliptic, Bessel, and FIR (firwin) filters, Window Functions, 2D Convolution, 2D Cross-Correlation, Savitzky-Golay smoothing, Peak detection, Detrending, Median Filter.
  • Transformations: FFT (Fast Fourier Transform), Hilbert Transform, Welch PSD, Spectrogram, Periodogram, Convolution, DCT/IDCT.
  • Math & Analysis: RK4 ODE Solver, Interpolation (Linear, Cubic Spline, Quadratic, B-Spline), Resampling, Polynomial fitting.

In modern machine learning workflows, most signal processing tasks rely on Python's SciPy utilities. However, there is no Java library that replicates SciPy's behavior with comparable completeness and consistency. This creates a significant gap for teams building ML or signal processing pipelines on the JVM. jSciPy aims to fill this gap, and the demand for such a library is higher than ever.

Table of Contents

Why jSciPy?

The table below compares jSciPy’s signal processing and scientific computing features with several other popular Java libraries, highlighting areas where jSciPy provides more comprehensive functionality.

<picture> <source media="(prefers-color-scheme: dark)" srcset="python/figs/comparison_summary_dark.png"> <source media="(prefers-color-scheme: light)" srcset="python/figs/comparison_summary_light.png"> <img alt="jSciPy Comparison Table" src="python/figs/comparison_summary_light.png"> </picture> <p align="center"> <a href="python/figs/comparison_summary_light.png">View full size (light)</a> &nbsp;|&nbsp; <a href="python/figs/comparison_summary_dark.png">View full size (dark)</a> </p>

Features

  • Advanced Filtering: Butterworth, Chebyshev, Elliptic, Bessel, FIR Design (firwin). Supports zero-phase (filtfilt), causal (lfilter), and Second-Order Sections (sosfilt) modes.
  • 2D Processing: convolve2d, correlate2d (Full/Same/Valid), fft2, ifft2.
  • Transforms: standard 1D fft / ifft, real-optimized rfft / irfft, dct / idct (Discrete Cosine Transform), stft / istft, hilbert transform.
  • Smoothing & Analysis: Savitzky-Golay, medfilt (Median Filter), find_peaks, peakProminences, peakWidths, Welch's PSD, spectrogram, detrend, resample.
  • Correlation & Convolution: correlate, convolve (Cross-Correlation and convolution with FULL/SAME/VALID modes).
  • Polynomials: polyfit, polyval, polyder.
  • Window Functions: Hamming, Hanning, Blackman, Kaiser, Bartlett, Flat-top, Parzen, Bohman, Triangle.
  • Numerical Methods: Interpolation (Linear, Quadratic, Cubic Spline, B-Spline), RK4 ODE Solver.

Accuracy & Precision

jSciPy is rigorously tested against Python's SciPy using a "Golden Master" approach. Below is a summary of the precision (RMSE) achieved across various modules:

<picture> <source media="(prefers-color-scheme: dark)" srcset="python/figs/accuracy_summary_dark.png"> <source media="(prefers-color-scheme: light)" srcset="python/figs/accuracy_summary_light.png"> <img alt="Accuracy Summary" src="python/figs/accuracy_summary_light.png"> </picture> <p align="center"> <a href="python/figs/accuracy_summary_light.png">View full size (light)</a> &nbsp;|&nbsp; <a href="python/figs/accuracy_summary_dark.png">View full size (dark)</a> </p>

Documentation

You can access full documentation javadoc of the jscipy library HERE.

Getting Started

No prerequisites needed to use jSciPy in your project - just add the dependency below.

For contributing to jSciPy development, see CONTRIBUTING.md.

How to Include as a Dependency

Maven Central (Recommended)

jSciPy is published to Maven Central for stable releases. Simply add the dependency to your build.gradle:

dependencies {
    implementation 'io.github.hissain:jscipy:3.1.7'
}

Maven Central is automatically included in Gradle projects, so no additional repository configuration is needed.

JitPack (Alternative for Latest Commits)

If you need bleeding-edge features or the latest unreleased commits, use JitPack:

// Add JitPack repository
repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.hissain:jscipy:3.1.7'  // Note: com.github for JitPack
}

Note: JitPack uses com.github.<username>, while Maven Central uses io.github.<username>. Choose one based on your needs.

Demo Android Application

A seperate demo android application is built on this library that might be helpful to understand how to consume this library. The application can be accessed here.

Comparison Graphs

Butterworth Filter Comparison

<picture> <source media="(prefers-color-scheme: dark)" srcset="python/figs/butterworth/butterworth_simple_o4_input.txt_dark.png"> <source media="(prefers-color-scheme: light)" srcset="python/figs/butterworth/butterworth_simple_o4_input.txt_light.png"> <img alt="Butterworth Comparison" src="python/figs/butterworth/butterworth_simple_o4_input.txt_light.png"> </picture>

Chebyshev Filter Comparison

Type I:

<picture> <source media="(prefers-color-scheme: dark)" srcset="python/figs/chebyshev/cheby1_input1.txt_dark.png"> <source media="(prefers-color-scheme: light)" srcset="python/figs/chebyshev/cheby1_input1.txt_light.png"> <img alt="Chebyshev Type I Comparison" src="python/figs/chebyshev/cheby1_input1.txt_light.png"> </picture>

Type II:

<picture> <source media="(prefers-color-scheme: dark)" srcset="python/figs/chebyshev/cheby2_input1.txt_dark.png"> <source media="(prefers-color-scheme: light)" srcset="python/figs/chebyshev/cheby2_input1.txt_light.png"> <img alt="Chebyshev Type II Comparison" src="python/figs/chebyshev/cheby2_input1.txt_light.png"> </picture>

Elliptic Filter Comparison

<picture> <source media="(prefers-color-scheme: dark)" srcset="python/figs/elliptic/ellip_input1.txt_dark.png"> <source media="(prefers-color-scheme: light)" srcset="python/figs/elliptic/ellip_input1.txt_light.png"> <img alt="Elliptic Filter Comparison" src="python/figs/elliptic/ellip_input1.txt_light.png"> </picture>

Bessel Filter Comparison

<picture> <source media="(prefers-color-scheme: dark)" srcset="python/figs/bessel/bessel_comparison_dark.png"> <source media="(prefers-color-scheme: light)" srcset="python/figs/bessel/bessel_comparison_light.png"> <img alt="Bessel Filter Comparison" src="python/figs/bessel/bessel_comparison_light.png"> </picture>

RK4 Solver Comparison

<picture> <source media="(prefers-color-scheme: dark)" srcset="python/figs/rk4/rk4_comparison_dark.png"> <source media="(prefers-color-scheme: light)" srcset="python/figs/rk4/rk4_comparison_light.png"> <img alt="RK4 Comparison" src="python/figs/rk4/rk4_com
View on GitHub
GitHub Stars19
CategoryData
Updated4d ago
Forks1

Languages

Java

Security Score

95/100

Audited on Mar 26, 2026

No findings