要移值的matlab函数:
h3 = fir1(16,[0.25 0.50]);
C语言版本
#include <iostream>
#include <cmath>#define PI acos(-1)double sincEasy(double *x, int len, int index) {double temp = PI * x[index];if (temp == 0) {return 1.0; // sinc(0) = 1}return sin(temp) / temp;
}double* fir1(int lbflen, double Wn[], double lbf[]) {double alpha = 0.5</