Closed seaney11 closed 7 years ago
Wow, thanks a lot for pointing this out!
Now, the Fourier transform is always applied to data of size windowSize:
double[] dft = new double[this.windowSize];
System.arraycopy(timeSeries.getData(), 0, dft, 0, this.windowSize);
this.fft.realForward(dft);
// if windowSize > mftData.length, the remaining data should be 0 now.
System.arraycopy(dft, 0, mftData, 0, Math.min(mftData.length, dft.length));
Any remaining coefficients should be 0 from thereon.
This should fix the issue.
great, thanks for the response.
In the MFT class, the
fft
object is initialised with thewindowSize
when the MFT instance is initialised, however when the array size is set later:and when this is used in line 107:
if
arraySize
is larger than thewindowSize
, then it leaves some of themftData
not transformed and is then used later on in the rest of the MFT and in the classification.I saw this happen at
windowSize = 5
,l = 4
and soarraySize = 6
This has an implication on the creation of words especially at small window sizes, however I am not sure how often this occurs or how much it affects the final results