Skip to content

Commit

Permalink
fix small bug in sinad calculation (shouldn't actually make a differe…
Browse files Browse the repository at this point in the history
…nce)
  • Loading branch information
reed-foster committed May 16, 2023
1 parent c20e2ed commit 9a7b9dc
Show file tree
Hide file tree
Showing 2 changed files with 318 additions and 49 deletions.
6 changes: 3 additions & 3 deletions pynq/dds_loopback.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ def sinad_dBc(self, buffer_idx):
# find fundamental
k0 = np.argmax(Pxx_den[:,1])
# spectral width of kaiser window
width = int(np.ceil(2*(1+(28*np.pi)**2)**0.5))
width = int(np.ceil(2*(1+(38/np.pi)**2)**0.5))
# get power in fundamental
Pxx_den_fund = np.zeros(Pxx_den.shape)
Pxx_den_fund[k0-width//2:k0+width//2,:] = Pxx_den[k0-width//2:k0+width//2,:]
Pxx_den_fund[k0-width:k0+width,:] = Pxx_den[k0-width:k0+width,:]
# remove fundamental
Pxx_den[k0-width//2:k0+width//2,:] = 0
Pxx_den[k0-width:k0+width,:] = 0
if self.plot:
for i in range(2):
ax[1,i].semilogy(f, Pxx_den[:,i])
Expand Down
Loading

0 comments on commit 9a7b9dc

Please sign in to comment.