-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
self.length_ratio
for energy compensation
#1
Comments
Thanks for asking. As you mentioned, the Line 52 is just to create a placeholder for the spectrum of interpolated time series. As you can see, we just create a new zero tensor of the specified shape. It involves no scaling and energy compensation. However, in Line 55, we perform the scaling to compensate the amplitude change caused by the changing of time series length. Specifically, in spectral analysis, amplitude is usually proportional to the number of times a frequency component appears in the signal. The Fourier transform, an energy-conserving transformation, redistributes the energy of a time-domain signal into the frequency domain. As the signal length increases (here, the number of cycles), the energy (or amplitude) of the same frequency component increases because this frequency component occurs more frequently in the signal. For instance, a Fourier transform of a 100-point segment (5 cycles) of a sine wave with a period of 20 points would result in a peak at frequency 5 with an amplitude of 250, but transforming a 200-point segment (10 cycles) would yield a peak at frequency 10 with an amplitude of 500. Compensation for this energy increase due to sequence length is achieved by multiplying by a scalar, namely (output length/input length). Hope above explanation can address your question. You may also write a simple Python script to test this claim. |
Hi, I have updated the misleading comment in Line 55, please check. |
Thanks! it is clear to me now. |
By the way, the following two lines of code confuse me: Line 42 in aba1737
Line 43 in aba1737
I think the code in line 42 is meaningless due to the fact that the value in line 43 only takes the frequency before |
Yeah, seems so. Anyway, I did not change it if it works properly XD. If there is no further question, I will close this issue. |
low_xy
self.length_ratio
for energy compensation
I've been reviewing the code in the FITS repository, and I'd like to discuss the handling of the temporal length of the tensor
low_xy
. Specifically, I am referring to this line:FITS/models/FITS.py
Line 55 in 220afee
My understanding is that this line performs a scalar multiplication of the tensor
low_xy
, but it does not seem to alter its temporal length. It appears to me that the adjustment of the temporal length oflow_xy
is actually handled by a different section of the code, as shown here:FITS/models/FITS.py
Line 52 in 220afee
I believe this interpolation is where the temporal length change is compensated for. Could you please confirm if my understanding is correct, or provide further clarification if I've misunderstood the code's functionality?
Thank you for your time and for the work on this project.
The text was updated successfully, but these errors were encountered: