Exercise 1.44: The idea of
smoothing a
function is an important concept in signal processing. If f is a function
and d
x is some small number, then the smoothed version of f is the
function whose value at a point x is the average of f
(
x
−
d
x
),
f
(
x
), and f
(
x
+
d
x
). Write a procedure
smooth that takes as input a procedure that computes f and returns a
procedure that computes the smoothed f. It is sometimes valuable to
repeatedly smooth a function (that is, smooth the smoothed function, and so on)
to obtain the
n-fold smoothed function. Show how to generate
the n-fold smoothed function of any given function using smooth and
repeated from Exercise 1.43.
练习 1.44:函数的平滑化 (smoothing) 是信号处理中的一个重要概念。若 f 是一个函数,dx 是某个小数值,则 f 的平滑版本是这样一个函数:其在点 x 处的值是 f(x − dx)、f(x) 和 f(x + dx) 的平均值。编写过程 smooth,以计算 f 的过程为输入,返回计算平滑后的 f 的过程。有时对一个函数反复平滑(即对已平滑的函数再次平滑,如此类推)以获得 n 重平滑函数是很有价值的。请说明如何利用 smooth 和练习 1.43 中的 repeated,对任意给定函数生成其 n 重平滑函数。