You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 31, 2024. It is now read-only.
Right now calculation of the DFT (and iDFT) mean values in all methods in module propagate_DFT use the numpy.fft methods. The evaluation of uncertainties, though, uses a specific type of DFT for the propagation of uncertainties.
A possible method for a DFT using the same DFT type as for the uncertainty calculations would look as follows:
defcalc_DFT(a):
iflen(a.shape)==1:
N=len(a)
else:
N=a.shape[1]
ifnp.mod(N, 2) ==0: # N is evenM=N+2else:
M=N+1# For simplified calculation of sensitivitiesbeta=2*np.pi*np.arange(N) /N# sensitivity matrix wrt cosine partCxkc=lambdak: np.cos(k*beta)
# sensitivity matrix wrt sinus partCxks=lambdak: -np.sin(k*beta)
iflen(a.shape)==1:
rA=np.zeros(M//2)
iA=np.zeros(M//2)
forkinrange(M//2):
rA[k] =np.dot( a, Cxkc(k) )
iA[k] =np.dot( a, Cxks(k) )
else:
rA=np.zeros((a.shape[0], M//2))
iA=np.zeros((a.shape[0], M//2))
forkinrange(M//2):
rA[:,k] =np.dot(a, Cxkc(k))
iA[:,k] =np.dot(a, Cxks(k))
returnnp.c_[rA, iA]
A similar function could be written for the inverse DFT. Should this approach be preferred to the current one?
The text was updated successfully, but these errors were encountered:
Right now calculation of the DFT (and iDFT) mean values in all methods in module
propagate_DFT
use thenumpy.fft
methods. The evaluation of uncertainties, though, uses a specific type of DFT for the propagation of uncertainties.A possible method for a DFT using the same DFT type as for the uncertainty calculations would look as follows:
A similar function could be written for the inverse DFT. Should this approach be preferred to the current one?
The text was updated successfully, but these errors were encountered: