I have noticed that your implementation of the ASF produces the wrong signal.
In case when all is fine (weighting matrix W is composed of only 1's, meaning that there are no noise components in the signal), ASF produces totally different signal. However, in this case, the signal should be identical to the input one, since the spectrum of the input signal is weighted with 1's, which actually does nothing.
I guess that is because of the abs() function in the 18's line:
F = abs(np.fft.fft(C,n=L,axis=1)/L) #L -> C_rgb.shape[0]
I didn't see any abs() in the original pseudocode in the paper, however, I assume you add this to take the absolute value of the energy of the spectrum, to compare against amax value. You have done the comparison with the absolute values of the spectrum in the lines 21 and 24, so I guess the abs() in the line 18 is redundant (since you change the values of the spectrum, which you then try to weight).
Hello!
I have noticed that your implementation of the ASF produces the wrong signal.
In case when all is fine (weighting matrix W is composed of only 1's, meaning that there are no noise components in the signal), ASF produces totally different signal. However, in this case, the signal should be identical to the input one, since the spectrum of the input signal is weighted with 1's, which actually does nothing.
I guess that is because of the abs() function in the 18's line:
F = abs(np.fft.fft(C,n=L,axis=1)/L) #L -> C_rgb.shape[0]
I didn't see any abs() in the original pseudocode in the paper, however, I assume you add this to take the absolute value of the energy of the spectrum, to compare against amax value. You have done the comparison with the absolute values of the spectrum in the lines 21 and 24, so I guess the abs() in the line 18 is redundant (since you change the values of the spectrum, which you then try to weight).
Best regards, Petro