Class 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

Methods

FilterGraph:new (x_min, x_max, y_min, y_max, filter_type, slope, freq, resonance) Create a new FilterGraph object.
FilterGraph:edit (filter_type, slope, freq, resonance) Edit a FilterGraph object.
FilterGraph:filter_type () Get filter type string.
FilterGraph:get_slope () Get slope value.
FilterGraph:get_freq () Get frequency value.
FilterGraph:get_resonance () Get resonance value.


Methods

FilterGraph: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.
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.
FilterGraph:filter_type ()
Get filter type string.

Returns:

    string Filter type string.
FilterGraph:get_slope ()
Get slope value.

Returns:

    number Slope value.
FilterGraph:get_freq ()
Get frequency value.

Returns:

    number Frequency value.
FilterGraph:get_resonance ()
Get resonance value.

Returns:

    number Resonance value.
generated by LDoc 1.4.6 Last updated 2020-03-28 23:45:19