Skip to content

Commit

Permalink
Merge pull request #82 from cl445/master
Browse files Browse the repository at this point in the history
Fix rho calculation and complex number handling in arburg2 algorithm
  • Loading branch information
cokelaer authored Dec 8, 2024
2 parents 822b3df + fb86a3a commit eba25b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spectrum/burg.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _arburg2(X, order):

temp = 1.
E = np.zeros(order+1)
E[0] = rho
E[0] = rho.copy()

for m in range(0, order):
#print m
Expand All @@ -74,7 +74,7 @@ def _arburg2(X, order):
a = a + ref[m] * np.flipud(a).conjugate()

# Update the prediction error
E[m+1] = (1 - ref[m].conj().transpose()*ref[m]) * E[m]
E[m+1] = (1 - ref[m].conj().transpose()*ref[m]).real * E[m]
#print 'REF', ref, num, den
return a, E[-1], ref

Expand Down

0 comments on commit eba25b3

Please sign in to comment.