Module lib.filtergraph
Filter graph drawing module.
Subclass of Graph for drawing common filter graphs. Can draw approximations of low-pass, band-pass, notch and high-pass filters.
Info:
- Release: v1.0.0
- Author: Mark Eats
Functions
new (x_min, x_max, y_min, y_max, filter_type, slope, freq, resonance) | Create a new FilterGraph object. |
edit (filter_type, slope, freq, resonance) | Edit a FilterGraph object. |
filter_type () | Get filter type string. |
get_slope () | Get slope value. |
get_freq () | Get frequency value. |
get_resonance () | Get resonance value. |
Functions
- new (x_min, x_max, y_min, y_max, filter_type, slope, freq, resonance)
-
Create a new FilterGraph object.
All arguments optional.
Parameters:
- x_min number Minimum frequency value in Hz for x axis, defaults to 20.
- x_max number Maximum frequency value in Hz for x axis, defaults to 24000.
- y_min number Minimum amplitude value in dB for y axis, defaults to -60.
- y_max number Maximum amplitude value in dB for y axis, defaults to 30.
- filter_type string Type of filter, accepts "lowpass", "bandpass", "notch" or "highpass", defaults to "lowpass".
- slope number Slope value in decibels per octave, defaults to 12.
- freq number Frequency value in Hz, defaults to 2000.
- resonance number Resonance value 0-1, defaults to 0.
Returns:
-
FilterGraph
Instance of FilterGraph.
- edit (filter_type, slope, freq, resonance)
-
Edit a FilterGraph object.
All arguments optional.
Parameters:
- filter_type string Type of filter, accepts "lowpass", "bandpass", "notch" or "highpass", defaults to "lowpass".
- slope number Slope value in decibels per octave, defaults to 12.
- freq number Frequency value in Hz, defaults to 2000.
- resonance number Resonance value 0-1, defaults to 0.
- filter_type ()
-
Get filter type string.
Returns:
-
string
Filter type string.
- get_slope ()
-
Get slope value.
Returns:
-
number
Slope value.
- get_freq ()
-
Get frequency value.
Returns:
-
number
Frequency value.
- get_resonance ()
-
Get resonance value.
Returns:
-
number
Resonance value.