System properties (linearity, time invariance, causality, stability), LTI systems, the impulse response, the convolution sum, and system interconnections
2.1 Discrete-Time Systems
2.1.1 The system operator
A discrete-time system(離散時間系統) is a transformation $T\{\cdot\}$ that maps an
input sequence $x[n]$ into an output sequence $y[n]$:
DT System
$$y[n] = T\{x[n]\}$$
The operator $T$ may act on the entire input sequence: in general, the output sample
$y[n]$ at one time index can depend on input samples $x[k]$ at all indices $k$ — past,
present, and future. Everything in this chapter is about classifying systems by which
samples they use and how they combine them.
Most of DSP theory (frequency response, $z$-transform analysis, filter design) applies only to
the special class of linear time-invariant(線性非時變) systems. The first job when
you meet a new system is to test its properties — that decides which analysis tools you may use.
2.1.2 Example: moving average (MA)
The moving average(移動平均) system computes, for each $n$, the average of the
input over a sliding window. The general (possibly non-causal) form averages $M_1$ future and
$M_2$ past samples:
Moving Average
$$y[n] = \frac{1}{M_1+M_2+1}\sum_{k=-M_1}^{M_2} x[n-k]$$
The common causal $M$-point moving average uses only the present and past
$M-1$ samples:
Causal M-point MA
$$y[n] = \frac{1}{M}\sum_{k=0}^{M-1} x[n-k]$$
The MA is the simplest smoother(平滑器): averaging adjacent samples cancels
rapid, zero-mean fluctuations (noise) while approximately preserving slow trends.
Fig. 2-1 shows a noisy sequence and the output of a 5-point MA.
Fig. 2-1 — A noisy sequence (top) and the output of a causal 5-point moving average (bottom). The averaging suppresses the zero-mean noise while tracking the slow trend, at the cost of a small delay(移動平均抑制雜訊,但引入少量延遲).
Tip — MA is an FIR filter
The $M$-point moving average is a finite impulse response (FIR) filter with impulse response
$h[n] = 1/M$ for $0 \le n \le M-1$ (see §2.3.2). In MATLAB: y = conv(x, ones(1,M)/M).
Larger $M$ means stronger smoothing but more delay and more blurring of fast features.
2.1.3 Example: accumulator
The accumulator(累加器) sums all input samples up to the present time — the
discrete-time analogue of an integrator:
Accumulator
$$y[n] = \sum_{k=-\infty}^{n} x[k]$$
Splitting off the newest term gives the equivalent recursive(遞迴) form, which is how
you would actually implement it:
Recursive Form
$$y[n] = y[n-1] + x[n]$$
For example, with input $x[n]=n\,u[n]$ the output is
$y[n] = \sum_{k=0}^{n} k = \frac{n(n+1)}{2}\,u[n]$ — the running sum grows like $n^2$.
The accumulator will reappear twice in this chapter: as a system that is linear, time-invariant,
causal but unstable (§2.2.5), and as the classic example of an invertible system (§2.5.4).
2.2 Classes of Discrete-Time Systems
Five properties are tested over and over in this course. For each one you should know the
formal definition, a standard example, and a standard counterexample.
2.2.1 Memoryless systems
A system is memoryless(無記憶)if $y[n]$ depends only on $x[n]$ at the
same index $n$. Example: $y[n]=\left(x[n]\right)^2$. Counterexample: the MA and the
accumulator both use past samples, so they have memory.
2.2.2 Linearity
A system $T$ is linear(線性) if it satisfies superposition: for all signals
$x_1, x_2$ and all constants $a, b$,
Superposition combines two requirements: additivity(可加性)
$T\{x_1+x_2\}=T\{x_1\}+T\{x_2\}$ and homogeneity / scaling(齊次性)
$T\{a\,x\}=a\,T\{x\}$. Three slide examples:
(2) Squarer $y[n]=\left(x[n]\right)^2$ — nonlinear.
Scaling test: input $a\,x[n]$ produces $a^2 x^2[n] \ne a\,x^2[n]$ for general $a$.
One failed test is enough.
(3) Affine system $y[n]=c\,x[n]+d$ ($d\neq0$) — nonlinear.
Zero input gives $y[n]=d\neq 0$. A linear system must map the zero signal to the zero signal
(set $a=b=0$ in the definition). A line that misses the origin is affine, not linear.
仿射系統 $y[n]=c\,x[n]+d$($d\neq0$)——非線性。零輸入會得到 $y[n]=d\neq 0$;
線性系統必須把零訊號映射到零訊號(在定義中令 $a=b=0$ 即可看出)。
一條不通過原點的直線是仿射(affine),而非線性。
If $x[n]=0$ for all $n$ does not produce $y[n]=0$ for all $n$, the system is
not linear — no further work needed. But the converse fails: zero-in/zero-out does
NOT prove linearity (e.g. $y[n]=x^2[n]$ passes the zero test yet is nonlinear). To prove
linearity you must verify superposition for arbitrary $a, b, x_1, x_2$.
2.2.3 Time (shift) invariance
A system is time-invariant(非時變), also called shift-invariant, if delaying
the input only delays the output by the same amount — the system's behaviour does not change
with time:
Time Invariance
$$\text{if } y[n] = T\{x[n]\},\ \text{then}\quad T\{x[n-n_0]\} = y[n-n_0] \quad \text{for every integer } n_0$$
How to test: (i) shift the input first, push it through the system to get
$w[n]=T\{x[n-n_0]\}$; (ii) shift the original output to get $y[n-n_0]$; (iii) compare. They must
agree for every $x$ and every $n_0$.
Example 2.2 — Two shift-invariance counterexamples
(1) Compressor (down-sampler) $y[n]=x[Mn]$, $M\ge 2$ — time-varying.
Shifted input: $w[n] = x[Mn-n_0]$. Shifted output: $y[n-n_0] = x[M(n-n_0)] = x[Mn - Mn_0]$.
Since $Mn_0 \neq n_0$ for $M \ge 2$, $w[n] \neq y[n-n_0]$ in general. Intuition: the compressor
re-labels the time axis, so "when a sample happens" matters.
(2) Time-weighted gain $y[n]=n\,x[n]$ — time-varying.
Shifted input: $w[n]=n\,x[n-n_0]$. Shifted output: $y[n-n_0]=(n-n_0)\,x[n-n_0]$. These differ by
$n_0\,x[n-n_0]$. The gain applied to a sample depends on the clock, not just the sample.
A system is causal(因果) if $y[n_0]$ depends only on input samples $x[n]$ with
$n \le n_0$ — present and past, never the future. Causality is mandatory for real-time
processing; offline (stored-data) processing can afford non-causal systems.
Backward difference $y[n] = x[n]-x[n-1]$: uses only present and
past → causal.
Likewise the centered MA ($M_1>0$ in §2.1.2) is non-causal, while the
$M$-point causal MA is causal. A non-causal FIR system can always be made causal by adding
enough delay.
工程折衷——用延遲換因果:想要非因果的理想響應(例如零相位濾波器)時,
可先暫存幾筆樣本、晚一點再輸出,把「等待」換成「看到未來」。
例如 $y[n]=x[n+1]-x[n]$(非因)整體延遲 1 拍後變成 $y'[n]=y[n-1]=x[n]-x[n-1]$,就成了因果的後向差分。
這也是「A non-causal FIR system can always be made causal by adding enough delay」那句話的意思。
To prove instability you only need one bounded input whose output blows up. The classic
victim is the accumulator: feed it the bounded step $x[n]=u[n]$ and the output is the unbounded
ramp $y[n]=(n+1)u[n]$ — see Fig. 2-4.
Fig. 2-4 — The accumulator driven by the bounded unit step produces the unbounded ramp y[n]=(n+1)u[n]: one bounded input with an unbounded output proves the accumulator is not BIBO stable(累加器不穩定:有界輸入產生無界輸出).
★ Important — System properties at a glance(重要:系統性質總表)
System
Memoryless
Linear
Time-inv.
Causal
Stable
Ideal delay $y[n]=x[n-n_d]$, $n_d>0$
No
Yes
Yes
Yes
Yes
Causal $M$-point MA
No
Yes
Yes
Yes
Yes
Centered MA ($M_1>0$)
No
Yes
Yes
No
Yes
Accumulator
No
Yes
Yes
Yes
No
Compressor $y[n]=x[Mn]$
No
Yes
No
No
Yes
$y[n]=n\,x[n]$
Yes
Yes
No
Yes
No
Squarer $y[n]=x^2[n]$
Yes
No
Yes
Yes
Yes
2.3 LTI Systems and the Impulse Response
2.3.1 From the sifting property to convolution
A system that is both linear and time-invariant is called LTI(線性非時變) — the
slides also use the equivalent name LSI (linear shift-invariant). For LTI systems one
single signal characterizes the system completely: the impulse response(脈衝響應)
Impulse Response
$$h[n] \;=\; T\{\delta[n]\}$$
The derivation is the most important three lines of the course. Start from the sifting
decomposition of Chapter 1 — any sequence is a weighted sum of shifted impulses:
For an LTI system, knowing $h[n]$ means knowing the output for every input:
$y[n] = x[n] * h[n]$. All later analysis (frequency response, transfer function) is just
different ways of looking at $h[n]$. This is exactly why we care so much about the LTI class.
2.3.2 Impulse response examples
Feed $\delta[n]$ into the systems of §2.1 (Fig. 2-2):
Fig. 2-2 — Example impulse responses: 5-point moving average (FIR, length 5), accumulator h[n]=u[n] (IIR, not absolutely summable), and the decaying exponential h[n]=(0.8)nu[n] (IIR but stable)(三種典型脈衝響應).
Read $y[n] = \sum_k x[k]\,h[n-k]$ as a sum over input samples: every input sample
$x[k]$ launches its own copy of the impulse response, scaled by $x[k]$ and delayed to start at
time $k$. The output is the superposition of all these scaled, shifted echoes. This is the
direct picture of "linearity + time invariance at work".
Interpretation 2 — flip and slide(翻轉平移法)
Read the formula one output sample at a time. To get the single number $y[n]$:
Flip: time-reverse $h[k]$ to get $h[-k]$.
Slide: shift it right by $n$ to get $h[n-k]$ (as a function of $k$).
Multiply & sum: $y[n] = \sum_k x[k]\,h[n-k]$ — the inner product of the
input with the flipped, shifted impulse response.
Increment $n$ and repeat.
Fig. 2-3 walks through $x[n]=\{1,2,3,2,1\}$ convolved with $h[n]=\{1,1,1\}$: at $n=3$ the
flipped window $h[3-k]$ overlaps $x[k]$ on $k=1,2,3$, giving $y[3]=2+3+2=7$.
Fig. 2-3 — Flip-and-slide evaluation of x[n]∗h[n] with x = {1,2,3,2,1} and h = {1,1,1}. Bottom-left: at n = 3 the flipped, shifted window h[3−k] overlaps x[k] on k = 1…3 (shaded), so y[3] = 2+3+2 = 7. Bottom-right: the complete output, length 5+3−1 = 7(翻轉平移法逐點計算卷積).
Commutativity follows from the change of variables $m = n-k$ in the sum; it means "you may
flip either signal" — always flip the shorter one. The associative and distributive properties
are exactly what make cascade and parallel interconnections work (§2.5.3). Convolution is also
linear in each argument and time-invariant: if $y = x*h$ then $x[n-n_0]*h[n] = y[n-n_0]$.
2.4.3 Matrix interpretation
For finite-length sequences, convolution is a matrix–vector product. With
$x[n]$ of length $N$ and $h[n]$ of length $M$, stack $y = H\,x$ where $H$ is the
$(N{+}M{-}1)\times N$ convolution (Toeplitz) matrix(卷積矩陣) whose columns are
shifted copies of $h$. For $h=\{h_0,h_1,h_2\}$ and $N=5$:
Each column is the echo launched by one input sample (Interpretation 1); each row is the
flipped window picking out one output sample (Interpretation 2). The constant-along-diagonals
(Toeplitz) structure is time invariance written as a matrix.
2.4.4 Support, length, and MATLAB
Key — output support rules
If $x[n]$ has length $N$ starting at index $n_x$, and $h[n]$ has length $M$ starting at $n_h$,
then $y = x*h$ has length $\boxed{N+M-1}$, starting at index $n_x+n_h$ and ending at index
$(n_x+N-1)+(n_h+M-1)$. Sanity checks: $y[\text{first}] = x[\text{first}]\,h[\text{first}]$ and
$\sum_n y[n] = \left(\sum_n x[n]\right)\left(\sum_n h[n]\right)$.
Fig. 2-4b — Output support adds up(輸出支撐相加): supports translate so $y$ starts where the two earliest samples align(最早樣本相加 $n_x+n_h$)and ends where the two latest align; the count is $N+M-1$(端點各貢獻一個,重疊處只算一次). Here $3+4-1 = 6$ samples spanning indices $3\!\dots\!8$.
MATLAB — conv
y = conv(x, h) returns the full
length-$(N{+}M{-}1)$ result. MATLAB vectors carry no time origin — you must track the
starting index: if x starts at $n_x$ and
h at $n_h$, build the output axis as
ny = (nx+nh) : (nx+nh+N+M-2).
Plot discrete sequences with stem, never
plot.
2.5 LTI System Properties via h[n]
Because $h[n]$ characterizes an LTI system completely, every system property of §2.2 must be
readable directly from $h[n]$.
2.5.1 Causality ⇔ h[n] = 0 for n < 0
LTI Causality Test
$$\text{LTI system causal} \iff h[n] = 0 \ \text{ for all } n < 0$$
Why: in $y[n] = \sum_k h[k]\,x[n-k]$, the terms with $k<0$ involve
$x[n-k]$ with $n-k > n$ — future inputs. They vanish for every input iff $h[k]=0$ for
$k<0$. ($\Leftarrow$) is immediate; ($\Rightarrow$) follows because $h[n]$ is itself the
response to $\delta[n]$: a causal system cannot respond before the impulse arrives at $n=0$.
A sequence with this property is called a causal sequence.
2.5.2 Stability ⇔ absolute summability
LTI BIBO Test
$$\color{#c0392b}{\boldsymbol{\text{LTI system BIBO stable} \iff S \;=\; \sum_{k=-\infty}^{\infty} \bigl|h[k]\bigr| < \infty}}$$
Fig. 2-5 — Connected LTI systems: a cascade(串聯)is equivalent to a single system with $h_1*h_2$ (order interchangeable); a parallel connection(並聯)is equivalent to $h_1+h_2$.
2.5.4 Inverse systems
A system $h_i[n]$ is the inverse(反系統) of $h[n]$ if their cascade is the
identity system:
Example 2.4 — Accumulator and first difference are inverses
Accumulator: $h[n]=u[n]$. Backward first difference: $h_i[n]=\delta[n]-\delta[n-1]$.
Check the cascade using the shift property:
$$u[n]*\bigl(\delta[n]-\delta[n-1]\bigr) = u[n]-u[n-1] = \delta[n]. \checkmark$$
Interpretation: differencing undoes accumulation, exactly as differentiation
undoes integration. Inverse systems are the foundation of equalization(等化)— undoing the
distortion of a channel by cascading it with its inverse.
Warning — inverses are not always nice
The inverse of a perfectly causal, stable system may be non-causal or unstable. Existence and
properties of $h_i[n]$ are much easier to discuss with the $z$-transform (poles and zeros swap
roles) — a preview of later chapters.
2.6 Chapter Summary
System properties
Linear: superposition $T\{ax_1+bx_2\}=aT\{x_1\}+bT\{x_2\}$ (zero in → zero out is necessary).
Time-invariant: $x[n-n_0]\mapsto y[n-n_0]$. Causal: no future samples. BIBO stable: bounded in → bounded out.
LTI ⇒ convolution
$x[n]=\sum_k x[k]\delta[n-k]$, so $y[n]=\sum_k x[k]h[n-k]=x[n]*h[n]$.
The impulse response $h[n]=T\{\delta[n]\}$ fully characterizes the system.
(a) $y[n]=a^2x[n]-b$ — not linear; time-invariant; causal.
Linearity: zero input gives $y[n]=-b\neq0$, so the system fails the zero-in/zero-out
necessary condition → nonlinear (it is affine). Explicitly,
$T\{x_1+x_2\} = a^2(x_1+x_2)-b$ but $T\{x_1\}+T\{x_2\} = a^2(x_1+x_2)-2b$.
Time invariance: shifted input $x[n-n_0]$ → $a^2x[n-n_0]-b = y[n-n_0]$. The rule has no
explicit dependence on $n$ → time-invariant.
Causality: $y[n]$ uses only $x[n]$ (memoryless) → causal.
(b) $y[n]=x[an-b]$ — linear; not time-invariant; not causal (in general).
Linearity: for input $\alpha x_1+\beta x_2$ the output is
$\alpha x_1[an-b]+\beta x_2[an-b] = \alpha y_1[n]+\beta y_2[n]$ → linear
(any system that merely re-indexes the input is linear).
Time invariance: shift the input: $w[n]=x[n-n_0]$ gives
$T\{w\} = w[an-b] = x[an-b-n_0]$, while the shifted output is
$y[n-n_0] = x[a(n-n_0)-b] = x[an-b-an_0]$. These agree for all $x$ only if $an_0=n_0$ for every
$n_0$, i.e. only if $a=1$. For a general positive constant $a\neq1$ →
not time-invariant (time-scaling re-labels the clock).
Causality: $y[n]$ reads the input at time $an-b$. Causality requires $an-b\le n$, i.e.
$(a-1)n\le b$, for every $n$ — impossible for $a>1$ when $n$ grows (e.g. $a=2,b=1$:
$y[2]=x[3]$, a future sample) → not causal in general. (In the special case $a=1$
the system is the pure delay $x[n-b]$, $b>0$, which is both time-invariant and causal.)
(c) Centered moving average — linear; time-invariant; not causal.
Write $y[n] = \frac{1}{M}\sum_{k=-(M-1)/2}^{(M-1)/2} x[n-k]$, a symmetric window of odd
length $M$ centered on $n$.
Linearity: a weighted sum of input samples with constant weights satisfies
superposition term by term → linear.
Time invariance: replacing $x[\cdot]\to x[\cdot-n_0]$ shifts every term identically:
$T\{x[n-n_0]\} = \frac1M\sum_k x[n-n_0-k] = y[n-n_0]$ → time-invariant.
Causality: the terms $x[n+k]$ for $k=1,\dots,(M-1)/2$ are future samples →
not causal.
(d) $y[n]=\log_2(|x[n]|)$ — not linear; time-invariant; causal.
Linearity: scaling test: input $\alpha x[n]$ gives
$\log_2(|\alpha|\,|x[n]|) = \log_2|\alpha| + \log_2|x[n]| \neq \alpha\,\log_2|x[n]|$ →
nonlinear (the log turns scaling into an additive offset).
Time invariance: the rule is a fixed memoryless nonlinearity, independent of $n$:
shifted input → shifted output → time-invariant.
Causality: depends only on $x[n]$ → causal.
System
Linear
Time-invariant
Causal
(a) $a^2x[n]-b$
No
Yes
Yes
(b) $x[an-b]$
Yes
No (unless $a{=}1$)
No (unless $a{=}1$)
(c) centered MA
Yes
Yes
No
(d) $\log_2|x[n]|$
No
Yes
Yes
Exercise 2 — Linear or nonlinear?
Problem: The system $T$ is known to be time-invariant. When the inputs
are $x_1[n]$, $x_2[n]$, $x_3[n]$, the responses are $y_1[n]$, $y_2[n]$, $y_3[n]$ (Figure 1 of the
homework):
Determine whether the system $T$ is linear or nonlinear.
Click to reveal solution
Strategy: assume $T$ is linear, combine that assumption with the given fact
that $T$ is time-invariant, and look for a contradiction among the three input–output pairs.
Step 1 — relate the inputs. Notice that
$$x_1[n] = \delta[n] + 2\,\delta[n-1] = \delta[n] + x_2[n].$$
If $T$ were linear (additivity), the response to $\delta[n]$ would have to be
$$h[n] \;=\; T\{\delta[n]\} \;=\; y_1[n] - y_2[n]
= 2\delta[n-1] + 3\delta[n-2] - 2\delta[n-2] - 4\delta[n-3]
= 2\delta[n-1] + \delta[n-2] - 4\delta[n-3].$$
Step 2 — invoke time invariance. $T$ is time-invariant, so the response to
$x_3[n] = \delta[n-4]$ would have to be $h[n-4]$:
$$T\{\delta[n-4]\} = 2\,\delta[n-5] + \delta[n-6] - 4\,\delta[n-7],$$
a sequence supported on $n = 5, 6, 7$.
Step 3 — compare with the measured response. The actual response is
$$y_3[n] = 3\,\delta[n+2] + 2\,\delta[n+1],$$
supported on $n = -2, -1$. The two disagree completely → contradiction.
$$\boxed{\text{The system } T \text{ is nonlinear.}}$$
Cross-check (independent contradiction). Since
$x_2[n] = 2\,\delta[n-1] = 2\,x_3[n+3]$: by time invariance the response to $x_3[n+3]$ is
$y_3[n+3] = 3\delta[n+5]+2\delta[n+4]$; if $T$ were also linear (homogeneity) we would need
$y_2[n] = 2\,y_3[n+3] = 6\,\delta[n+5] + 4\,\delta[n+4]$. But the measured
$y_2[n] = 2\delta[n-2]+4\delta[n-3]$ — again a contradiction, confirming nonlinearity.
Remark: note the logic direction — the data can disprove linearity, but no
finite set of input–output pairs could ever prove it.
Exercise 3 — MATLAB: 5-point moving average
Problem: The input signal is
$$x[n] = \delta[n] + 3\,\delta[n-1] + 7\,\delta[n-2] + 2\,\delta[n-3] + 4\,\delta[n-4]$$
and the output of a 5-point moving average is
$$y[n] = \frac{1}{5}\sum_{k=0}^{4} x[n-k].$$
(a) Use the stem function to plot $x[n]$.
(b) Use a for loop to calculate $y[n]$.
(c) Use the convolution function to calculate $y[n]$ (results of (b) and (c) must agree).
(d) Use stem to plot $y[n]$.
Click to reveal solution
Setup. The input vector is $x = [1\;3\;7\;2\;4]$ on $n=0,\dots,4$ ($N=5$) and the
filter is the FIR impulse response $h[n]=\frac15$ for $0\le n\le4$ ($M=5$). The output has length
$N+M-1 = 9$, on $n = 0,\dots,8$.
clc; clear; close all;
n = 0:4; % time index of the input
x = [1 3 7 2 4]; % x[n] sample values
N = length(x); % input length
M = 5; % moving-average length
%% (a) plot x[n] with stem
figure(1)
stem(n, x, 'filled');
xlabel('n'); ylabel('x[n]');
title('Input signal x[n]');
grid on;
%% (b) compute y[n] with a for loop
x_padded = [x zeros(1, M-1)]; % zero-pad to handle the boundary
y_loop = zeros(1, N + M - 1); % preallocate the output
for i = 1:(N + M - 1) % loop over output samples
sum_val = 0;
for k = 0:(M - 1) % accumulate the M-sample window
if (i - k) > 0 % keep the index valid (x[n]=0 for n<0)
sum_val = sum_val + x_padded(i - k);
end
end
y_loop(i) = sum_val / M; % the average
end
%% (c) compute y[n] with conv
h = (1/M) * ones(1, M); % MA impulse response h[n] = 1/5, n = 0..4
y_conv = conv(x, h); % identical to y_loop
%% (d) plot y[n] with stem
n_out = 0:(N + M - 2); % output time index, length N+M-1
figure(2)
subplot(2,1,1)
stem(n_out, y_loop, 'filled');
xlabel('n'); ylabel('y[n]');
title('Output y[n] (for loop)');
grid on;
subplot(2,1,2)
stem(n_out, y_conv, 'filled');
xlabel('n'); ylabel('y[n]');
title('Output y[n] (conv)');
grid on;
Hand check (and program output). $y[n] = \frac15\,(x*\mathbf{1}_5)[n]$:
each output is the sum of the (at most five) input samples in the window $n-4,\dots,n$, divided
by 5:
$n$
0
1
2
3
4
5
6
7
8
window sum
1
4
11
13
17
16
13
6
4
$y[n]$
0.2
0.8
2.2
2.6
3.4
3.2
2.6
1.2
0.8
The loop and conv give exactly the
same vector, as required — the nested loop literally evaluates the convolution sum
$y[n]=\sum_k h[k]\,x[n-k]$ that conv
implements. Sanity checks from §2.4.4: length $5+5-1=9$ ✓; first sample
$y[0]=x[0]h[0]=0.2$ ✓; $\sum_n y[n] = 17\cdot1 = 17$, and indeed $\sum x = 17$, $\sum h = 1$ ✓.
Fig. 2-6 — Homework 2, Problem 3 result regenerated: input x[n] = {1,3,7,2,4} (top) and the 5-point moving-average output y[n] (bottom). The for-loop and conv results coincide exactly(for 迴圈與 conv 結果完全相同).