No account yet ?
Tested in Anaconda and Python 3.7
from scipy import signal import matplotlib.pyplot as plt import numpy as np N, Wn = signal.buttord([20, 50], [14, 60], 3, 40, True) b, a = signal.butter(N, Wn, 'band', True) w, h = signal.freqs(b, a, np.logspace(1, 2, 500)) plt.semilogx(w, 20 * np.log10(abs(h))) plt.title('Butterworth bandpass filter fit to constraints') plt.xlabel('Frequency [radians / second]') plt.ylabel('Amplitude [dB]') plt.grid(which='both', axis='both') plt.fill([1, 14, 14, 1], [-40, -40, 99, 99], '0.9', lw=0) # stop plt.fill([20, 20, 50, 50], [-99, -3, -3, -99], '0.9', lw=0) # pass plt.fill([60, 60, 1e9, 1e9], [99, -40, -40, 99], '0.9', lw=0) # stop plt.axis([10, 100, -60, 3]) plt.show()
Tested in Anaconda and Python 3.7
from scipy import signal import matplotlib.pyplot as plt import numpy as np b, a = signal.butter(4, 100, 'low', analog=True) w, h = signal.freqs(b, a) plt.semilogx(w, 20 * np.log10(abs(h))) plt.title('Butterworth filter frequency response') plt.xlabel('Frequency [radians / second]') plt.ylabel('Amplitude [dB]') plt.margins(0, 0.1) plt.grid(which='both', axis='both') plt.axvline(100, color='green') # cutoff frequency plt.show()
Butterworth(x) = 1 / (1 + (x/D0)2n)
Fourier transform of the gate function
Sinus cardinal = sin(PI.t) / (PI.t)
Welcome, my name is Eric Soupet and I am the administrator of the site elodees.com. elodees.com is a state of the art of Artificial Intelligence and aims to be collaborative, you can now offer content such as articles, events, tutorials, ... so don't hesitate !
Platform images credit : Pixabay - Pixabay License | Pexels - Pexels License