当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Processing BandPass.set()用法及代码示例


Processing, 类BandPass中的set()用法介绍。

用法

  • .set(freq, bw)

参数

  • freq (float) 设置频率
  • bw (float) 设置带宽

返回

  • void

说明

使用一种方法设置滤波器的频率和带宽。

例子

import processing.sound.*;

WhiteNoise noise;
BandPass bandPass;

void setup() {
  size(640,360);
  background(255);
    
  // Create a noise generator and a bandpass filter
  noise = new WhiteNoise(this);
  bandPass = new BandPass(this);    

  // start the noise generator and the filter
  noise.play(0.5);
  bandPass.process(noise);
}      

void draw() {
}

void mousePressed() {
  float freq=1000;
  float bw=80;
  bandPass.set(freq, bw);
}

相关用法


注:本文由纯净天空筛选整理自processing.org大神的英文原创作品 BandPass.set()。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。