Skip to content

Commit

Permalink
freq2time: use czt to avoid taking conjugate x2
Browse files Browse the repository at this point in the history
  • Loading branch information
John Garrett committed Mar 22, 2021
1 parent 2406cd6 commit 7c34843
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions czt.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,16 @@ def freq2time(f, X, t=None):
dt = tspan / (nt - 1) # more accurate than t[1] - t[0]

# Starting point
A = np.exp(2j * np.pi * t[0] * df)
A = np.exp(-2j * np.pi * t[0] * df)

# Step
W = np.exp(-2j * np.pi * df * dt)
W = np.exp(2j * np.pi * df * dt)

# Phase correction
phase = np.exp(2j * np.pi * f[0] * t)

# Time-domain transform
time_data = iczt(X, N=nt, W=W, A=A) * phase
time_data = czt(X, nt, W=W, A=A) * phase / nf

return t, time_data

Expand Down

0 comments on commit 7c34843

Please sign in to comment.