Skip to content

Commit 1a502c5

Browse files
authored
Merge pull request #111 from v0lta/cwt-fix
cwt-fix
2 parents 8c396b6 + 76ca397 commit 1a502c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ptwt/continuous_transform.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def cwt(
2929
scales: Union[np.ndarray, torch.Tensor],
3030
wavelet: Union[ContinuousWavelet, str],
3131
sampling_period: float = 1.0,
32+
precision: int = 12,
3233
) -> tuple[torch.Tensor, np.ndarray]:
3334
"""Compute the single-dimensional continuous wavelet transform.
3435
@@ -47,6 +48,7 @@ def cwt(
4748
The values computed for ``coefs`` are independent of the choice of
4849
``sampling_period`` (i.e. ``scales`` is not scaled by the sampling
4950
period).
51+
precision (int): Length of the wavelet used for the CWT.
5052
5153
Raises:
5254
ValueError: If a scale is too small for the input signal.
@@ -81,7 +83,6 @@ def cwt(
8183
if data.is_cuda:
8284
wavelet.cuda()
8385

84-
precision = 10
8586
int_psi, x = _integrate_wavelet(wavelet, precision=precision)
8687
if type(wavelet) is ContinuousWavelet:
8788
int_psi = np.conj(int_psi) if wavelet.complex_cwt else int_psi

0 commit comments

Comments
 (0)