×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# ZOH Frequency response and matlab

## ZOH Frequency response and matlab

(OP)

I am struggling little bit in trying to understand the frequency response of the ZOH with matlab. I was wondering if you have any thoughts on this.

Here are few things that I understand ( coorect me if these are not right)

1) ZOH is linear but not Time Invariant

2) The frequency response of the ZOH is given by H_zoh(s)  =( 1- exp(-sT)) / s. This is works for the fundamental component of the ZOH output. Since the actual output of the ZOH consists of lot of high frequency components due to fast transitions.

H_zoh(s) has low pass like characteristics with zero on  multiples of the sampling frequency

3)  c2d(sys,'zoh',Ts) is a matlab function used to discretize continous domain system (sys( to discrete domain with ZOH and sampling time of Ts.

Problem:

To get the frequency response of ZOH I have set the sys = tf(1,1). When I try the bode of resultant discrete system I get perfectly flat response with frequency ( Basically I don't see H_zoh(s) characteristics).

In past I have explicitly used the explicit expression of H_zoh to do analysis in frequency domain. I was wondering why matlab c2d don't take in account the response of the H_zoh ?

Also,

The output of the ZOH can be approximated as input signal delayed by Ts/2 , Ts being the sampling time. I was wondering when is this approximation valid?

I was wondering if you have good reference on his kind of stuff. I looked into following text w/o getting a coherent description of this issue.

1) Franklin and Powell , Digital Control of Dynamic systems.
2) Ogata, Discrete time Control Systems

### RE: ZOH Frequency response and matlab

You might try posting this question at the DSP Blog.

http://www.dsp-bg.info/

### RE: ZOH Frequency response and matlab

EVen posting in the Matlab forum might make more sense.

ZOH cannot be linear, by definition.

TTFN

### RE: ZOH Frequency response and matlab

(OP)
Hi TIFN,

Thanks for your pointer to matlab forum.

Actually I did a bit of search on this. ZOH is linear and this aspect is well documented too.

It satisfies superposition and scaling property. It is sruprinsing but true.  Try it !

-SK

### RE: ZOH Frequency response and matlab

It has discontinuities in the first derivative

TTFN

### RE: ZOH Frequency response and matlab

(OP)
TIFN,

Is discountinuity in first derivative a condition for the system to be Linear ?

I thought following two conditions are suffcient for a systemto be Linear .

1) Superposition : Sum of outputs is same as output of sum of inputs

2) Scaling : Scaling input by a conatct scales output by same factor.

Cheers
-SK

### RE: ZOH Frequency response and matlab

So you're saying that
ZOH(t1+t2) = ZOH(t1)+ZOH(t2)

for any t1 or t2?

TTFN

### RE: ZOH Frequency response and matlab

(OP)
Yes.

Just to make sure i have understood your notation. I am restating it.

Superposition:

Given:
y1(t) = ZOH {x1(t)} and
y2(t) = ZOH {x2(t)}

Implies

y(t) = ZOH {x1(t)+x2(t)}= y1(t)+y2(t)

Scaling:

If y1(t) = ZOH {x1(t)}

Then

a *y1(t) = ZOH {a*x1(t)}

### RE: ZOH Frequency response and matlab

ZOH is a function of sampling time only.

TTFN

### RE: ZOH Frequency response and matlab

In your script you converted sys = tf(1,1) to a discrete system by using c2d(sys,'zoh',Ts).  I interpret this as you asking for MATLAB to convert your flat frequency response continuous system sys into a discrete equivalent using the zoh method. This is different from asking for a digital equivalent of a zoh system.  You got what you asked for.  The zoh equivalent of a flat system is flat, not a zoh system.
sysZohA = tf( 1, 1 );, Ts = 1;, c2d( sysZohA, Ts, 'zoh' )
gives: Transfer function: 1

Since you have stated that the zoh is already known to be H_zoh(s)  =( 1- exp(-sT)) / s, you could ask MATLAB to determine the best fit discrete system.  We could use a Pade approximation of the delay exp(-sT), then build the zoh(s).  [ bPade, aPade ] = pade( Ts, 5 );, sysZohA = tf( [ aPade - bPade ], [ bPade 0 ] )
Transfer function:
-2 s^5 - 840 s^3 - 3.024e004 s
---------------------------------------------------------------
s^6 - 30 s^5 + 420 s^4 - 3360 s^3 + 1.512e004 s^2 - 3.024e004 s
This will get you an approximation to a ZOH in the continuous s domain. Then sysZohD = c2d( sysZohA, Ts, 'zoh' ) should work.  I have not chekced to see if the order is backwards, but it should be a discrete approximation using the zoh method of an approximation to a continuous domain approximation of the zoh.
John Solar

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

#### Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a partâ€™s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!