Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
fixed code bug in muller muller
Browse files Browse the repository at this point in the history
  • Loading branch information
777arc committed Mar 2, 2022
1 parent 6287544 commit ac42089
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions content/rds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ Time Synchronization (Symbol-Level)
out_rail = np.zeros(len(samples) + 10, dtype=np.complex64) # stores values, each iteration we need the previous 2 values plus current value
i_in = 0 # input samples index
i_out = 2 # output index (let first two outputs be 0)
while i_out < len(samples) and i_in*16 < len(samples):
while i_out < len(samples) and i_in+16 < len(samples):
out[i_out] = samples_interpolated[i_in*16 + int(mu*16)] # grab what we think is the "best" sample
out_rail[i_out] = int(np.real(out[i_out]) > 0) + 1j*int(np.imag(out[i_out]) > 0)
x = (out_rail[i_out] - out_rail[i_out-2]) * np.conj(out[i_out-1])
Expand Down Expand Up @@ -691,7 +691,7 @@ You did it! Below is all of the code above, concatenated, it should work with t
out_rail = np.zeros(len(samples) + 10, dtype=np.complex64) # stores values, each iteration we need the previous 2 values plus current value
i_in = 0 # input samples index
i_out = 2 # output index (let first two outputs be 0)
while i_out < len(samples) and i_in*16 < len(samples):
while i_out < len(samples) and i_in+16 < len(samples):
out[i_out] = samples_interpolated[i_in*16 + int(mu*16)] # grab what we think is the "best" sample
out_rail[i_out] = int(np.real(out[i_out]) > 0) + 1j*int(np.imag(out[i_out]) > 0)
x = (out_rail[i_out] - out_rail[i_out-2]) * np.conj(out[i_out-1])
Expand Down
2 changes: 1 addition & 1 deletion content/sync.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ The following Python code implements the Mueller and Muller clock recovery techn
out_rail = np.zeros(len(samples) + 10, dtype=np.complex) # stores values, each iteration we need the previous 2 values plus current value
i_in = 0 # input samples index
i_out = 2 # output index (let first two outputs be 0)
while i_out < len(samples) and i_in*16 < len(samples):
while i_out < len(samples) and i_in+16 < len(samples):
out[i_out] = samples[i_in + int(mu)] # grab what we think is the "best" sample
out_rail[i_out] = int(np.real(out[i_out]) > 0) + 1j*int(np.imag(out[i_out]) > 0)
x = (out_rail[i_out] - out_rail[i_out-2]) * np.conj(out[i_out-1])
Expand Down
2 changes: 1 addition & 1 deletion figure-generating-scripts/rds_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
out_rail = np.zeros(len(samples) + 10, dtype=np.complex64) # stores values, each iteration we need the previous 2 values plus current value
i_in = 0 # input samples index
i_out = 2 # output index (let first two outputs be 0)
while i_out < len(samples) and i_in < len(samples):
while i_out < len(samples) and i_in+16 < len(samples):
out[i_out] = samples_interpolated[i_in*16 + int(mu*16)] # grab what we think is the "best" sample
out_rail[i_out] = int(np.real(out[i_out]) > 0) + 1j*int(np.imag(out[i_out]) > 0)
x = (out_rail[i_out] - out_rail[i_out-2]) * np.conj(out[i_out-1])
Expand Down

0 comments on commit ac42089

Please sign in to comment.