Note
Go to the end to download the full example code
freqz
style example#
There are a number of different styles available when using
freqz()
and related methods.
The currently available styles are:
'stacked'
- Magnitude and phase in two separate subplots (default)
'twin'
- Magnitude and phase in same plot
'magnitude'
- Magnitude
'phase'
- Phase
'group_delay'
- Group delay
'tristacked'
- Magnitude, phase, and group delay in three separate subplots
import matplotlib.pyplot as plt
from scipy import signal
from mplsignal import freqz
b, a = signal.ellip(7, 1, 60, 0.4)
for style in ('stacked', 'twin', 'magnitude', 'phase', 'group_delay', 'tristacked'):
plt.figure()
fig = freqz(num=b, den=a, style=style)
fig.suptitle(f"style={style!r}")
fig.show()
Total running time of the script: (0 minutes 1.140 seconds)