How can I apply a butterworth filter using imfilter?

3 views (last 30 days)
Hi all- I'm trying to use imfilter to apply a 1-D Butterworth filter to each pixel of a time series... I'm using imfilter to vectorize my filtering instead of looping over each pixel. The only ways to create a Butterworth filter I can find are...
[a,b] = butter(...) - numerator and denominator form
[z,p,k] = butter(...) - zero & pole form
[A,B,C,D] = butter(...) - state space form
d=fdesign.highpass(...);hd=design(d,'butter'...); - filter object form
From the documentation in imfilter and fspecial, it looks like imfilter takes a filter as a 'correlation kernel'.. I see there are functions to convert z-p to 'SOS' form,'transfer function polynomials','state-space' form, but none to get the 'correlation kernel' out of it which I can use to apply the filter using imfilter. And as for the filter object created with fdesgin, the only thing I can get out of it is the 'SOS matrix', and the 'scale values'.
Is there a way to get this correlation kernel for a Butterworth filter so that I can apply it using imfilter? So for example I would have a filter b which I could make 1-D and apply to my matrix with...
b=myfilter;
H = ones(1,1,length(b));
H(1,1,:)=b;
M_filtered=imfilter(M,H)
Forgive me if I'm missing something obvious about filter design(I'm no expert yet) and thanks in advance!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!