Skip to content

Commit

Permalink
Merge pull request scipy#6505 from caryan/master
Browse files Browse the repository at this point in the history
reset scipy.signal.resample window shape to 1-D
  • Loading branch information
larsoner authored Aug 24, 2016
2 parents 1cd4ab9 + 9dc1379 commit 14686dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions scipy/signal/signaltools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2211,6 +2211,7 @@ def resample(x, num, t=None, axis=0, window=None):
newshape[axis] = len(W)
W.shape = newshape
X = X * W
W.shape = (Nx,)
sl = [slice(None)] * x.ndim
newshape = list(x.shape)
newshape[axis] = num
Expand Down
6 changes: 6 additions & 0 deletions scipy/signal/tests/test_signaltools.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import

import sys
Expand Down Expand Up @@ -534,6 +535,11 @@ def test_basic(self):
assert_raises(ValueError, signal.resample_poly, sig, 'yo', 1)
assert_raises(ValueError, signal.resample_poly, sig, 1, 0)

# test for issue #6505 - should not modify window.shape when axis ≠ 0
sig2 = np.tile(np.arange(160), (2,1))
signal.resample(sig2, num, axis=-1, window=win)
assert_(win.shape == (160,))

def test_fft(self):
# Test FFT-based resampling
self._test_data(method='fft')
Expand Down

0 comments on commit 14686dc

Please sign in to comment.