金融&量化计算机科学与技术基础

深入理解傅里叶变换

2017-10-05  本文已影响359人  价值趋势技术派

深入理解傅里叶变换
Mar 12, 2017

这原本是我在知乎上对傅立叶变换、拉普拉斯变换、Z变换的联系?为什么要进行这些变换。研究的都是什么?问题的回答,实际上是我在本科学习数学和信号处理期间的思考,知乎上的答案因为写得仓促,只写了一些大致思想,没有具体展开,也没有图,比较难以理解,这里重新整理了一下,汇成此文,目前尚未完成。
本文要求读者需要在对傅里叶变换有一定的了解的基础之上阅读,至少要知道怎么算傅里叶变换。 此外部分地方要求读者有一定的微分方程基础,至少会求简谐振子的二阶常微分方程吧。
什么是傅里叶变换
为什么要分解为正弦波的叠加
傅里叶变换与信号系统
傅里叶变换与量子力学
傅里叶变换、拉普拉斯、Z变换、离散傅里叶变换的关系
傅里叶变换特殊的原因解释
其他微分算子的特征函数举例

什么是傅里叶变换
高等数学中一般是从周期函数的傅里叶级数开始介绍的,这里也不例外。简单的说,从高中我们就学过一个理想的波可以用三角函数来描述,但是实际上的波可以是各种奇形怪状的。首先我们来看具有固定周期的波,下图中展示了4种常见的周期波。傅里叶级数告诉我们,这些周期信号都可以分解为有限或无限个正弦波或余弦波的叠加,且这些波的频率都是原始信号频率f
0

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">f0
f
0

的整数倍。
s
(
x
)
=
A
0

2


n
=
1

A
n


sin

(
2
π
n
f
0

x

ϕ
n

)
.

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">s(x)=A02+∑n=1∞An⋅sin(2πnf0x+ϕn).
s
(
x
)
=
A
0

2


n
=
1

A
n


sin

(
2
π
n
f
0

x

ϕ
n

)
.

这里f
0

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">f0
f
0

被称为这些波的基频,A
0

/

2

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">A0/2
A
0

/

2

代表直流系数,系数A
n

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">An
A
n

被称为幅度,ϕ
n

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">ϕn
ϕ
n

被称作相位。根据幅度和相位可以利用反变换恢复信号的波形,因此幅度和相位包含了信号的全部信息。这里的幅度关于频率的函数,我们称之为频谱,相位关于频率的函数,称之为相位谱。


sampling

对于采样后的信号,可以利用指数变换将s

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">s
s

域的带状区域变换到单位圆内。这就是z变换,它可以看做拉普拉斯变换的一种特殊形式,即做了一个代换z

e

s
/

f
s

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">z=e−s/fs
z
=
e

s
/

f
s

,f
s

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">fs
f
s

是采样频率。这个变换将信号从s域变换到z域。请注意,s域和z域表示的是同一个信号,即采样完了之后的信号,只有采样才会改变信号本身!从复平面上来看,这个变换将与σ

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">σ
σ

轴平行的条带变换到z平面的一个单叶分支2
k
π

θ

2
(
k

1
)
π

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">2kπ≤θ≤2(k+1)π
2
k
π

θ

2
(
k

1
)
π

,并且将虚轴映射到单位圆。z

e

j
w
/

f
s

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">z=e−jw/fs
z
=
e

j
w
/

f
s

时也称作离散时间傅里叶变换(DTFT)。你会看到前面采样导致的周期延拓产生的条带重叠在一起了,因为具有周期性,所以z域不同的分支的函数值X
(
z
)

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">X(z)
X
(
z
)

是相同的。换句话说,如果没有采样,直接进行z变换,将会得到一个多值的复变函数!所以一般只对采样完了后的信号做z变换!
X
(
z
)
=
X
s
a
m
p
l
i
n
g

(
z
=
e

s
/

f
s

)

X
(
s
=
f
s

ln

z
)

n
=

z
n

" role="presentation" style="display: table-cell !important; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; width: 10000em !important; position: relative;">X(z)=Xsampling(z=e−s/fs)=X(s=fslnz)∑n=−∞∞zn
X
(
z
)
=
X
s
a
m
p
l
i
n
g

(
z
=
e

s
/

f
s

)

