模块 lib.filtergraph

滤波器图形绘制模块。

Graph的子类,用于绘制常见的滤波器图形。可以绘制低通、带通、陷波和高通滤波器的近似图形。

信息:

  • 版本: v1.0.0
  • 作者: Mark Eats

函数

new (x_min, x_max, y_min, y_max, filter_type, slope, freq, resonance) 创建一个新的FilterGraph对象。
edit (filter_type, slope, freq, resonance) 编辑FilterGraph对象。
filter_type () 获取滤波器类型字符串。
get_slope () 获取斜率值。
get_freq () 获取频率值。
get_resonance () 获取谐振值。


函数

new (x_min, x_max, y_min, y_max, filter_type, slope, freq, resonance)
创建一个新的FilterGraph对象。 所有参数都是可选的。

参数:

  • x_min number x轴的最小频率值(Hz),默认为20。
  • x_max number x轴的最大频率值(Hz),默认为24000。
  • y_min number y轴的最小幅度值(dB),默认为-60。
  • y_max number y轴的最大幅度值(dB),默认为30。
  • filter_type string 滤波器类型,接受"lowpass"、"bandpass"、"notch"或"highpass",默认为"lowpass"。
  • slope number 斜率值(每倍频程分贝),默认为12。
  • freq number 频率值(Hz),默认为2000。
  • resonance number 谐振值0-1,默认为0。

返回:

    FilterGraph FilterGraph实例。
edit (filter_type, slope, freq, resonance)
编辑FilterGraph对象。 所有参数都是可选的。

参数:

  • filter_type string 滤波器类型,接受"lowpass"、"bandpass"、"notch"或"highpass",默认为"lowpass"。
  • slope number 斜率值(每倍频程分贝),默认为12。
  • freq number 频率值(Hz),默认为2000。
  • resonance number 谐振值0-1,默认为0。
filter_type ()
获取滤波器类型字符串。

返回:

    string 滤波器类型字符串。
get_slope ()
获取斜率值。

返回:

    number 斜率值。
get_freq ()
获取频率值。

返回:

    number 频率值。
get_resonance ()
获取谐振值。

返回:

    number 谐振值。
由 LDoc 1.5.0 生成 最后更新 2025-04-06 15:35:25