coveralls: 
[![Coverage Status](https://coveralls.io/builds/9657280/badge)](https://coveralls.io/builds/9657280)

Coverage increased (+1.6%) to 74.955% when pulling **3e435af1f6fc1029fab1a96315317b0dd8699ab8 on #39_denoising** into **b03275c0dd645fd522cab182a2cfbe28dfc948ed on master**.

diff --git a/suspect/processing/denoising.py b/suspect/processing/denoising.py
index f55b7ae..46dfc04 100644
--- a/suspect/processing/denoising.py
+++ b/suspect/processing/denoising.py
@@ -85,8 +85,8 @@ def svd(input_signal, rank):
 
 def spline(input_signal, num_splines, spline_order):
     # input signal  has to be a multiple of num_splines
-    padded_input_signal = _pad(input_signal, (numpy.ceil(len(input_signal) / float(num_splines))) * num_splines)
-    stride = len(padded_input_signal) / num_splines
+    padded_input_signal = _pad(input_signal, int(numpy.ceil(len(input_signal) / float(num_splines))) * num_splines)
+    stride = len(padded_input_signal) // num_splines
     import scipy.signal
     # we construct the spline basis by building the first one, then the rest
     # are identical copies offset by stride
@@ -95,11 +95,11 @@ def spline(input_signal, num_splines, spline_order):
     spline_basis = numpy.zeros((num_splines + 1, len(padded_input_signal)), input_signal.dtype)
     for i in range(num_splines + 1):
         spline_basis[i, :] = numpy.roll(first_spline, i * stride)
-    spline_basis[:(num_splines / 4), (len(padded_input_signal) / 2):] = 0.0
-    spline_basis[(num_splines * 3 / 4):, :(len(padded_input_signal) / 2)] = 0.0
+    spline_basis[:(num_splines // 4), (len(padded_input_signal) // 2):] = 0.0
+    spline_basis[(num_splines * 3 // 4):, :(len(padded_input_signal) // 2)] = 0.0
     coefficients = numpy.linalg.lstsq(spline_basis.T, padded_input_signal)
     recon = numpy.dot(coefficients[0], spline_basis)
-    start_offset = (len(padded_input_signal) - len(input_signal)) / 2.0
+    start_offset = (len(padded_input_signal) - len(input_signal)) // 2
     return recon[start_offset:(start_offset + len(input_signal))]
 
 
@@ -108,9 +108,9 @@ def wavelet(input_signal, wavelet_shape, threshold):
     # we have to pad the signal to make it a power of two
     next_power_of_two = int(numpy.floor(numpy.log2(len(input_signal))) + 1)
     padded_input_signal = _pad(input_signal, 2**next_power_of_two)
-    wt_coeffs = pywt.wavedec(padded_input_signal, wavelet_shape, level=None, mode='per')
+    wt_coeffs = pywt.wavedec(padded_input_signal, wavelet_shape, level=None, mode='periodization')
     denoised_coeffs = wt_coeffs[:]
     denoised_coeffs[1:] = (pywt.threshold(i, value=threshold) for i in denoised_coeffs[1:])
-    recon = pywt.waverec(denoised_coeffs, wavelet_shape, mode='per')
-    start_offset = (len(padded_input_signal) - len(input_signal)) / 2.0
+    recon = pywt.waverec(denoised_coeffs, wavelet_shape, mode='periodization')
+    start_offset = (len(padded_input_signal) - len(input_signal)) // 2
     return recon[start_offset:(start_offset + len(input_signal))]

Spline denoising fails on numpy 1.12
In numpy 1.12 spline denoising fails because it passes floating point values to _pad and roll instead of integer values.
diff --git a/tests/test_mrs/test_processing/test_denoising.py b/tests/test_mrs/test_processing/test_denoising.py
new file mode 100644
index 0000000..2e45982
--- /dev/null
+++ b/tests/test_mrs/test_processing/test_denoising.py
@@ -0,0 +1,29 @@
+import suspect
+
+import numpy
+
+import warnings
+warnings.filterwarnings("ignore", message="numpy.dtype size changed")
+
+def test_spline():
+    # we need to check if this runs correctly when number of splines is not a
+    # factor of length of signal, so that padding is required.
+    # generate a sample signal
+    input_signal = numpy.random.randn(295) + 10
+    # denoise the signal with splines
+    output_signal = suspect.processing.denoising.spline(input_signal, 32, 2)
+    # main thing is that the test runs without errors, but we can also check
+    # for reduced std in the result
+    assert numpy.std(output_signal) < numpy.std(input_signal)
+
+
+def test_wavelet():
+    # this is to check if the code runs without throwing double -> integer
+    # conversion issues
+    # generate a sample signal
+    input_signal = numpy.random.randn(295) + 10
+    # denoise the signal with splines
+    output_signal = suspect.processing.denoising.wavelet(input_signal, "db8", 1e-2)
+    # main thing is that the test runs without errors, but we can also check
+    # for reduced std in the result
+    assert numpy.std(output_signal) < numpy.std(input_signal)
\ No newline at end of file

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest mock
apt-get update apt-get install -y gcc
3.5
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
asteval==0.9.26
async-generator==1.10
attrs==22.2.0
Babel==2.11.0
backcall==0.2.0
bleach==4.1.0
certifi==2021.5.30
charset-normalizer==2.0.12
decorator==5.1.1
defusedxml==0.7.1
docutils==0.18.1
entrypoints==0.4
future==1.0.0
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
iniconfig==1.1.1
ipykernel==5.5.6
ipython==7.16.3
ipython-genutils==0.2.0
jedi==0.17.2
Jinja2==3.0.3
jsonschema==3.2.0
jupyter-client==7.1.2
jupyter-core==4.9.2
jupyterlab-pygments==0.1.2
lmfit==1.0.3
MarkupSafe==2.0.1
mistune==0.8.4
mock==5.2.0
nbclient==0.5.9
nbconvert==6.0.7
nbformat==5.1.3
nbsphinx==0.8.8
nest-asyncio==1.6.0
numpy==1.19.5
packaging==21.3
pandocfilters==1.5.1
Parsley==1.3
parso==0.7.1
pexpect==4.9.0
pickleshare==0.7.5
pluggy==1.0.0
prompt-toolkit==3.0.36
ptyprocess==0.7.0
py==1.11.0
pydicom==2.3.1
Pygments==2.14.0
pyparsing==3.1.4
pyrsistent==0.18.0
pytest==7.0.1
python-dateutil==2.9.0.post0
pytz==2025.2
PyWavelets==1.1.1
pyzmq==25.1.2
requests==2.27.1
scipy==1.5.4
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
-e git+https://github.com/openmrslab/suspect.git@b03275c0dd645fd522cab182a2cfbe28dfc948ed#egg=suspect
testpath==0.6.0
tomli==1.2.3
tornado==6.1
traitlets==4.3.3
typing_extensions==4.1.1
uncertainties==3.1.7
urllib3==1.26.20
wcwidth==0.2.13
webencodings==0.5.1
zipp==3.6.0

name: suspect
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - asteval==0.9.26
      - async-generator==1.10
      - attrs==22.2.0
      - babel==2.11.0
      - backcall==0.2.0
      - bleach==4.1.0
      - charset-normalizer==2.0.12
      - decorator==5.1.1
      - defusedxml==0.7.1
      - docutils==0.18.1
      - entrypoints==0.4
      - future==1.0.0
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - ipykernel==5.5.6
      - ipython==7.16.3
      - ipython-genutils==0.2.0
      - jedi==0.17.2
      - jinja2==3.0.3
      - jsonschema==3.2.0
      - jupyter-client==7.1.2
      - jupyter-core==4.9.2
      - jupyterlab-pygments==0.1.2
      - lmfit==1.0.3
      - markupsafe==2.0.1
      - mistune==0.8.4
      - mock==5.2.0
      - nbclient==0.5.9
      - nbconvert==6.0.7
      - nbformat==5.1.3
      - nbsphinx==0.8.8
      - nest-asyncio==1.6.0
      - numpy==1.19.5
      - packaging==21.3
      - pandocfilters==1.5.1
      - parsley==1.3
      - parso==0.7.1
      - pexpect==4.9.0
      - pickleshare==0.7.5
      - pluggy==1.0.0
      - prompt-toolkit==3.0.36
      - ptyprocess==0.7.0
      - py==1.11.0
      - pydicom==2.3.1
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pyrsistent==0.18.0
      - pytest==7.0.1
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pywavelets==1.1.1
      - pyzmq==25.1.2
      - requests==2.27.1
      - scipy==1.5.4
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - testpath==0.6.0
      - tomli==1.2.3
      - tornado==6.1
      - traitlets==4.3.3
      - typing-extensions==4.1.1
      - uncertainties==3.1.7
      - urllib3==1.26.20
      - wcwidth==0.2.13
      - webencodings==0.5.1
      - zipp==3.6.0
prefix: /opt/conda/envs/suspect

tests/test_mrs/test_processing/test_denoising.py::test_spline tests/test_mrs/test_processing/test_denoising.py::test_wavelet
suspect/processing/denoising.py
suspect/processing/denoising.py