B) First Order Hold: Iii. Does The Frequency Response Obeys The Sampling Theorem, Explain
B) First Order Hold: Iii. Does The Frequency Response Obeys The Sampling Theorem, Explain
iii. Does the frequency response obeys the sampling theorem, explain.
Ans: The sampling theorem states that if the sampling frequency is sufficiently high relative
to the highest frequency component in a continuous-time signal, the amplitude
characteristics of the original signal can be preserved in the sampled signal. From the
observations, as the sampling period decreases (and the sampling frequency increases), the
response approaches the original continuous-time signal. Theoretically, the sampling
frequency should exceed twice the highest frequency component, but in practice, it is often
taken 10 to 20 times higher to account for distortions caused by physical factors. Increasing
the sampling frequency further enhances the accuracy of the response, confirming that the
frequency response adheres to the sampling theorem.
Conclusion
In conclusion, MATLAB's high-level programming and computational tools enable the effective
mapping of s-domain transfer functions to z-domain using methods like Zero-Order Hold (ZOH),
First-Order Hold (FOH), and the Bilinear Transform (Tustin method). These techniques,
combined with custom scripting, allow precise discretization and analysis of system dynamics.
By studying step and frequency responses, we gain valuable insights into system behavior,
simplifying control system design and advancing digital signal processing.
17
EXPERIMENT – 2
Z - TRANSFORM USING MATLB
A. OBJECTIVE:
The objectives of the experiment are:
1. Learn the application of MATLAB to use it to convert the s-domain transfer function into z-
domain
2. Study the affects in transient response and frequency response of different methods and
sampling time used in z- Transfer function.
B. Z – TRANSFORM
A z-transform method for transient analysis in digital control and electrical power system is a
well proven method. In principle, the z-plane is used in an intermediate transform step between
the frequency-domain and the time domain. Its positive feature in comparison to the Laplace
transform or any other frequency-domain transient analysis method includes its property to
express time domain expression in a direct relation with its coefficients without requiring a
complex variable analysis. Further it can be transferred to a frequency-domain transfer function
as well to get the frequency- domain characteristics. A general z-domain transfer function can be
expressed in the following equation.
n
C ( z) a k Z k
k 0
m
(1)
1 bk Z
R( z ) k
k 1
a k b k
C(t) = k 0 R(t-k ΔT) - k 1 C(t-k ΔT) (2)
A z – transfer function can be composed either from a transient response or from the circuit
parameters.
1
C. CORELATION BETWEEN LAPLACE TRANSFORM AND Z-TRANSFORM
Suppose we sample a continuous time variable f(t). Because the sampled signal exists only at the
sampling instants, the sequence of pulses can be represented mathematically as:
Defining:
This is the definition of the z-transform of a continuous time signal f(t) sampled with a sampling
interval of Ts, i.e.
Thus, the z-transform is merely the Laplace Transform of a sampled data sequence and as such,
inherits many of the properties of the Laplace Transform.
The mapping from the s-plane to the z-plane is accomplished through the relationship
This function maps the whole of the left side of the s-plane to a unit circle on the z-plane:
2
In the case of Laplace transfer functions, systems are stable if they do no possess poles on the
right half of the s-plane. In the case of sampled data systems, they are stable if they do not
possess poles that lie outside the unit-circle in the z-plane.
D. PREPARATORY WORKS:
Before coming to this laboratory the students are advised to gain a clear understanding of:
i. Laplace Transform and z-Transfer function
ii. Transient response using Laplace inverse and inverse z-transform methods
iii. Frequency Responses and their importance
E. LABORATORY WORKS:
This laboratory exercise is basically a simulation of the preparatory work that you should have
done before coming to the lab.
1. Start the MATLAB
2. Type: help c2d
3. Type: help tf
Open a new file and write down the following commands (Note % Are comments)
clear;
DT=2e-3;
order=1; % Becasue here we are going to analyze first order system
ns=[0 1];
ds=[.03 10];
as=tf(ns,ds); % s-domain transfer function
zbi=c2d(as,DT,'tustin'); % z-domain transfer function using bilinear
zfh=c2d(as,DT,'foh'); % z-domain transfer function using first order hold
zzh=c2d(as,DT,'zoh'); % z-domain transfer function using zero order hold
3
b. type zbi ENTER
c. type zfh ENTER
d. type zzh ENTER
T=0:DT:.04;
[ylp,tm]=step(as,T);
[ybi]=step(zbi,T);
[yfh]=step(zfh,T);
[yzh]=step(zzh,T);
plot(tm,ylp,'r',tm,ybi,'b',tm,yfh,'g',tm,yzh);
grid;
Title('Step Response');
xlabel('Time sec')
ylabel ('Value')
9. save and run the program observe the differences in step responses (if any)
10. go back in main program file and type following to compare the frequency response
% Frequency Response
% First is the frequency sampling
startf=1;
decround=6;
f1=1:.1:9.9;
f1=startf*f1;
for l=1:decround
for k=1:90
i=(l-1)*90+k;
f(i)=f1(k)*10^(l-1);
end
end
4
% below is the numerator and denominator of z-transfer function
[nzbi,dzbi]=tfdata(zbi,'v');
[nzfh,dzfh]=tfdata(zfh,'v');
[nzzh,dzzh]=tfdata(zzh,'v');
end
Frqlap(i)=As(i)/Bs(i);
Frqzbi(i)=Abi(i)/Bbi(i);
Frqzfh(i)=Afh(i)/Bfh(i);
Frqzzh(i)=Azh(i)/Bzh(i);
5
end
figure;
semilogx(f,abs(Frqlap),'r',f,abs(Frqzbi),'b',f,abs(Frqzfh),'g', f,abs(Frqzzh));
grid;
Title('Frquency Response');
xlabel('frequency(Hz)')
ylabel ('Value')
% Program Finish
11. save and run the program observe the differences in frequency responses (if any)
12. change the DT=2e-4, save and run the program compare the time and frequency response
from previous one
13. change the DT=2e-6, save and run the program compare the time and frequency response
from previous one
1.42
14. Repeat the procedures for s-domain transfer function G ( s) for sampling
10.9s s 1.42
2
F. OBSREVATIONS
1)
6
After typing as, zbi, zfh and zzh following were observed :
7
2) The step responses of the transfer function from the s-domain to the time domain,
along with their corresponding z-domain equivalents using different data hold circuits,
were observed graphically. Due to overlap in the s-domain graph, it was plotted and
analyzed separately.
Output
8
3)
9
Output
A) For DT = 2e-3
10
B) For DT = 2e-4
C) For DT = 2e-6
11
4) Above program was repeated for second Transfer Function
G(s) = 1.42/ (10.9s^2 + s + 1.42)
12
Output
The step response was plotted as shown below:
13
After typing as, zbi, zfh and zzh following were observed :
14
Fig: Step Response in Frequency Domain of the Z-domain Transfer Function
The continuous-time transfer function exhibited a smooth transition from 1 to 0, with a
noticeable spike (resonance) in its response. In contrast, the discrete-time transfer functions
displayed rapid oscillations at higher frequencies. Upon reducing the sampling time DTDTDT to
0.001, the responses were re-evaluated, and the step responses of the continuous-time and
discrete-time transfer functions were found to nearly overlap. The oscillations have nearly
disappeared at the higher sampling rate. The frequency response of the Z-domain transfer
functions has nearly coincided with S-domain transfer functions.
15
Fig: Step Response in Time Domain of the Z-domain Transfer Functions
G. DISCUSIONS:
i. Discus the effect of sampling time in step and frequency responses.
Ans: From the observations, it was found that decreasing the sampling period from 2e-3
seconds to 2e-6 seconds brings the system's response closer to the original continuous-
time signal. By reducing the sampling period as much as practically feasible, the response
can be made nearly identical to the continuous-time signal.
ii. Describe the differences observed in bilinear transform method and first and zero
order hold method in step and frequency responses.
Ans: Through our experiments, we identified distinct characteristics of each
transformation methods: