VEWOXIC / FITS

FITS: Frequency Interpolation Time Series Analysis Baseline
Apache License 2.0
106 stars 12 forks source link

About applying nn.Linear() to complex fft? #7

Closed Joeland4 closed 3 months ago

Joeland4 commented 3 months ago

Dear author, I can't understand the difference between directly using nn.Linear to complex tensor after FFT and separately two to real, image parts? I don't know why the nn.Linear can be directly applied to FFT, what is the outcome, a linear transformation of Amplitudes?

VEWOXIC commented 3 months ago

Hi, they are the same. We also provide a version of FITS with real-valued linear to simulate the complex-valued operation. We have validated that they both produce exactly the same result.

As for why, the complex valued linear layer is just for extending the original FFT spectrum. Thus, its output is also a complex valued spectrum. It not only output amplitude, but also managed to handle the phase shifting of each frequency components.

VEWOXIC commented 3 months ago

If there is no further question, I will close this issue. Please feel free to reopen it!

Joeland4 commented 3 months ago

Thank you for your help !