I want to rewrite the following double sum as a sum of two terms (eq 3)but I am struggling with the limits in (3).
\begin{align} y(n,m) &= \sum_{i=0}^{N}\sum_{j=0}^{M}h(i,j)x(n-i,m-j) \tag{1}\\ &= h(0,0)x(n,m) + \sum_{j=1}^{M}h(0,j)x(n,m-j) + \sum_{i=1}^{N}\sum_{j=0}^{M}h(i,j)x(n-i,m-j) \tag{2}\\ &= h(0,0)x(n,m) + \color{red}{\sum_{i=?}^{N}\sum_{j=?}^{M}h(i,j)x(n-i,m-j)} \tag{3} \end{align}
can someone please suggest a more elegant way of writing it.
$$\sum_{i=0}^{N}\sum_{j=\max(1-i, 0)}^{M}h(i,j)x(n-i,m-j)$$
When $i=0, \max(1-i,0)=1$
When $i>0, \max(1-i,0)=0$