11"""
22
3- Numerical python functions written for compatability with matlab(TM)
3+ Numerical python functions written for compatability with MATLAB
44commands with the same names.
55
6- Matlab(TM) compatible functions
6+ MATLAB compatible functions
77-------------------------------
88
99:func:`cohere`
4141Miscellaneous functions
4242-------------------------
4343
44- Functions that don't exist in matlab(TM) , but are useful anyway:
44+ Functions that don't exist in MATLAB , but are useful anyway:
4545
4646:meth:`cohere_pairs`
47- Coherence over all pairs. This is not a matlab function, but we
47+ Coherence over all pairs. This is not a MATLAB function, but we
4848 compute coherence a lot in my lab, and we compute it for a lot of
4949 pairs. This function is optimized to do this efficiently by
5050 caching the direct FFTs.
@@ -245,7 +245,7 @@ def _spectral_helper(x, y, NFFT=256, Fs=2, detrend=detrend_none,
245245 raise ValueError ("sides must be one of: 'default', 'onesided', or "
246246 "'twosided'" )
247247
248- # Matlab divides by the sampling frequency so that density function
248+ # MATLAB divides by the sampling frequency so that density function
249249 # has units of dB/Hz and can be integrated by the plotted frequency
250250 # values. Perform the same scaling here.
251251 if scale_by_freq :
@@ -277,18 +277,18 @@ def _spectral_helper(x, y, NFFT=256, Fs=2, detrend=detrend_none,
277277 Pxy [:,i ] = np .conjugate (fx [:numFreqs ]) * fy [:numFreqs ]
278278
279279 # Scale the spectrum by the norm of the window to compensate for
280- # windowing loss; see Bendat & Piersol Sec 11.5.2.
280+ # windowing loss; see Bendat & Piersol Sec 11.5.2.
281281 Pxy *= 1 / (np .abs (windowVals )** 2 ).sum ()
282282
283283 # Also include scaling factors for one-sided densities and dividing by the
284284 # sampling frequency, if desired. Scale everything, except the DC component
285- # and the NFFT/2 component:
285+ # and the NFFT/2 component:
286286 Pxy [1 :- 1 ] *= scaling_factor
287287
288- #But do scale those components by Fs, if required
288+ #But do scale those components by Fs, if required
289289 if scale_by_freq :
290- Pxy [[0 ,- 1 ]] /= Fs
291-
290+ Pxy [[0 ,- 1 ]] /= Fs
291+
292292 t = 1. / Fs * (ind + NFFT / 2. )
293293 freqs = float (Fs ) / pad_to * np .arange (numFreqs )
294294
@@ -315,7 +315,7 @@ def _spectral_helper(x, y, NFFT=256, Fs=2, detrend=detrend_none,
315315 *detrend*: callable
316316 The function applied to each segment before fft-ing,
317317 designed to remove the mean or linear trend. Unlike in
318- matlab , where the *detrend* parameter is a vector, in
318+ MATLAB , where the *detrend* parameter is a vector, in
319319 matplotlib is it a function. The :mod:`~matplotlib.pylab`
320320 module defines :func:`~matplotlib.pylab.detrend_none`,
321321 :func:`~matplotlib.pylab.detrend_mean`, and
@@ -356,7 +356,7 @@ def _spectral_helper(x, y, NFFT=256, Fs=2, detrend=detrend_none,
356356 Specifies whether the resulting density values should be scaled
357357 by the scaling frequency, which gives density in units of Hz^-1.
358358 This allows for integration over the returned frequency values.
359- The default is True for MatLab compatibility.
359+ The default is True for MATLAB compatibility.
360360""" ))
361361
362362@docstring .dedent_interpd
@@ -785,7 +785,7 @@ def prepca(P, frac=0):
785785 - *fracVar* : the fraction of the variance accounted for by each
786786 component returned
787787
788- A similar function of the same name was in the Matlab (TM)
788+ A similar function of the same name was in the MATLAB
789789 R13 Neural Network Toolbox but is not found in later versions;
790790 its successor seems to be called "processpcs".
791791 """
@@ -1732,7 +1732,7 @@ def ispower2(n):
17321732
17331733def isvector (X ):
17341734 """
1735- Like the Matlab (TM) function with the same name, returns *True*
1735+ Like the MATLAB function with the same name, returns *True*
17361736 if the supplied numpy array or matrix *X* looks like a vector,
17371737 meaning it has a one non-singleton axis (i.e., it can have
17381738 multiple axes, but all must have length 1, except for one of
@@ -2719,7 +2719,7 @@ def griddata(x,y,z,xi,yi,interp='nn'):
27192719 # remove masked points.
27202720 if hasattr (z ,'mask' ):
27212721 # make sure mask is not a scalar boolean array.
2722- if a .mask .ndim :
2722+ if a .mask .ndim :
27232723 x = x .compress (z .mask == False )
27242724 y = y .compress (z .mask == False )
27252725 z = z .compressed ()
0 commit comments