일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- Contour
- Android
- Unity
- mfc
- compare
- memory
- Class
- Gaussian
- Gradient
- subpixel
- sensor
- c++
- Encapusulation
- Pointer
- parameter
- aduino
- public
- stream
- wpf
- flutter
- digitalRead
- atmega328
- SERIAL
- Binary
- Filtering
- APP
- edge
- UNO
- Read
- file access
- Today
- Total
폴크(FOLC)
치수 계산하기 - smooth filtering 6 본문
Chebyshev 필터는 클래식 IIR 필터 설계법 중 하나로, 주어진 사양(통과대역 ripple, 차단대역 감쇠, 전이대역 너비)을 만족시키면서 빠른 롤오프(roll-off)를 제공하는 고성능 필터
- 특히 Butterworth 필터보다 짧은 전이대역을 갖지만, **통과대역 또는 저지대역에 ripple(잔류진동)**을 허용합니다.
Chebyshev 필터
- Chebyshev Type I (1형)
- 통과대역에 ripple, 저지대역은 단조롭게 감쇠.
- 롤오프가 Butterworth보다 빠름.
- Chebyshev Type II (2형)
- 저지대역에 ripple, 통과대역은 평탄함.
- Type I보다 덜 사용됨 (주로 특수 목적).
주파수 응답 (Type I)
- : n차 Chebyshev 다항식
- ωc : 컷오프 주파수
- ϵ : ripple 크기 제어 (0일 때 Butterworth와 동일)
예제
#include <vector>
class ChebyshevIIR {
public:
ChebyshevIIR(const double* b, const double* a, int order)
: b(b), a(a), order(order) {
w.assign(order, 0.0);
}
double process(double x) {
double y = b[0] * x + w[0];
for (int i = 1; i < order; ++i) {
w[i - 1] = b[i] * x + w[i] - a[i] * y;
}
w[order - 1] = -a[order] * y;
return y;
}
private:
const double* b;
const double* a;
int order;
std::vector<double> w;
};
#include <iostream>
// (4차 필터)
const double b_cheby[5] = {
0.00183555, 0.0073422, 0.0110133, 0.0073422, 0.00183555
};
const double a_cheby[5] = {
1.0, -3.05433968, 3.82899923, -2.29245173, 0.55074452
};
int main() {
ChebyshevIIR filter(b_cheby, a_cheby, 5); // 4차 → 계수 5개
for (int i = 0; i < 50; ++i) {
double input = (i % 2 == 0) ? 1.0 : -1.0; // 고주파 성분 포함된 신호
double output = filter.process(input);
std::cout << "input: " << input << "\toutput: " << output << std::endl;
}
return 0;
}