Skip to content
Snippets Groups Projects
Commit afad2a14 authored by BRONES Romain's avatar BRONES Romain
Browse files

fix: Fix simulation model, update view

* Add SUMSAT saturation
* Add first iteration with 0 in registers
parent 3d1b8a64
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -70,7 +70,8 @@ K_A = 218 ...@@ -70,7 +70,8 @@ K_A = 218
K_B = -186 K_B = -186
K_iC = 325 K_iC = 325
K_D = -3225 K_D = -3225
C_N_RND = 20 C_N_RND = 26
SUMSAT=36
## ----------------------- ## -----------------------
# Model computation # Model computation
...@@ -88,9 +89,12 @@ for i in range(size): ...@@ -88,9 +89,12 @@ for i in range(size):
# Step 3: correction computation # Step 3: correction computation
corr = np.zeros((N_PSC, size), dtype="int64") corr = np.zeros((N_PSC, size), dtype="int64")
_corr = mm[:,0].astype('i8')*K_A*K_iC
corr[:,0] = np.clip(np.round(_corr/2**C_N_RND), -2**15, 2**15-1).astype('i8')
for i in range(1,size): for i in range(1,size):
_corr = ((mm[:,i]*K_A + mm[:,i-1]*K_B + corr[:,i-1]*K_D)*K_iC) _sum = mm[:,i].astype('i8')*K_A + mm[:,i-1].astype('i8')*K_B + corr[:,i-1]*K_D
corr[:,i] = np.clip(np.round(_corr/2**C_N_RND), -2**16, 2**16-1) _corr = np.clip(_sum, -2**(SUMSAT-1), 2**(SUMSAT-1)-1)*K_iC
corr[:,i] = np.clip(np.round(_corr/2**C_N_RND), -2**15, 2**15-1)
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment