Repository: scipy/scipy

Issue:
BUG: Deconvolve method does not work with signals with more than 1-D
### Describe your issue.

I have an analogically filtered image and I would like to deconvolute it with the deconvolve method in scipy using a signal.butter filter that simulates my filter. So the image (the signal parameter) is not a 1-D array but a 2-D array and when passed as a parameter to the deconvolve method I get the underneath error. In the documentation, it is not written that the method only takes 1-D arrays as parameters but when looking down at the code we see that the signal is passed in the lfilter method that only takes 1-D arrays as parameters. I think that this is why we get the error. When creating the num and den variables (https://github.com/scipy/scipy/blob/7c904a77ad3d239bc35f18222810c9454e5441c3/scipy/signal/_signaltools.py#L2178), the atleast_1d method does not convert the parameters to 1-D arrays so that if we pass in the else condition, the lfilter method will get an error.
I guess, whether it should be added to the documentation that the only parameters accepted in the deconvolve method are 1-D arrays, whether the code should be corrected to convert the signal (and potentially the divisor too?) to a 1-D array before continuing the process.
It is my first contribution on GitHub and I'm really not an expert in Python nor in signal analysis so I hope this helps in any way.

### Reproducing Code Example

```python
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
from astropy.convolution import Gaussian2DKernel as gk
from astropy.convolution import convolve
from scipy import signal
from scipy.signal import butter

Gp = fits.open("C:/Users/.../.../.../.../.../jupiter_gprime2.fit")
dataGp = Gp[0].data

dataGCenter=dataGp[200:450,650:950]

# Simulating the filter used
filtering = signal.butter(2, [6.24*10**14,5.08*10**14], btype='bandpass', analog=True)

# Deconvolve the signal with the filter
signal.deconvolve(dataGCenter, filtering)
```


### Error message

```shell
File "C:\Users\...\anaconda3\lib\site-packages\scipy\signal\signaltools.py", line 1907, in 
lfilter
    return sigtools._linear_filter(b, a, x, axis)

ValueError: could not convert b, a, and x to a common type
```


### SciPy/NumPy/Python version information

1.5.2 1.19.2 sys.version_info(major=3, minor=8, micro=5, releaselevel='final', serial=0)


Discussion:

Resolving patch:
diff --git a/scipy/signal/_signaltools.py b/scipy/signal/_signaltools.py
--- a/scipy/signal/_signaltools.py
+++ b/scipy/signal/_signaltools.py
@@ -2142,9 +2142,9 @@ def deconvolve(signal, divisor):
 
     Parameters
     ----------
-    signal : array_like
+    signal : (N,) array_like
         Signal data, typically a recorded signal
-    divisor : array_like
+    divisor : (N,) array_like
         Divisor data, typically an impulse response or filter that was
         applied to the original signal
 
@@ -2177,6 +2177,10 @@ def deconvolve(signal, divisor):
     """
     num = np.atleast_1d(signal)
     den = np.atleast_1d(divisor)
+    if num.ndim > 1:
+        raise ValueError("signal must be 1-D.")
+    if den.ndim > 1:
+        raise ValueError("divisor must be 1-D.")
     N = len(num)
     D = len(den)
     if D > N:


Test patch:
diff --git a/scipy/signal/tests/test_signaltools.py b/scipy/signal/tests/test_signaltools.py
--- a/scipy/signal/tests/test_signaltools.py
+++ b/scipy/signal/tests/test_signaltools.py
@@ -3410,6 +3410,18 @@ def test_basic(self):
         recovered, remainder = signal.deconvolve(recorded, impulse_response)
         assert_allclose(recovered, original)
 
+    def test_n_dimensional_signal(self):
+        recorded = [[0, 0], [0, 0]]
+        impulse_response = [0, 0]
+        with pytest.raises(ValueError, match="signal must be 1-D."):
+            quotient, remainder = signal.deconvolve(recorded, impulse_response)
+
+    def test_n_dimensional_divisor(self):
+        recorded = [0, 0]
+        impulse_response = [[0, 0], [0, 0]]
+        with pytest.raises(ValueError, match="divisor must be 1-D."):
+            quotient, remainder = signal.deconvolve(recorded, impulse_response)
+
 
 class TestDetrend: