8000 Merge pull request #9753 from jklymak/spectralorder · matplotlib/matplotlib@f84da20 · GitHub
[go: up one dir, main page]

Skip to content

Commit f84da20

Browse files
authored
Merge pull request #9753 from jklymak/spectralorder
FIX: Detrending before windowing _spectral_helper
2 parents c9c3a74 + e661d26 commit f84da20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/mlab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,8 @@ def _spectral_helper(x, y=None, NFFT=None, Fs=None, detrend_func=None,
720720
if not same_data:
721721
# if same_data is False, mode must be 'psd'
722722
resultY = stride_windows(y, NFFT, noverlap)
723-
resultY = apply_window(resultY, window, axis=0)
724723
resultY = detrend(resultY, detrend_func, axis=0)
724+
resultY = apply_window(resultY, window, axis=0)
725725
resultY = np.fft.fft(resultY, n=pad_to, axis=0)[:numFreqs, :]
726726
result = np.conj(result) * resultY
727727
elif mode == 'psd':

0 commit comments

Comments
 (0)
0