I want to implement a high pass filter (order 4) in MATLAB using cascade form.
[b,a]=butter(4,0.0083,'high');% I am using butterworth filter [sos,gain]=tf2sos(b,a);
Should I use [sos,gain] for implementing the same in cascade form or just [sos]. I read a post related to same and it says just [sos] should be used, however, I am not sure if that is the correct way. P.S. I want to create a MATLAB function for IIR filter(don't want to use the standard filter function in MATLAB) which would get the coefficients b,a & input.