Skip to content

Commit

Permalink
Fix data types and return count
Browse files Browse the repository at this point in the history
  • Loading branch information
ggventurini committed Jun 9, 2015
1 parent eed57b7 commit bfde228
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deltasigma/_simulateQSNR.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ def simulateQSNR(ntf,
# Hanning window of length N
window = 0.5*(1 - np.cos(2*np.pi*np.arange(N)/N))
f1 = max((np.round(N*(0.5 + f0 - 0.5/R)), 0))
inBandBins = np.arange(f1, np.round(N*(0.5 + f0 + 0.5/R)) + 1)
inBandBins = np.arange(f1, np.round(N*(0.5 + f0 + 0.5/R)) + 1, dtype=np.int32)
F = F - f1 + N/2.

snr = np.zeros(amp.shape)
i = 0
for A in 10.0**(amp/20.):
v = simulateQDSM(A*tone, ntf, nlev)
v, _, _, _ = simulateQDSM(A*tone, ntf, nlev)
hwfft = fftshift(fft(window*v[Ntransient:N + Ntransient]))
snr[i] = calculateSNR(hwfft[inBandBins], F)
i = i + 1
Expand Down

0 comments on commit bfde228

Please sign in to comment.