1
1
"""
2
- Numerical Python functions written for compatibility with MATLAB
3
- commands with the same names. Most numerical Python functions can be found in
4
- the `NumPy`_ and `SciPy`_ libraries. What remains here is code for performing
5
- spectral computations and kernel density estimations.
2
+ This module is deprecated in favour of modules that can be found in
3
+ the `NumPy`_ and `SciPy`_ libraries.
6
4
7
5
.. _NumPy: https://numpy.org
8
6
.. _SciPy: https://www.scipy.org
58
56
from matplotlib import _api , _docstring , cbook
59
57
60
58
59
+ @_api .deprecated ("3.6" , alternative = "np.hanning" )
61
60
def window_hanning (x ):
62
61
"""
63
62
Return *x* times the Hanning (or Hann) window of len(*x*).
@@ -69,6 +68,7 @@ def window_hanning(x):
69
68
return np .hanning (len (x ))* x
70
69
71
70
71
+ @_api .deprecated ("3.6" , alternative = "" )
72
72
def window_none (x ):
73
73
"""
74
74
No window function; simply return *x*.
@@ -80,6 +80,7 @@ def window_none(x):
80
80
return x
81
81
82
82
83
+ @_api .deprecated ("3.6" , alternative = "scipy.signal.detrend" )
83
84
def detrend (x , key = None , axis = None ):
84
85
"""
85
86
Return *x* with its trend removed.
@@ -129,6 +130,7 @@ def detrend(x, key=None, axis=None):
129
130
f"'constant', 'mean', 'linear', or a function" )
130
131
131
132
133
+ @_api .deprecated ("3.6" , alternative = "scipy.signal.detrend" )
132
134
def detrend_mean (x , axis = None ):
133
135
"""
134
136
Return *x* minus the mean(*x*).
@@ -157,6 +159,7 @@ def detrend_mean(x, axis=None):
157
159
return x - x .mean (axis , keepdims = True )
158
160
159
161
162
+ @_api .deprecated ("3.6" , alternative = "scipy.signal.detrend" )
160
163
def detrend_none (x , axis = None ):
161
164
"""
162
165
Return *x*: no detrending.
@@ -179,6 +182,7 @@ def detrend_none(x, axis=None):
179
182
return x
180
183
181
184
185
+ @_api .deprecated ("3.6" , alternative = "scipy.signal.detrend" )
182
186
def detrend_linear (y ):
183
187
"""
184
188
Return *x* minus best fit line; 'linear' detrending.
@@ -531,6 +535,7 @@ def _single_spectrum_helper(
531
535
MATLAB compatibility.""" )
532
536
533
537
538
+ @_api .deprecated ("3.6" , alternative = "scipy.signal.psd" )
534
539
@_docstring .dedent_interpd
535
540
def psd (x , NFFT = None , Fs = None , detrend = None , window = None ,
536
541
noverlap = None , pad_to = None , sides = None , scale_by_freq = None ):
@@ -587,6 +592,7 @@ def psd(x, NFFT=None, Fs=None, detrend=None, window=None,
587
592
return Pxx .real , freqs
588
593
589
594
595
+ @_api .deprecated ("3.6" , alternative = "scipy.signal.csd" )
590
596
@_docstring .dedent_interpd
591
597
def csd (x , y , NFFT = None , Fs = None , detrend = None , window = None ,
592
598
noverlap = None , pad_to = None , sides = None , scale_by_freq = None ):
@@ -688,7 +694,6 @@ def csd(x, y, NFFT=None, Fs=None, detrend=None, window=None,
688
694
Can return the complex spectrum of segments within the signal.
689
695
"""
690
696
691
-
692
697
complex_spectrum = functools .partial (_single_spectrum_helper , "complex" )
693
698
complex_spectrum .__doc__ = _single_spectrum_docs .format (
694
699
quantity = "complex-valued frequency spectrum" ,
@@ -707,6 +712,7 @@ def csd(x, y, NFFT=None, Fs=None, detrend=None, window=None,
707
712
** _docstring .interpd .params )
708
713
709
714
715
+ @_api .deprecated ("3.6" , alternative = "scipy.signal.welch" )
710
716
@_docstring .dedent_interpd
711
717
def specgram (x , NFFT = None , Fs = None , detrend = None , window = None ,
712
718
noverlap = None , pad_to = None , sides = None , scale_by_freq = None ,
@@ -790,6 +796,7 @@ def specgram(x, NFFT=None, Fs=None, detrend=None, window=None,
790
796
return spec , freqs , t
791
797
792
798
799
+ @_api .deprecated ("3.6" , alternative = "scipy.signal.coherence" )
793
800
@_docstring .dedent_interpd
794
801
def cohere (x , y , NFFT = 256 , Fs = 2 , detrend = detrend_none , window = window_hanning ,
795
802
noverlap = 0 , pad_to = None , sides = 'default' , scale_by_freq = None ):
0 commit comments