DC gain for FIR high-pass filter using fir1
Show older comments
Dear signal processing experts,
I'm analysing data with huge low frequency artifacts like DC offset, decay, trend, and so on, so I'm trying to remove these slow component with FIR filter.
However, if I use fir1 in matlab, the low frequency component, especially the DC component is not removed completely. Actually, when I check the cofficients:
>> b = fir1(500,5/750,'high');
>> sum(b)
ans =
0.0039
So there's about 0.39% of the original DC component still remain in the filtered data, which is still very large.
This is quite in contrast with low-pass filter:
>> b = fir1(500,5/750,'low');
>> 1-sum(b)
ans =
0
In order to remove DC component by FIR filter, I thought upon two options:
- (1) Apply low-pass filter and subtract the filtered signal from the original.
- (2) Force filter coefficient to zero-mean:
>> b = fir1(500,5/750,'high');
>> b = b-mean(b);
>> sum(b)
ans =
5.5511e-17 % this is small enough
My questions are:
- Are the methods (1) and (2) above acceptable?
- What is the best way to handle this (remove slow components, esp DC offset)?
Thank you in advance for your kind attention and advice.
Best,
Masao
Accepted Answer
More Answers (0)
Categories
Find more on Frequency Transformations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