=
X
(
s
=
f
s

ln

z
)

n
=

z
n

这里讲了时域的采样,时域采样后,信号只有−
f
s

/

2

f
s

/

2

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">−fs/2→fs/2

f
s

/

2

f
s

/

2

间的频谱,即最高频率只有采样频率一半,但是要记录这样一个信号,仍然需要无限大的存储空间,可以进一步对频域进行采样。如果时间有限(实际上这与频率受限互相矛盾,但大多数信号近似成立)的信号,那么通过频域采样(时域做周期扩展)可以不失真地从采样的信号中恢复原始信号。并且信号长度是有限的,这就是离散傅里叶变换(DFT),它有著名的快速算法快速傅里叶变换(FFT)。为什么DFT这么重要呢,因为计算机要有效地对一般的信号做傅里叶变换,都是用DFT来实现的,除非信号具有简单的解析表达式!利用上述关系,可以推导出DFT在第k个频点的值为
X
(
k
)
=
X
(
z
=
e

j
2
π

N

k

)

X
(
s
=

j
2
π

N

k
f
s

)

n
=

e

j
2
π

N

n
k

=
X
(
s
=

j
2
π

N

k
f
s

)



x
(
t
)
e

j
2
π

N

k
f
s

t

d
t
=

n

x
n

e

j
2
π

N

n
k

" role="presentation" style="display: table-cell !important; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; width: 10000em !important; position: relative;">X(k)=X(z=e−j2πNk)=X(s=−j2πNkfs)∑n=−∞∞e−j2πNnk=X(s=−j2πNkfs)=∫∞−∞x(t)e−j2πNkfstdt=∑nxne−j2πNnk
X
(
k
)
=
X
(
z
=
e

j
2
π

N

k

)

=
X
(
s
=

j
2
π

N

k
f
s

)

n
=

e

j
2
π

N

n
k

=
X
(
s
=

j
2
π

N

k
f
s

)

=


x
(
t
)
e

j
2
π

N

k
f
s

t

d
t

=

n

x
n

e

j
2
π

N

n
k

上述推导利用到两个基本公式

n
=

e

j
2
π

N

n
k

=
1


x
(
t
)
e

j
2
π

N

k
f
s

t

d
t
=

n

x
n

e

j
2
π

N

n
k

" role="presentation" style="display: table-cell !important; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; width: 10000em !important; position: relative;">∑n=−∞∞e−j2πNnk=1∫∞−∞x(t)e−j2πNkfstdt=∑nxne−j2πNnk

n
=

e

j
2
π

N

n
k

=
1



x
(
t
)
e

j
2
π

N

k
f
s

t

d
t
=

n

x
n

e

j
2
π

N

n
k

总结起来说,就是对于一个线性系统,输入输出是线性关系的,不论是线性电路还是光路,只要可以用一个线性方程或线性微分方程(如拉普拉斯方程、泊松方程等)来描述的系统,都可以通过傅里叶分析从频域来分析这个系统的特性,比单纯从时域分析要强大得多!两个著名的应用例子就是线性电路和傅里叶光学(信息光学)。甚至非线性系统,也在很多情况里面使用线性系统的东西!所以傅里叶变换才这么重要!你看最早傅里叶最早也是为了求解热传导方程(那里其实也可以看做一个线性系统)!
傅里叶变换的思想还在不同领域有很多演变,比如在信号处理中的小波变换,它也是采用一组基函数来表达信号,只不过克服了傅里叶变换不能同时做时频分析的问题。
傅里叶变换特殊的原因解释
最后,我从纯数学的角度说一下傅里叶变化到底是什么。还记得线性代数中的代数方程Ax=b吗?如果A是对称方阵,可以找到矩阵A的所有互相正交的特征向量{v_i,i=1..n}和特征值λ
i

,
i
=
1..
n

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">λi,i=1..n
λ
i

,
i
=
1..
n

,然后将向量x和b表示成特征向量的组合x

Σ
i

x
i

v
i

,
b
=
Σ
i

b
i

v
i

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">x=Σixivi,b=Σibivi
x
=
Σ
i

x
i

v
i

,
b
=
Σ
i

b
i

v
i

。由于特征向量的正交关系,矩阵的代数方程可以化为n个标量代数方程λ
i

