psambit9791 / jdsp

A Java Library for Digital Signal Processing
https://jdsp.dev
MIT License
247 stars 43 forks source link

[Feature] Implement Fast Convolution and Cross-Correlation #82

Closed skylarkgit closed 1 month ago

skylarkgit commented 4 months ago

Summary: This pull request introduces the implementation of fast convolution and cross-correlation methods using FFT (Fast Fourier Transform). It includes:

When to Use Fast Convolution and Cross-Correlation:

Details:

  1. Fast Convolution:

    • Implements the fastConvolve method which performs convolution using FFT.
    • Supports full, same, and valid modes.
    • Includes proper error handling for invalid modes.
  2. Fast Cross-Correlation:

    • Implements the fastCrossCorrelate method which performs cross-correlation using fastConvolve.
    • Supports full, same, and valid modes.

Changes Made:

Testing: