Skip to content

Commit

Permalink
Fixed gauss_fir to work with numpy-2
Browse files Browse the repository at this point in the history
It's related to #1149

Signed-off-by: Jaroslav Škarvada <[email protected]>
  • Loading branch information
yarda committed Jan 9, 2025
1 parent 6abdd54 commit 7e2d831
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/urh/cythonext/signal_functions.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7e2d831

Please sign in to comment.