recursion formula uses results from http://www-users.cs.york.ac.uk/~fisher/mkfilter/trad.html for low pass Butterworth, 5th order, corner=1000, sampling=10000 note: y[[ ]] refers to an entry number in a Table (or array) ...the entry number is a whole number 1 to max yy[ ] is a function of a real (or even complex) number NOTE: Your filter will have different coefficients and have a different pass-band than this filter, so you must adjust this code for your filter! NOTE2: You must make sure your code does not ask for things like y[[0]] as it does not exist. y=Table[0,{i, 50}] x[n_]=UnitStep[n-6] Do[ y[[n]] = 1 x[n- 5] + 5 x[n- 4] + 10 x[n- 3] + 10 x[n- 2] + 5 x[n- 1] + 1 x[n- 0] + 0.1254306222 y[[n- 5]] + -0.8811300754 y[[n- 4]] + 2.5452528683 y[[n- 3]] + -3.8060181193 y[[n- 2]] + 2.9754221097 y[[n- 1]], {n,6,50}] ListPlot[y, Joined->True, PlotRange->All] w=.5 x[n_]=Exp[I w n] y=Table[0,{i, 100}] Do[ y[[n]] = 1 x[n- 5] + 5 x[n- 4] + 10 x[n- 3] + 10 x[n- 2] + 5 x[n- 1] + 1 x[n- 0] + 0.1254306222 y[[n- 5]] + -0.8811300754 y[[n- 4]] + 2.5452528683 y[[n- 3]] + -3.8060181193 y[[n- 2]] + 2.9754221097 y[[n- 1]], {n,6,100}] ListPlot[Re[y], Joined->True, PlotRange->All] w=1.5 x[n_]=Exp[I w n] y=Table[0,{i, 60}] Do[ y[[n]] = 1 x[n- 5] + 5 x[n- 4] + 10 x[n- 3] + 10 x[n- 2] + 5 x[n- 1] + 1 x[n- 0] + 0.1254306222 y[[n- 5]] + -0.8811300754 y[[n- 4]] + 2.5452528683 y[[n- 3]] + -3.8060181193 y[[n- 2]] + 2.9754221097 y[[n- 1]], {n,6,60}] ListPlot[Re[y], Joined->True, PlotRange->All] ClearAll[w] xx[n_]=Exp[I w n] yy[n_]=Exp[I w n] A[w_]= (1 xx[- 5] + 5 xx[- 4] + 10 xx[- 3] + 10 xx[- 2] + 5 xx[- 1] + 1 xx[- 0] )/ (1-(0.1254306222 yy[- 5] + -0.8811300754 yy[- 4] + 2.5452528683 yy[- 3] + -3.8060181193 yy[- 2] + 2.9754221097 yy[- 1])) Plot[Abs[A[w]],{w,.01,Pi}] Show[GraphicsGrid[{{%9,%14},{%4,%19}}]] --- additional example: signal+noise filtered w=.5 ClearAll[x] x=Table[Re[ Exp[I w n] ]+(RandomReal[] - 1/2),{n, 100}]; x[[1]]=0; x[[2]]=0; x[[3]]=0; x[[4]]=0; x[[5]]=0; ListPlot[x, Joined->True, PlotRange->All] y=Table[0,{i, 100}] Do[ y[[n]] = 1 x[[n- 5]] + 5 x[[n- 4]] + 10 x[[n- 3]] + 10 x[[n- 2]] + 5 x[[n- 1]] + 1 x[[n- 0]] + 0.1254306222 y[[n- 5]] + -0.8811300754 y[[n- 4]] + 2.5452528683 y[[n- 3]] + -3.8060181193 y[[n- 2]] + 2.9754221097 y[[n- 1]], {n,6,100}] ListPlot[y, Joined->True, PlotRange->All]