5

I was watching this video on spatially invariant systems:

And I found the definition a bit confusing, or seems vacuous, because isn't $T[x(n_1 - k_1, n_2 - k_2)] = y(n_1 - k_1, n_2 - k_2)$ always true by definition?

qed
  • 1,083
  • 2
    This is the problem with the notational convention in signal processing... Here $x(n_1,n_2)$ doesn't refer to the value of $x$ at a specific point $(n_1,n_2)$ but to the entire signal $x$. So $x(n_1-k_1,n_2-k_2)$ means the signal $x$ translated by $(k_1,k_2)$. The transformation $T$ acts on the signal as a whole, not pointwise. –  Dec 31 '16 at 16:27
  • 1
    Could you elaborate in an answer with some examples? Thanks! – qed Dec 31 '16 at 17:16

2 Answers2

6

Spatial invariance simply means that shifting the input signal results in an equally shifted output signal. So if the response to an arbitrary signal $x(n_1,n_2)$ is $y(n_1,n_2)$, and the response to a shifted version of the same input signal $x(n_1-k_1,n_2-k_2)$ is $\tilde{y}(n_1,n_2)$, then the system is shift invariant if and only if

$$\tilde{y}(n_1,n_2)=y(n_1-k_1,n_2-k_2)\tag{1}$$

Any system that can be described by the following convolution sum is shift-invariant:

$$y(n_1,n_2)=\sum_{l_1}\sum_{l_2}h(l_1,l_2)x(n_1-l_1,n_2-l_2)\tag{2}$$

where $h(n_1,n_2)$ is the system's impulse response.

EDIT: As requested in the comments, here are some simple examples of shift-variant systems:

  1. $y(n_1,n_2)=x(2n_1,n_2)$
  2. $y(n_1,n_2)=n_1\cdot x(n_1,n_2)$
  3. $y(n_1,n_2)=x(-n_1,-n_2)$

Let's look at the examples above in more detail:

  1. \begin{align*} y(n_1 - d_1, n_2 - d_2) &= x(2(n_1 - d_1), n_2 - d_2) \\ & \ne x(2n_1 - d_1, n_2 - d_2) \end{align*}

  2. \begin{align*} y(n_1 - d_1, n_2 - d_2) &= (n_1 - d_1) & \cdot x(n_1 - d_1, n_2 - d_2) \\ &\ne n_1 & \cdot x(n_1 - d_1, n_2 - d_2) \end{align*}

  3. \begin{align*} y(n_1 - d_1, n_2 - d_2) &= x(-(n_1 - d_1), -(n_2 - d_2)) \\ & \ne x(-n_1 - d_1, -n_2 - d_2) \end{align*}

qed
  • 1,083
Matt L.
  • 10,636
  • Could you add an example? Thanks! – qed Jan 01 '17 at 13:04
  • @qed: Have a look at my edited answer. – Matt L. Jan 01 '17 at 13:17
  • Ok, what is $\tilde{y}$ in your example? – qed Jan 01 '17 at 13:42
  • @qed: As I said in my answer, it's the response to a shifted version of the input signal. Since any system described by the convolution sum (2) is shift-invariant, the condition (1) is satisfied, i.e., $\tilde{y}$ equals the shifted response. – Matt L. Jan 01 '17 at 13:48
  • There are some confusions here. (1) I assume the $k_1, k_2$ used in the summation are quite different from the $k_1, k_2$ used for shifting? (2) There seems to be two interpretations of $y$ here: either as a function of $n_1, n_2$ or as a function of $x(n_1, n_2)$. The second interpretation is not defined, hence the difference between the two is unclear. – qed Jan 01 '17 at 13:57
  • @qed: Fair enough. Even though there was nothing really wrong in any of the equations, I understand the confusion, and for the sake of clarity I've changed the summation indices to $l_1$ and $l_2$. Of course, $y$ depends on $x$ (and also on $h$), and this is not made explicit in the notation. However, this is standard signal processing notation, which has both advantages and disadvantages. Note that the interpretation of $y$ as a response to the input $x$ remains unchanged. – Matt L. Jan 01 '17 at 14:10
  • :-) I don't want to be obnoxious, but I would appreciate a lot if you could post one concrete example of shift variance. – qed Jan 01 '17 at 14:13
  • @qed: No problem, check out my edited answer. – Matt L. Jan 01 '17 at 14:23
  • Great. I have added a bit more detail to your second example. Hopefully I have understood it correctly. – qed Jan 01 '17 at 14:34
  • @qed: Yes, that's correct. – Matt L. Jan 01 '17 at 14:35
  • So it looks like, in general, if you're doing anything more with n1 and n2 than using them as an index into x, you're gonna run into shift-variant territory? – Hash88 Sep 24 '19 at 13:51
  • @Hash88: Yes, also if you use $-n_1$ or, more generally, $a\cdot n_1$ with $a\neq 1$, the system is not shift-variant. – Matt L. Sep 24 '19 at 14:36
  • Makes sense. Thanks @MattL. – Hash88 Sep 25 '19 at 07:55
1

My answer is too late but anyway ...

I was watching this exact slide and got as confused as you! Then I came across your question. I don't fully get Matt L's answer. After some thinking I realized that the main cause of the confusion is how we view the system $T[]$.

I came up with the following explanatory example:

If $T[x(n)]=nx(n)$, what does it mean? It means that the system will multiply the input by $n$. Thus, if we give the system another input function $z(n)$, it will output $nz(n)$.

Thus:

For $x(n)=n$, $T[x(n)]=nx(n)=n\cdot n$.

For $z(n)=n-\tau$, $T[z(n)]=nz(n)=n\cdot(n-\tau)$.

In addition, if $T[]$ is spatially invariant, then $T[x(n-\tau)]=(n-\tau)(n-\tau)$.

However, note that $z(n)$ is indeed $x(n-\tau)$, and the output is $n\cdot(n-\tau)$ rather than $(n-\tau)(n-\tau)$. Thus, $T[]$ is spatial variant.

In general, if the modification applied by the system to the input involves the time $n$, then the system is spatially varying.