2
$\begingroup$

I work on one-dimensional (1-D) time series classification using 1D-CNN. But the length of the time series data is variant, e.g., from 80 to 120. So it's hard to specify the size of input layer of CNN model.

  • A simple method is to pad (or truncate) the input to the same length, e.g., 100.

  • The second possible method I tried is using FFT/IFFT to resample the time series to the same length (100).

  • Interpolation ?

I am not sure if my methods are good options or not. Thanks in advance if someone can provide some widely acceptable and reasonable methods to handle this problem.

$\endgroup$
2
  • $\begingroup$ Is the sampling frequency equal across all time-series? $\endgroup$
    – Firebug
    Commented May 30, 2021 at 12:54
  • $\begingroup$ @Firebug The sampling frequency is not equal. $\endgroup$
    – Land
    Commented May 30, 2021 at 13:30

1 Answer 1

1
$\begingroup$

Without knowing much about the nature of your data, safest and easiest option would be to just add padding such that the max length is greater than the max original length (i.e. pad all to 150 since 120 is the max original length). Adding padding rarely affects performance, but truncating may hurt performance.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.