MATLAB: What is the difference between using the highpass() command and designing a Butterworth highpass filter

highpass filter filtering high pass filtfilt butter butterworth low lowpass designfiltMATLABMATLAB and Simulink Student Suite

Hey, I‘m new to Matlab and I need to filter a low frequency component of a harmonic signal due to integration with cumtrapz. I saw the highpass() command works quite well. But so far I only read that the best way or „the right way“ is supposed to be designing a Butterworth high pass filter because it can be designed for different orders. I’m just wondering what the difference in efficiency is and why it isn’t that common to just use the highpass() command. Also I read about applying the Butterworth with the filtfilt command but I can’t really see the advantage of that. Maybe someone could help me with that. Thanks very much.

Best Answer

The highpass function designs an elliptical filter. This is a computationally efficient filter with (in my opinion) good passband, transition region, and stopband characteristics. Butterworth designs have their advantages, although (again in my opinion) if your design can tolerate wider transition regions.
Elliptical filters can also be designed for different orders. You will need to use the various elliptical filter design functions to do that. Lower order elliptical filter designs will generally be more efficient than similar-order designs with other filters.
If you use the second ‘d’ output from highpass (or its friends), use it with filtfilt. (I believe the documentation is in error in recommending filter instead.)