Transposed convolutional layer
1D nearest neighbor interpolation is $K = \begin{bmatrix}1 &amp; 1 &amp; 0\end{bmatrix}^T$ or $K = \begin{bmatrix}0 &amp; 1 &amp; 1\end{bmatrix}^T$. This depends on whether your library flips the kernel (i.e. cross correlation vs convolution). To increase the sampling frequency just increase the kernel size e.g. $\begin{bmatrix}0 &amp; 1 &amp; 1 &amp; 1 &amp; 0\end{bmatrix}$. See also my other answer.
For 2D NN interpolation compute the outer product $K^TK = \begin{bmatrix}0 &amp; 0 &amp; 0\\0 &amp; 1 &amp; 1\\0 &amp; 1 &amp; 1\end{bmatrix}$.