`scipy.signal` to‐do list
Lucas Colley edited this page Apr 24, 2024
·
2 revisions
- Document filter representations (maybe in signal.rst? or else in individual function docstrings and link to each other)
https://github.com/scipy/scipy/issues/3754-
tf
(added to tf2zpk Notes) -
zpk
-
ss
-
sos
-
-
zpk2sos
:- Optimal pairing of poles and zeros to maximize SNR
- Is this different for analog vs digital?
https://github.com/scipy/scipy/pull/3717#issuecomment-46430634
- Is this different for analog vs digital?
- Add
order={'up', 'down'}
argument to reverse section order - Add
zeroflag={True, False}
argument for pairing real zeros - Add
scale={None, 'inf', 'two'}
argument to output section scaling vector and optimization-
sos = zpk2sos(z, p, k, scale=None)
default, no g vector -
sos, g = zpk2sos(z, p, k, scale='two')
, returns a g vector too - https://github.com/scipy/scipy/pull/3717#issuecomment-45426872
-
- Other examples:
sos = zpk2sos(z, p, k)
sos = zpk2sos(z, p, k, order='down')
sos, g = zpk2sos(z, p, k, order='up', scale='inf')
sos, g = zpk2sos(z, p, k, 'down', 'two', True)
- Default:
def zpk2sos(z, p, k, order='up', scale=None, zeroflag=False)
- Optimal pairing of poles and zeros to maximize SNR
-
sosfilt
- Add a gain/scaling vector input? https://github.com/scipy/scipy/pull/3717#issuecomment-45427286
- Last argument?
def sosfilt(sos, x, axis=-1, zi=None, g=1)
-
k=
org=
?
-
- Or it could be a tuple as the first parameter
y = sosfilt((sos, g), x)
(goes with the "tuples are filter objects" theme)
- Last argument?
- could be smart about first-order sections and save a little time computing them https://github.com/Eric89GXL/scipy/pull/1
- Option for Biquadratic vs. Direct-from II implementations, for numerical accuracy
- Add a gain/scaling vector input? https://github.com/scipy/scipy/pull/3717#issuecomment-45427286
-
lfilter
- actually
lfilter
could be smarter about exact zeros anywhere in a transfer function and save time by not computing them?
- actually
-
filtfilt
- Make it do forward-reverse sos filtering, or make a new function for this
sosfiltfilt
? → sosfiltfilt
- Make it do forward-reverse sos filtering, or make a new function for this
-
sos2tf
- Should strip trailing zeros? https://github.com/scipy/scipy/pull/3717#issuecomment-45822044
-
tf2zpk
:- Add
var={'s', 'z', 'z^-1'}
argument for emulating bothtf2zp
andtf2zpk
from matlab.-
's'
and'z'
work as it currently does, like Matlab'stf2zp
-
'z^-1'
works like Matlab'stf2zpk
- For common filters where M == N, there's no difference.
-
- Same for
tf2ss
,tf2sos
, etc.
- Add
-
zpk2ss
- Add
form={'controllable', 'observable', 'cascade', 'jordan', ...}
parameter - Uses
tf2ss(*zpk2tf
, and tf is lossy numerically, so if other forms allow better numerical behavior, convert to those directly, not through tf. https://github.com/scipy/scipy/issues/5912 - zpk2ss uses a zeros-along-the-diagonal form by default and tf2ss uses controllable canonical form by default? since these are the most similar to the source representation?
- Add
-
cplxpair
- Print the pair that caused the exception
- Accept N-D array inputs
-
freqz
andfreqs
- needs to support some filter representations other than lossy
tf
https://github.com/scipy/scipy/issues/3259
- needs to support some filter representations other than lossy
- Optimum L filters?
- Make a filter design function?
- Add to SciPy
- Bessel filters
- All 3 normalizations
- Higher orders than 25
- https://gist.github.com/endolith/3f74c4ec9ea623812cca
https://github.com/scipy/scipy/issues/3763- Modify
besselap
-
Modifybessel
https://github.com/scipy/scipy/pull/5279 - Add example of time-domain filtering of digital signal?
-
_zpklp2hp
, etc- Make public versions of these functions, or somehow combine with existing ones
-
https://github.com/scipy/scipy/pull/3085(used private functions for now) - https://github.com/scipy/scipy/issues/3259 (maybe needs new API)
-
convolve
andcorrelate
- Speed up by calling
fftconvolve
- new parameter
method={'fft', 'direct', 'auto'}
https://github.com/scipy/scipy/issues/2651
- new parameter
-
axis=
parameter (requires C changes? or could be hacked in as afor
loop)
- Speed up by calling
- Window functions:
-
chebwin
- Change to frequency domain normalization so center bump is 1 instead of spikes
https://github.com/scipy/scipy/issues/2221 - use DCT to be faster?
- Change to frequency domain normalization so center bump is 1 instead of spikes
-
slepian
-
Fix normalization https://github.com/scipy/scipy/issues/2221 - Confirm correctness
-
-
exact_blackman
http://zone.ni.com/reference/en-XX/help/372058H-01/rfsapropref/pnirfsa_spectrum.fftwindowtype/ -
general_blackman
http://en.wikipedia.org/wiki/Window_function#Blackman_windows- or add a
a=0.16
parameter to the existingblackman
- or add a
-
blackmanharris
- add 7-term version or n-term? http://zone.ni.com/reference/en-XX/help/372058H-01/rfsapropref/pnirfsa_spectrum.fftwindowtype/
-
-
buttord
etc- Double check all 16 cases to see that frequency tightness is on correct side https://github.com/scipy/scipy/issues/3219#issuecomment-33168829
-
dct
- implement all 8 types and therefore odd-order DFT sizes? http://en.wikipedia.org/wiki/Discrete_cosine_transform#DCT_V-VIII
- This could be used in chebwin, for instance
-
handle integer input better https://github.com/scipy/scipy/pull/2776- Needs unit tests
- implement all 8 types and therefore odd-order DFT sizes? http://en.wikipedia.org/wiki/Discrete_cosine_transform#DCT_V-VIII
- biquad cookbook functions
- Add all the types
- https://gist.github.com/endolith/5455375
- Combine them where possible (
btype={'low', 'high'}
, etc)
-
lti
- Printable representation of transfer functions?
- Discrete-time systems (
https://github.com/scipy/scipy/issues/2912,https://github.com/scipy/scipy/pull/4881)
-
decimate
- use
sosfiltfilt
instead oflfilter
(partly implemented by parameterzero_phase
) - Polyphase FIR implementation to save processing time
- use