LADSPA IIR LPF Butterworth 2pole
1pole と同じように2poleのLPFをLADSPAで作ってみる。 上記式から2poleのプロトタイプを計算 LPFを作りたいので、上記式 s に次式を代入する。 LPF: ((z-1)/(z+1)) / (2πfc) fcの中はこんなかんじ。ωcはカットオフ周波数で、fsはサンプリング周波数。 ブロック図は下図を採用。 LPF 2pole Butterworth ソースコード 処理部分以外は1poleとほとんど同じ。 /* namagi_lpf_2p.c 2015.07.29 * LPF Butterworth 2pole * compile windows * gcc -shared -o namagi_lpf_2p.dll namagi_lpf_2p.c -ID * * compile Ubuntu * gcc -fPIC -DPIC -shared -nostartfiles -o namagi_lpf_2p.so namagi_lpf_2p.c */ /**********************************************************/ #include <stdlib.h> #include <string.h> #include <stdio.h> #include <math.h> /**********************************************************/ /*LADSPAのヘッダファイルを読み込む*/ #include "ladspa.h" /**********************************************************/ /* マイクロ定数を定義 コントロールと出力 */ #define LPF_CONTROL 0 #define LPF_INPUT1 1 #define LPF_OUTPUT1 2 /**********************************************************/