From 7e2d8310679321b843f0e0df7f326ca09ab7011d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Thu, 9 Jan 2025 14:51:14 +0100 Subject: [PATCH] Fixed gauss_fir to work with numpy-2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's related to #1149 Signed-off-by: Jaroslav Škarvada --- src/urh/cythonext/signal_functions.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/urh/cythonext/signal_functions.pyx b/src/urh/cythonext/signal_functions.pyx index e9f4c2ab25..9a87dbf5a9 100644 --- a/src/urh/cythonext/signal_functions.pyx +++ b/src/urh/cythonext/signal_functions.pyx @@ -238,8 +238,8 @@ cdef np.ndarray[np.float32_t, ndim=1] gauss_fir(float sample_rate, uint32_t samp int(filter_width * samples_per_symbol) + 1, dtype=np.float32) cdef float ts = samples_per_symbol / sample_rate # symbol time - cdef np.ndarray[np.float32_t] h = np.sqrt((2 * np.pi) / (np.log(2))) * bt / ts * np.exp( - -(((np.sqrt(2) * np.pi) / np.sqrt(np.log(2)) * bt * k / samples_per_symbol) ** 2)) + cdef np.ndarray[np.float32_t] h = (np.sqrt((2 * np.pi) / (np.log(2))) * bt / ts * np.exp( + -(((np.sqrt(2) * np.pi) / np.sqrt(np.log(2)) * bt * k / samples_per_symbol) ** 2))).astype(np.float32) return h / h.sum() cdef float clamp(float x) nogil: