0
0
SciPydata~10 mins

IIR filter design (butter, cheby1) in SciPy - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to design a Butterworth lowpass filter with cutoff frequency 0.3.

SciPy
from scipy.signal import [1]

b, a = [1](4, 0.3, btype='low')
Drag options to blanks, or click blank then click option'
Afirwin
Bcheby1
Cbutter
Dlfilter
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'cheby1' instead of 'butter' for Butterworth filter design.
Confusing filter design functions with filtering functions like 'lfilter'.
2fill in blank
medium

Complete the code to design a Chebyshev type I highpass filter with 3 dB ripple and cutoff frequency 0.4.

SciPy
from scipy.signal import cheby1

b, a = cheby1(5, [1], 0.4, btype='high')
Drag options to blanks, or click blank then click option'
A1
B3
C0.5
D0.1
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing the ripple parameter with cutoff frequency.
Using values less than 1 dB which might be too small for this example.
3fill in blank
hard

Fix the error in the code to design a Butterworth bandpass filter between 0.2 and 0.5.

SciPy
from scipy.signal import butter

b, a = butter(4, [1], btype='bandpass')
Drag options to blanks, or click blank then click option'
A[0.2, 0.5]
B0.5
C0.35
D0.2, 0.5
Attempts:
3 left
💡 Hint
Common Mistakes
Passing two separate arguments instead of a list for cutoff frequencies.
Using a single float value for bandpass cutoff.
4fill in blank
hard

Fill both blanks to create a Chebyshev type I bandstop filter with order 3, ripple 2 dB, and cutoff frequencies 0.3 and 0.6.

SciPy
from scipy.signal import cheby1

b, a = cheby1([1], [2], [0.3, 0.6], btype='bandstop')
Drag options to blanks, or click blank then click option'
A3
B2
C4
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping order and ripple values.
Using ripple values too large or too small.
5fill in blank
hard

Fill all three blanks to create a Butterworth lowpass filter of order 6 with cutoff 0.25 and design it using 'butter'.

SciPy
from scipy.signal import [1]

b, a = [1]([2], [3], btype='low')
Drag options to blanks, or click blank then click option'
Abutter
B6
C0.25
Dcheby1
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing 'butter' and 'cheby1' in the same code.
Using incorrect order or cutoff values.