Open
Description
[Update]
Here, I am providing some important links to external resources or the comments mentioned here:
- So far: 6-8step-FFT-based MASS, with Numba (SingleThreaded)
- A comment regarding: OFFT uses MIT License
- six-step / eight-step FFT
- OTFFT source code
- suggestion about doing profiling for different length
- A few Q and As : Also, there is an interesting question: "why is there a bump in performance for length 2^p, with p in
range(17, 21)
. - Can we implement GPU version of it?
- My initial post in Numba Discourse
- Q: What does real / imag part in FFT represent?
- implementation of irfft
- some comparisons regarding irfft
- Q: can we use vectorization to improve performance?
- use profila to profile Numba code
Currently, in Stumpy, the sliding dot product [of a query Q and a time series T], is computed via one of the two following functions:
core.sliding_dot_product
, which takes advantage of fft trick usingscipy.signal.convolve
core._sliding_dot_product
, which uses a njit on top ofnp.dot
The sliding dot product in MATALB (via fft trick) seems to be faster though.
# MATLAB code
%x is the data, y is the query
m = length(y);
n = length(x);
y = y(end:-1:1);%Reverse the query
y(m+1:n) = 0; %aappend zeros
%The main trick of getting dot products in O(n log n) time
X = fft(x);
Y = fft(y);
Z = X.*Y;
z = ifft(Z);
# and then use the slice `z(m:n)`
Can we get closer to the performance of MATLAB?