adis300 / filter-c

Elegant Butterworth and Chebyshev filter implemented in C, with float/double precision support. Works well on many platforms. You can also use this package in C++ and bridge to many other languages for good performance.
MIT License
145 stars 35 forks source link

The high-pass filter oscillates. #4

Closed KOUKILEO closed 6 months ago

KOUKILEO commented 10 months ago

After I use a 0.5Hz high-pass filter, small signals will turn into sawtooth waves. However, if I use a 10Hz low-pass filter, there is no problem. I use arduino external ADC and use this filter HPF: BWHighPass* filter = create_bw_high_pass_filter(3, 400, 0.5); Serial.println(bw_high_pass(filter,adcv[2]),6); image

LPF: BWLowPass* filter = create_bw_low_pass_filter(3, 400, 10); Serial.println(bw_low_pass(filter,adcv[2]),6); image

adis300 commented 8 months ago

Seems normal. The signal oscillates at a very small amplitude. High-pass filter allows high frequency components to stay.

After I use a 0.5Hz high-pass filter, small signals will turn into sawtooth waves. However, if I use a 10Hz low-pass filter, there is no problem. I use arduino external ADC and use this filter HPF: BWHighPass* filter = create_bw_high_pass_filter(3, 400, 0.5); Serial.println(bw_high_pass(filter,adcv[2]),6); image

LPF: BWLowPass* filter = create_bw_low_pass_filter(3, 400, 10); Serial.println(bw_low_pass(filter,adcv[2]),6); image