Sorry if the question looks pretty naive. My goal is to up-sample a given signal x[n] by a factor of M using the zero order hold interpolation function.

enter image description here

The basic idea of up-sampling is to add M-1 zeros after each sample. So that makes sense. That forms MN new samples, where N is the length of the sampled signal x[n]. Now if I want to apply ZOH should I go and hold each sample value for one sample interval? Say if M=2 the above discrete signal would have become like this after applying ZOH:

enter image description here

Is my understanding correct?

  • $\begingroup$ no, for a regular ZOH, there should be no zeros inserted. only hold $x[n]$ constant until $x[n+1]$ comes along. $\endgroup$ Commented May 17, 2019 at 20:04
  • $\begingroup$ Yes, right, I was wrong. There shouldn't be any zeros inserted. That's the convolution of the signal x[n] with the rect impulse response that forms the reconstructed signal at the output. $\endgroup$
    – dirac16
    Commented May 17, 2019 at 20:13

1 Answer 1


You are correct. There is a trick you can use to code this process very easily. Assuming Matlab syntax, define a rectangular impulse response with M ones:

ir = ones(1,M);

Then, filter the upsampled train of impulses x:

zoh = conv(x,ir);

and you're done!

  • $\begingroup$ Seems cool. But what if I want to apply an FOH interpolation what ir should be then? $\endgroup$
    – dirac16
    Commented May 17, 2019 at 19:58
  • $\begingroup$ by "FOH", do you mean linear interpolation, right? $\endgroup$ Commented May 17, 2019 at 20:05
  • $\begingroup$ Yeah, actually. I think the triangular impulse response can do it, but not sure how to modify ir $\endgroup$
    – dirac16
    Commented May 17, 2019 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.