-
Notifications
You must be signed in to change notification settings - Fork 45
Description
For odd filter orders a pair of real poles get added rather than a single pole, don't think that is right. In Butterworth::prototypeAnalogLowPass(int filterOrder) rather than
for(uint32_t k = 0; k < (filterOrder + 1) / 2; k++){
double theta = (double)(2 * k + 1) * M_PI / (2 * filterOrder);
double real = -sin(theta);
double imag = cos(theta);
poles.push_back(complex_double(real, imag));
poles.push_back(complex_double(real, -imag)); // conjugate
}
might need something like
for(uint32_t k = 0; k < filterOrder / 2; k++){
double theta = (double)(2 * k + 1) * M_PI / (2 * filterOrder);
double real = -sin(theta);
double imag = cos(theta);
poles.push_back(complex_double(real, imag));
poles.push_back(complex_double(real, -imag)); // conjugate
}
if (filterOrder % 2 == 1){
poles.push_back(complex_double(-1, 0);
}
`