1

Is there a python equivalent to zero padding a function? For example in MATLAB:

x1 = 0.5*np.cos(2*np.pi*f1*t)
x1 = [x1, zeros(1,1000)]

Which will pad x1 with 1000 zeros.

magicsword
  • 1,179
  • 3
  • 16
  • 26
  • 1
    Yes, there is: [`np.pad(x1,(0,1000),mode='constant')`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.pad.html) – Brenlla Jun 06 '18 at 20:55
  • Possible duplicate of [Zero pad numpy array](https://stackoverflow.com/questions/38191855/zero-pad-numpy-array) –  Jun 07 '18 at 09:22

0 Answers0