The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 28th, 2024, 2:13pm
Pages: 1
Send Topic Print
How to represent a laplace system in matlab? (Read 7591 times)
neoflash
Community Fellow
*****
Offline

Mixed-Signal
Designer

Posts: 397

How to represent a laplace system in matlab?
Jun 01st, 2009, 8:13pm
 
How can I realize a system H(s)=a-b*e(-s*T) in matlab and view its group delay?

Thanks,
Neo
Back to top
 
 
View Profile   IP Logged
neoflash
Community Fellow
*****
Offline

Mixed-Signal
Designer

Posts: 397

Re: How to represent a laplace system in matlab?
Reply #1 - Jun 1st, 2009, 8:44pm
 
H = tf([3 -1],[1 0],1e-9);
bode(H);

I found that I could represent it as z-tf. Then how can I calculate the group delay?
Back to top
 
 
View Profile   IP Logged
HdrChopper
Community Fellow
*****
Offline



Posts: 493

Re: How to represent a laplace system in matlab?
Reply #2 - Jun 2nd, 2009, 6:30pm
 
Hi Neoflash,

Is not the delay constant here? It looks like a sampler transfer function, which has linear phase or constant delay....

Regards
Tosei
Back to top
 
 

Keep it simple
View Profile   IP Logged
raja.cedt
Senior Fellow
******
Offline



Posts: 1516
Germany
Re: How to represent a laplace system in matlab?
Reply #3 - Jun 4th, 2009, 4:42am
 
hi Neo ,
           could you please explain how did you represented your TF in mat lab? i didn't understand that reply you have given?

Thanks,
Rajasekhar.
Back to top
 
 
View Profile WWW raja.sekhar86   IP Logged
neoflash
Community Fellow
*****
Offline

Mixed-Signal
Designer

Posts: 397

Re: How to represent a laplace system in matlab?
Reply #4 - Jun 6th, 2009, 7:29pm
 
HdrChopper wrote on Jun 2nd, 2009, 6:30pm:
Hi Neoflash,

Is not the delay constant here? It looks like a sampler transfer function, which has linear phase or constant delay....

Regards
Tosei



For a system like: H(s)=a-b*e(-s*T). The group delay is not constant.
Back to top
 
 
View Profile   IP Logged
pancho_hideboo
Senior Fellow
******
Offline



Posts: 1424
Real Homeless
Re: How to represent a laplace system in matlab?
Reply #5 - Jun 8th, 2009, 1:57am
 
neoflash wrote on Jun 1st, 2009, 8:13pm:
How can I realize a system H(s)=a-b*e(-s*T) in matlab and view its group delay?

a=3;
b=1;
Tdelay=1e-9;
H1=tf(a, 1);

H2=tf(b, 1);
set(H2, 'Outputdelay', Tdelay);

% s=tf('s');
% H2=b*exp(-s*Tdelay);

H1=ss(H1);
H2=ss(H2);
Hc=H1-H2;

freq=logspace(3, 10, 2000);

figure(1), bode(Hc, 2*pi*freq)

z=freqresp(Hc, 2*pi*freq);
x=real(squeeze(z));
y=imag(squeeze(z));
df=diff(freq');
dx=diff(x);
dy=diff(y);

freq=freq(1:length(freq)-1);
x=x(1:length(x)-1);
y=y(1:length(y)-1);

Gdelay=-(dy.*x-y.*dx)./(x.^2+y.^2)./(2*pi*df);

figure(2), semilogx(freq, Gdelay)

There is another method to evaluate Group Delay if you approximate Hc(s) as Hd(z).
You can  approximate Hc(s) as Hd(z) by using c2d().
Here Hc(s) means continuous time transfer function, Hd(z) means discrete time transfer function.
After getting Hd(z) as approximation of Hc(s), you can use grpdelay().

Following Hd(z) is Impulse-Invariant Discretization of Hc(s).
Hd=tf([a -b], [1 0], Tdelay);
See result of "doc c2d" in command window of MATLAB.

neoflash wrote on Jun 1st, 2009, 8:44pm:
H = tf([3 -1],[1 0],1e-9);
bode(H);
I found that I could represent it as z-tf. Then how can I calculate the group delay?

Back to top
 
« Last Edit: Jun 8th, 2009, 5:08pm by pancho_hideboo »  
View Profile WWW Top+Secret Top+Secret   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.