Skip to content

Commit 54643a7

Browse files
committed
updated
1 parent 736dd45 commit 54643a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python_hackrf/pyhackrf_tools/pyhackrf_sweep.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ cpdef int sweep_callback(c_pyhackrf.PyHackrfDevice device, cnp.ndarray[cnp.int8_
162162
index += (pyhackrf.PY_BYTES_PER_BLOCK - data_length)
163163

164164
raw_iq = buffer[index:index + data_length:2] / 128 + 1j * buffer[index + 1:index + data_length:2] / 128
165-
raw_iq -= raw_iq.mean()
166-
fftOut = fft(raw_iq * window)
165+
raw_iq = (raw_iq - raw_iq.mean()) * window
166+
fftOut = fft(raw_iq)
167167
pwr = np.log10(np.abs(fftOut * norm_factor) ** 2) * 10.0
168168

169169
if sweep_style == pyhackrf.py_sweep_style.LINEAR:

0 commit comments

Comments
 (0)