Generate IIR Low Pass Filter with difference equation format. (MATLAB code) You may make use of the coefficient to your code.
Edit the below variable along with your intention.
fc = 20; %Hz Cutoff frequency
fa = 2*fc; %Hz Attenuation frequency
Ma = -10; % dB Attenuation magnitude
fs = 200; %Hz Sampling frequency
This code also plots the position of poles which should be inside of a radius 1 circle.