x
i

=
b
i

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">λixi=bi
λ
i

x
i

=
b
i

,是不是很神奇!!你会问这跟傅里叶变换有毛关系啊?别急,再看非齐次线性常微分方程y

a
y
=
z
(
x
)

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">y′+ay=z(x)
y

a
y
=
z
(
x
)

,可以验证指数函数y

e
s
x

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">y=esx
y
=
e
s
x

是他的特征函数,如果把方程改写为算子表示Λ
y
=
z

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">Λy=z
Λ
y
=
z

,那么有Λ
y
=
λ
y

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">Λy=λy
Λ
y
=
λ
y

,这是不是和线性方程的特征向量特征值很像。把y 和 z都表示为指数函数的线性组合,那么经过这种变换之后,常微分方程变为标量代数方程了!!而将y和z表示成指数函数的线性组合的过程就是傅里叶变换(或拉普拉斯变换)。在偏微分方程如波动方程中也有类似结论!这是我在上数理方程课程的时候体会到的。归纳起来,就是说傅里叶变换就是线性空间中的一个特殊的正交变换!他之所以特殊是因为指数函数是常系数微分算子的特征函数
其他微分算子的特征函数举例
这里举其他特征函数的例子是为了说明,傅里叶变换只是常系数微分算子的特征函数,如果是变系数就不是了。 所谓常系数微分算子就是具有这种形式的微分算子
L
^

=

k
=
0

n

a
k

d

k

x

d

t
k

,
a
k


R

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">L^=∑k=0nakdkxdtk,ak∈R
L
^

=

k
=
0

n

a
k

d

k

x

d

t
k

,
a
k


R

对于变系数的微分算子,a
k

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">ak
a
k

是自变量t

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">t
t

的函数,这种算子的特征函数并没有一般性的结论。 这里列举几个我遇到过多次的特征函数及变系数算子。
柱坐标下的贝塞尔函数是下述微分算子的特征函数
L
^

=
x
2

d
2

y

d
x
2

x
d
y

d
x

(
x
2


α
2

)

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">L^=x2d2ydx2+xdydx+(x2−α2)
L
^

=
x
2

d
2

y

d
x
2

x
d
y

d
x

(
x
2


α
2

)

球坐标下的勒让德多项式
P
n

(
x
)
=
1
2
n

n
!

d
n

d
x
n

[
(
x
2


1
)
n

]

.

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">Pn(x)=12nn!dndxn[(x2−1)n].
P
n

(
x
)
=
1
2
n

n
!

d
n

d
x
n

[
(
x
2


1
)
n

]

.

它是下述微分算子的特征函数,这是一个变系数的微分算子
L
^

=
d
d
x

[
(
1

x
2

)
d
d
x

]

n
(
n

1
)

" role="presentation" style="display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; position: relative;">L^=ddx[(1−x2)ddx]+n(n+1)
L
^

=
d
d
x

[
(
1

x
2

)
d
d
x

]

n
(
n

1
)

拉盖尔多项式
L
n

(
x
)
=
e
x

n
!

d
n

d
x
n

(
e

x

x
n

)

=
1
n
!

(
d
d
x


1

)

n

x
n

L
^

=
x
d
2

d
x
2

(
1

x
)
d
d
x

n

" role="presentation" style="display: table-cell !important; font-style: normal; font-weight: normal; line-height: normal; font-size: 16px; text-indent: 0px; text-align: center; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; width: 10000em !important; position: relative;">Ln(x)=exn!dndxn(e−xxn)=1n!(ddx−1)nxnL^=xd2dx2+(1−x)ddx+n
L
n

(
x
)
=
e
x

n
!

d
n

d
x
n

(
e

x

x
n

)

=
1
n
!

(
d
d
x


1

)

n

x
n

L
^

=
x
d
2

d
x
2

(
1

x
)
d
d
x

n

这样的例子还有很多,这些函数实际上都是一个函数族,这些函数互相正交,这和实对称阵的本征向量互相正交的性质一样,这里的线性算子也是其泛函空间上的对称实轭米算子。这些函数族构成一组完备正交基,可以表达对应泛函空间中的任意函数。这和傅里叶变换的基函数——复指数函数一样。

上一篇下一篇

猜你喜欢

热点阅读