Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Padding fix in scale_to_freq #114

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading