Skip to content

scipy/legacy-signal

Rule legacy-signal
Pack SciPy
Severity info
Fix safe, with xpd check --fix
Library versions every version

SciPy marks signal.stft, spectrogram and similar functions as legacy. Use a ShortTimeFFT object and its method of the same purpose.

w, h = signal.sosfreqz(sos, worN=512)
w, h = signal.freqz_sos(sos, worN=512)

The rule reports signal.stft, istft, spectrogram and check_COLA, which SciPy marks as legacy in favor of the ShortTimeFFT class. It also reports signal.sosfreqz, a legacy alias of freqz_sos, but not on SciPy older than 1.15.

xpd check --fix applies the fix of this rule.

The safe fix writes freqz_sos for sosfreqz, whose body only calls freqz_sos. The other forms have no fix.

xpd prints this message with the issue. A name that starts with $ stands for code from your file.

SciPy marks signal.$F as a legacy function. Write a ShortTimeFFT object and call its method of the same purpose, such as stft or spectrogram.

Browse the other rules of the SciPy pack.