jdsp
jdsp copied to clipboard
[Feature] Implement Fast Convolution and Cross-Correlation
Summary: This pull request introduces the implementation of fast convolution and cross-correlation methods using FFT (Fast Fourier Transform). It includes:
- Implementation of
fastConvolve
andfastCrossCorrelate
methods. - Support for different convolution modes:
full
,same
, andvalid
. - Error handling for invalid modes.
When to Use Fast Convolution and Cross-Correlation:
- Use these methods when dealing with large datasets or signals where performance is critical.
- They are particularly beneficial in applications requiring real-time signal processing or where the convolution/cross-correlation operation is a bottleneck.
- Suitable for high-performance computing environments and scenarios involving repeated calculations on similar-sized data.
Details:
-
Fast Convolution:
- Implements the
fastConvolve
method which performs convolution using FFT. - Supports
full
,same
, andvalid
modes. - Includes proper error handling for invalid modes.
- Implements the
-
Fast Cross-Correlation:
- Implements the
fastCrossCorrelate
method which performs cross-correlation usingfastConvolve
. - Supports
full
,same
, andvalid
modes.
- Implements the
Changes Made:
- Added
fastConvolve
andfastCrossCorrelate
methods in the respective classes. - Added detailed comments and documentation to explain the methods and parameters.
- Included error handling for invalid modes.
Testing:
- Tested the methods with different modes (
full
,same
,valid
) to ensure correctness.