Skip to content

Commit

Permalink
Padding fix in scale_to_freq
Browse files Browse the repository at this point in the history
  • Loading branch information
OverLordGoldDragon authored Nov 14, 2024
1 parent fa4c720 commit dbe8696
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ssqueezepy/experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import warnings
import numpy as np
from .wavelets import Wavelet, center_frequency
from .utils import backend as S, cwt_scalebounds
from .utils import backend as S, cwt_scalebounds, p2up
from .utils.common import EPS32, EPS64, p2up, trigdiff
from .ssqueezing import ssqueeze
from ._ssq_cwt import phase_cwt, phase_cwt_num
Expand Down Expand Up @@ -114,7 +114,7 @@ def scale_to_freq(scales, wavelet, N, fs=1, padtype='reflect'):
wavelet = Wavelet._init_if_not_isinstance(wavelet)

# evaluate wavelet at `scales`
Npad = int(2**np.ceil(np.log2(N))) if padtype is not None else N
Npad = p2up(N)[0] if padtype is not None else N
psis = wavelet(scale=scales, N=Npad)
if hasattr(psis, 'cpu'):
psis = psis.cpu().numpy()
Expand Down

0 comments on commit dbe8696

Please sign in to comment.