We implemented a first order low pass filter in Matlab with a cuttoff frequency of 2 rad/s. The code is the following:
CODE:
clear all; clc; close all;
sampFrequ = 20; %in Hz
sampleTime = 1/sampFrequ
wc = 2
tf_filter = tf([wc],[1 wc])
filter_discrete = c2d(tf_filter,sampleTime,'zoh')
Results:
filter_discrete =
0.09516
----------
z - 0.9048
Sample time: 0.05 seconds
Discrete-time transfer function.
The following formula was obtained using a ZOH.