<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Sigutils Plotting Examples
Step1:  Here is a basic Bode plot using scipy.signal to generate the transfer function.
Step2:  Here is a plot using bode_syss to plot multiple transfer functions on the same graph.
Step3:  Quickly compare different filter parameters using bode_firs.
Step4:  Plot analog and digital filters together on the same (analog) frequency axis, useful for evaluating digital approximations to analog filters.
Step5:  Plot the poles and zeros of a given digital system.
<ASSISTANT_TASK:>
Python Code:
%matplotlib inline
from __future__ import division
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy import signal
import sigutils
Explanation: Sigutils Plotting Examples
End of explanation
sigutils.bode_sys(signal.butter(4, [100*2*np.pi, 200*2*np.pi], analog=True, btype='bandpass'), xlim=(10, 1000), gain_point=-3)
Explanation: Here is a basic Bode plot using scipy.signal to generate the transfer function.
End of explanation
butter = signal.butter(4, [100*2*np.pi, 200*2*np.pi], analog=True, btype='bandpass')
bessel = signal.bessel(4, [100*2*np.pi, 200*2*np.pi], analog=True, btype='bandpass')
ellip  =  signal.ellip(4, 1, 40, [100*2*np.pi, 200*2*np.pi], analog=True, btype='bandpass')
cheb2  = signal.cheby2(4, 40, [100*2*np.pi*0.75, 200*2*np.pi/0.75], analog=True, btype='bandpass')
fig, (ax1, ax2) = sigutils.bode_syss((butter, bessel, ellip, cheb2), xlim=(40, 480), mag_lim=(-55, 5, 5),)
ax1.legend(['Butter', 'Bessel', 'Ellipt.', 'Cheb.'], loc='lower center')
Explanation: Here is a plot using bode_syss to plot multiple transfer functions on the same graph.
End of explanation
fig, (ax1, ax2) = sigutils.bode_firs((signal.firwin(51, 0.1, nyq=1),
                                     signal.firwin(101, 0.1, nyq=1),
                                     signal.remez(101, [0, 0.085, 0.125, 1], [1, 0], Hz=2),
                                     signal.remez(51, [0, 0.085, 0.125, 1], [1, 0], Hz=2)),
                                     xlim=(0, 0.25), mag_lim=(-60, 0, 10))
Explanation: Quickly compare different filter parameters using bode_firs.
End of explanation
butt = signal.butter(2, 2*np.pi*50, analog=True, output='ba')
fs = 1000
ba = signal.cont2discrete(butt, 1/fs, method='bilinear')[:-1]
sigutils.bode_an_dig((butt,), (ba,), fs, xlog=True, xlim=(1, 500), mag_lim=(-70, 10, 10))
Explanation: Plot analog and digital filters together on the same (analog) frequency axis, useful for evaluating digital approximations to analog filters.
End of explanation
z, p, k = signal.butter(4, 0.5, output='zpk')
sigutils.pole_zero((z, p, k))
z, p, k = signal.ellip(4, 3, 40, 0.5, output='zpk')
sigutils.pole_zero((z, p, k))
freq, resp = signal.freqresp((z, p, k))
fig, ax = sigutils.plot.nyquist(freq, resp)
Explanation: Plot the poles and zeros of a given digital system.
End of explanation
<END_TASK>