10000 DOC: note decibel (dB) scale for specgam · ivanov/matplotlib@5b52fc3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b52fc3

Browse files
committed
DOC: note decibel (dB) scale for specgam
1 parent 2044223 commit 5b52fc3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/axes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8610,6 +8610,7 @@ def specgram(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
86108610
- *bins* are the time points the spectrogram is calculated over
86118611
- *freqs* is an array of frequencies
86128612
- *Pxx* is an array of shape `(len(times), len(freqs))` of power
8613+
measured in decibels (dB)
86138614
- *im* is a :class:`~matplotlib.image.AxesImage` instance
86148615
86158616
Note: If *x* is real (i.e. non-complex), only the positive
@@ -8626,6 +8627,7 @@ def specgram(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
86268627
Pxx, freqs, bins = mlab.specgram(x, NFFT, Fs, detrend,
86278628
window, noverlap, pad_to, sides, scale_by_freq)
86288629

8630+
# convert to dB
86298631
Z = 10. * np.log10(Pxx)
86308632
Z = np.flipud(Z)
86318633

0 commit comments

Comments
 (0)
0