In order to obtain the same results as the function 'butter' in MATLAB, uses 'high' and filter order 4 for example
[BB, AA] = butter(4,freq,'high')
Just include the header file and write your own codes based on the example programs.
- bwlp.c-lowpass filter coefficient calculator
- bwhp.c-highpass ilter coefficient calculator
- bwbp.c-bandpass filter coefficient calculator
- bwbs.c-bandstop filter coefficient calculator
These are the official guides but i recommend you to check out my example code butter.cpp
!
Actually if you have finished the program you might find the result different from that in MATLAB.
Just as the question in STACKOVERFLOW.
This bro indeed has brilliant ability to solve this problem, but i strongly recommend you an easier way.
The problem is that the result you got from the code hasn't been normalized, and notice that a variable sff
either in my example code or in bwhp.c.
If you set that to 1, the problem will be solved.
int sff; //scale flag: 1 to scale, 0 to scale ccof
btw. Would someone please help me answer the question on stackoverflow?I don't have any reputation lol.