-
Notifications
You must be signed in to change notification settings - Fork 968
Description
Hi TFLM team,
I work as a software engineer in the manufacturing industry,
mainly developing software for industrial/production systems.
In this domain we process a lot of time-series data on edge devices and MCUs
(e.g., vibration signals, power consumption patterns, etc.).
Many of these workloads would benefit from using frequency-domain features
directly on the device, instead of relying only on external pre-processing.
Because of this, I’d like to propose adding FFT support to TFLM.
Proposed functionality
I’m primarily interested in two operators:
- FFT: transform time-domain data into the frequency domain.
- IFFT: inverse transform from the frequency domain back to the time domain.
As a first step, I’m thinking of:
- 1D FFT along the last axis (e.g.,
[batch, length]→[batch, length]in frequency space) - Real-valued input time-series, with a suitable representation for the complex output
(for example, separate real/imag tensors or an interleaved layout) - A corresponding 1D IFFT with a clearly defined scaling/normalization rule.
Questions / design considerations
Before starting any implementation, I’d like to ask for guidance on a few points:
-
Scope
- Is it in scope for TFLM to add FFT / IFFT as builtin operators,
or would you prefer this to live as a “composite / library” outside the core kernels?
- Is it in scope for TFLM to add FFT / IFFT as builtin operators,
-
Data types and complex representation
- TFLM doesn’t currently focus on complex tensor types.
Would you prefer:- separate real / imag tensors,
- or a specific real/imag packing scheme (e.g., 2-channel layout)?
- TFLM doesn’t currently focus on complex tensor types.
-
Signal length constraints
- Should the initial implementation require power-of-two lengths,
or is arbitrary length FFT expected? - Should zero-padding be handled inside the op or left to the model/pre-processing?
- Should the initial implementation require power-of-two lengths,
-
Scaling / normalization
- For IFFT, should the operator apply
1/Nscaling internally, or leave it to the model?
- For IFFT, should the operator apply
-
Implementation / third-party libraries
- Is there a preferred way to integrate existing FFT implementations
(e.g., viathird_partylibraries), or would you rather keep the kernel
as a minimal, reference-style implementation?
- Is there a preferred way to integrate existing FFT implementations
If FFT / IFFT operators are considered in scope for TFLM, I would be happy to
help with the design and implementation, starting from a minimal 1D real-valued
FFT + IFFT and expanding based on your feedback.
Thanks!