Skip to content

Commit

Permalink
Merge branch 'develop' into sycamore_bugfix_8_oct
Browse files Browse the repository at this point in the history
  • Loading branch information
hackdna authored Oct 25, 2024
2 parents 3936f42 + 7c9f83c commit eb69bda
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions forest/oak/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,12 @@ def compute_interpolate_cwt(tapered_bout: np.ndarray, fs: int = 10,
# interpolate coefficients
freqs = out[2]
freqs_interp = np.arange(0.5, 4.5, 0.05)
ip = interpolate.interp2d(range(coefs.shape[1]), freqs, coefs)
coefs_interp = ip(range(coefs.shape[1]), freqs_interp)
interpolator = interpolate.RegularGridInterpolator(
(freqs, range(coefs.shape[1])), coefs
)
grid_x, grid_y = np.meshgrid(freqs_interp, range(coefs.shape[1]),
indexing='ij')
coefs_interp = interpolator((grid_x, grid_y))

# trim spectrogram from the coi
coefs_interp = coefs_interp[:, 5*fs:-5*fs]
Expand Down

0 comments on commit eb69bda

Please sign in to comment.