1. 什么是信号的直流分量(DC component )?
从时域角度,直流分量与时间无关,即不随时间变化而变化,是一个常量。如信号
x
(
t
)
x(t)
x(t)中的成分
A
0
A_0
A0就是直流分量:
x
(
t
)
=
A
0
+
A
s
i
n
(
2
π
f
t
)
x(t)=A_0+Asin(2\pi ft)
x(t)=A0+Asin(2πft)
从频域角度,直流分量就是频谱中频率为0时对应的值 [1]:
In a sense, the DC component is like the “zero frequency component”, since cos(2π ·0·t) = 1. We often think of offset in this way, and plot the DC offset at f = 0 in the frequency-domain representation. The DC component is often easy to eyeball—it’s equal to the average value of the signal over a period. For example, in the signal above, the DC offset is 0.5.
2. 为什么在频谱分析时要去除直流分量?
在频域中,横坐标频率f=0Hz对应的值就是直流分量,如果该值纵坐标过大,就会干扰对其他频率成分的观察,所以需要从信号中去除这个无用的0频率成分。
从第一个图可以看出,0频率的幅值很大,从而干扰对其他频率幅值的分析。第二个图是去除直流分量之后的频谱图,可以发现此时已经没有直流分量了。
3. 如何去除信号的直流分量
直流分量可以看做是一个周期内信号的均值,将原始信号减去信号的均值,即可去除直流分量。
x
^
(
t
)
=
x
(
t
)
−
μ
x
\hat{x}(t)=x(t)-\mu_x
x^(t)=x(t)−μx
对于离散信号,其均值为
μ
x
=
1
N
∑
n
=
0
N
−
1
x
[
n
]
\mu_x=\frac{1}{N} \sum_{n=0}^{N-1} x[n]
μx=N1∑n=0N−1x[n];对于连续信号,其均值为
μ
x
=
1
t
2
−
t
1
∫
t
1
t
2
x
(
t
)
d
t
\mu_x=\frac{1}{t_2-t_1} \int_{t_1}^{t_2} x(t) d t
μx=t2−t11∫t1t2x(t)dt。
在FFT代码中,去除直流分量是非常必要的,一般会加一行代码。
4. 参考
[1] Signals and the frequency domain