傅立葉變換在振動訊號分析中的應用
Andrei Shelkovenko。Vibromera 的開發者與創辦人之一。
本文翻譯可能含有不準確之處。
傅立葉變換與訊號頻譜
在許多情況下,獲取(計算) 頻譜 訊號的任務如下。有一個 ADC,它以採樣 頻率 Fd 將時長為 T 內輸入其端子的連續訊號轉換為數位樣本 – N 個。然後將這組樣本輸入某個程式(例如 FourierScope)該程式會輸出 N/2 個數值。
為了檢查程式是否正常運作,我們構建一個由兩個正弦函數相加而成的樣本陣列 sin(10*2*pi*x)+0.5*sin(5*2*pi*x) 並輸入程式。程式繪製出以下結果:

圖 1 訊號時間函數圖

圖 2 訊號頻譜圖
有兩個 諧波 在頻譜圖上 – 5 Hz 振幅為 0.5 V,10 Hz 振幅為 1 V,一切與原始訊號公式中的情況一致。沒問題,程式運作正確。
這意味著,如果我們將由兩個正弦波混合而成的真實訊號輸入 ADC,我們將獲得一個由兩個諧波組成的類似頻譜。
因此,我們的 真實 測量訊號 持續時間為 5 秒,經 ADC 數位化,即表示為 離散 樣本,具有 離散非週期性 頻譜。
從數學角度來看 – 這句話有多少處錯誤?
現在讓我們嘗試測量同一訊號,持續時間為 0.5 秒。

圖 3 測量週期為 0.5 秒的函數 sin(10*2*pi*x)+0.5*sin(5*2*pi*x) 圖

圖 4 該函數的頻譜
這裡有些問題!10 Hz 的諧波繪製正常,但 5 Hz 的諧波位置出現了一些不明確的諧波。
網路上說需要在樣本末尾補零,頻譜就會正常繪製。

圖 5 我們已在樣本末尾補零至 5 秒

圖 6. 獲得的頻譜。
這完全不是那麼回事。我必須深入研究理論。讓我們前往 wikipedia – 知識的來源。
連續函數及其傅立葉級數表示
從數學角度來看,我們持續時間為 T 秒的訊號是定義在區間 {0, T} 上的某個函數 f(x)(此處 X 為時間)。此類函數總可以表示為以下形式的諧波函數(正弦或餘弦)之和:

(1),其中:
k 為三角函數的序數(諧波分量的序數,諧波的序數)
T – 函數定義的區間(訊號的持續時間)
Ak- 第 k 個諧波分量的振幅,
θk- 第 k 個諧波分量的初始相位
「將函數表示為級數之和」是什麼意思?這意味著,通過在每個點上將傅立葉級數的諧波分量值相加,我們得到該點上我們函數的值。
(更嚴格地說,級數與函數 f(x) 的均方偏差將趨於零,但儘管存在均方收斂,一般而言,函數的傅立葉級數不一定逐點收斂於該函數。)
此級數也可以寫成以下形式:

(2),
其中
,第 k 個複振幅。
或

(3)
係數(1)與(3)之間的關係由以下公式表示:
![]()

注意,傅立葉級數的這三種表示法完全等效。有時在處理傅立葉級數時,使用虛數參數的指數而非弦波與餘弦波(即使用複數形式的傅立葉變換)會更方便。但對我們而言,使用公式 (1) 更為方便,其中傅立葉級數表示為具有對應振幅與相位的餘弦波之和。嚴格來說,真實訊號的傅立葉變換確實會產生複數係數(形式 (3)):每個係數同時攜帶其諧波的振幅與相位。對於真實訊號,這些複數係數具有共軛(厄米特)對稱性 – 負頻率半部單純是正頻率半部的鏡像,且不攜帶額外資訊。因此,從複數係數中,我們總能轉換至公式 (1) 的實數非負振幅 Ak 與相位 θk – 而分析程式繪製的正是此振幅頻譜。
總結:
訊號頻譜分析的數學基礎是傅立葉變換。
傅立葉變換允許將定義在區間 {0, T} 上的連續函數 f(x)(訊號)表示為無窮多個(無窮級數)具有確定振幅和相位的三角函數(正弦和/或餘弦)之和,這些三角函數同樣考慮在區間 {0, T} 上。此類級數稱為傅立葉級數。
請注意更多要點,理解這些要點對於正確將傅立葉變換應用於訊號分析是必需的。如果我們在整個 X 軸上考慮傅立葉級數(正弦波之和),我們會發現,在區間 {0, T} 之外,傅立葉級數函數將週期性地重複我們的函數。
例如,在圖 7 的圖表中,原始函數定義在區間 {-T\2, +T\2} 上,而傅立葉級數表示定義在整個 x 軸上的週期函數。
This is because the sinusoids themselves are periodic functions, so their sum will also be a periodic function.

Figure 7 Representation of a non-periodic source function by a Fourier series
Thus:
Our original function is a continuous, non-periodic function defined on some segment of length T.
The spectrum of this function is discrete, i.e. it is represented as an infinite series of harmonic components – a Fourier series.
In fact, Fourier series defines some periodic function, which coincides with our function on the interval {0, T}, but for us this periodicity is not essential.
Next.
The periods of harmonic components are multiples of the interval {0, T}, on which the initial function f(x) is defined. In other words, the periods of harmonics are multiples of the duration of the signal measurement. For example, the period of the first harmonic in a Fourier series is equal to the interval T in which the function f(x) is defined. The period of the second harmonic in a Fourier series is equal to the interval T/2. And so on (see Figure 8).

Fig. 8 Periods (frequencies) of harmonic components of the Fourier series (here T=2π)
Accordingly, the frequencies of harmonic components are multiples of 1/T. That is, frequencies of harmonic components Fk are Fk= k\T, where k runs values from 0 to ∞, for example, k=0 F0=0; k=1 F1=1\T; k=2 F2=2\T;k=3 F3=3\T;…. Fk= k\T (at zero frequency, a constant component).
Let our initial function, is a signal recorded during T=1 sec. Then the period of the first harmonic will be equal to the duration of our signal T1=T=1 sec and the frequency of the harmonic is equal to 1 Hz. The period of the second harmonic will be equal to the duration of our signal divided by 2 (T2=T/2=0.5 sec.) and the frequency is equal to 2 Hz. For the third harmonic, T3=T/3 sec and the frequency is 3 Hz. And so on.
The step between harmonics in this case is 1 Hz.
Thus, a signal with a duration of 1 sec can be decomposed into harmonic components (to obtain a spectrum) with a frequency resolution of 1 Hz.
若要將解析度提高 2 倍至 0.5 Hz,則必須將測量時長提高 2 倍至 2 秒。10 秒的訊號可分解為頻率解析度為 0.1 Hz 的諧波分量(頻譜)。沒有其他方法可提高頻率解析度。您可以透過我們的 FFT 解析度計算器.
There is a way to artificially increase the signal duration by adding zeros to the array of samples. But it does not increase the real frequency resolution.
離散訊號與離散傅立葉變換
With the development of digital technology the ways of measurement data (signals) storage have changed. Whereas previously a signal could be recorded on a tape recorder and stored on a tape in analog form, now signals are digitized and stored in files in computer memory as a set of numbers (counts).
The usual scheme of signal measurement and digitization looks as follows.
Measuring transducer —- Signal normalizer —- ADC —– Computer
(Fig.9 Schematic of the measuring channel)
The signal from the measuring transducer goes to the ADC for a period of time T. The signal readings (sampling) received during time T are transmitted to the computer and saved in the memory.

Fig.10 Digitized signal – N samples received for time T
What are the requirements to signal digitization parameters? A device which converts the input analog signal into a discrete code (digital signal) is called an analog-to-digital converter (ADC) (© Wiki).
One of the basic parameters of ADC is the maximum sampling rate – the frequency of sampling of a signal which is continuous in time. Sample rate is measured in hertz. ((© Wiki))
根據科捷爾尼科夫定理,若連續訊號的頻譜受限於頻率 Fmax,則可從以時間間隔 Δt ≤ 1/(2*Fmax)(即採樣頻率 Fd ≥ 2*Fmax)取得的離散樣本中完整且唯一地重建該訊號,其中 Fd – 採樣頻率;Fmax – 訊號頻譜的最大頻率。換言之,訊號數位化的頻率(ADC 的採樣頻率)必須至少為我們欲測量訊號最大頻率的兩倍。
And what will happen if we take samples with lower frequency than required by Kotelnikov’s theorem?
在這種情況下存在「混疊」效應(亦稱頻閃效應、莫爾效應),其中高頻訊號在數位化後轉變為實際上並不存在低頻訊號。在圖 11 中,紅色高頻弦波為真實訊號。藍色低頻弦波為虛構訊號,其產生原因是採樣時間內已超過高頻訊號的一半週期。

Fig. 11. Appearance of a spurious low frequency signal at an insufficiently high sampling rate
為避免混疊效應,會在 ADC 之前放置特殊的抗混疊濾波器(低通濾波器)。它允許低於 ADC 採樣頻率一半的頻率通過,並切斷更高的頻率。
為了根據離散樣本計算訊號頻譜,需使用離散 傅立葉變換(DFT) 。再次注意,離散訊號的頻譜「根據定義」受限於小於採樣頻率 Fd 一半的頻率 Fmax。因此,離散訊號的頻譜可表示為 a finite number of harmonics, in contrast to the infinite sum for the Fourier series of a continuous signal, whose spectrum can be unlimited. According to Kotelnikov’s theorem, the maximum frequency of a harmonic must be such that it accounts for at least two samples, so the number of harmonics is equal to half the number of samples of a discrete signal. That is, if there are N samples in the sample, the number of harmonics in the spectrum will be N/2.
Consider now the discrete Fourier transform (DFT).

Comparing it with the Fourier series

As we can see, they coincide, except for the fact that time in the FFT is discrete and the number of harmonics is limited to N/2, which is half the number of samples.
DFT formulas are written in dimensionless integer variables k, s, where k is the number of signal samples, s is the number of spectral components.
The value s shows the number of full harmonic oscillations per period T (signal measurement duration). The discrete Fourier transform is used to find the amplitudes and phases of harmonics numerically, i.e. “on the computer”.
As it was already said above, when decomposing a non-periodic function (our signal) into Fourier series, the resulting Fourier series actually corresponds to a periodic function with period T (Fig.12).

Fig.12. Periodic function f(x) with period T0, with period T>T0
如圖 12 所示,函數 f(x) 為週期為 T0 的週期函數。然而,由於測量樣本長度 T 不等於函數週期 T0,作為傅立葉級數獲得的函數在 T 點處存在不連續性。結果,該函數的頻譜將包含大量高頻諧波。此現象稱為 頻譜洩漏,在實務上可透過 加窗 變換前的訊號來減少。若測量樣本時長 T 與函數週期 T0 重合,則傅立葉變換後獲得的頻譜將僅包含第一諧波(週期等於樣本時長的弦波),因為函數 f(x) 為弦波。
In other words, the DFT program “does not know” that our signal is a “slice of a sine wave”, but tries to represent as a series a periodic function which has a discontinuity due to the discontinuity of separate pieces of the sine wave.
As a result, harmonics appear in the spectrum, which should, in total, represent the shape of the function, including this discontinuity.
Thus, to get a “correct” spectrum of a signal which is a sum of several sinusoids with different periods, it is necessary that an integer number of periods of each sinusoid should be present on the measuring period of the signal. In practice, this condition can be met with a sufficiently long duration of signal measurement.

Fig.13 Example of the kinematic error signal function and spectrum of a gearbox
At shorter duration the picture will look “worse”:

圖 14 轉子振動函數與頻譜範例
In practice, it can be difficult to understand where the “real components” and where the “artifacts” caused by inconsistency of component periods and signal sampling durations or “jumps and breaks” in the waveform. Of course, the words “real components” and “artifacts” are put in quotes for a reason. The presence of many harmonics on the spectrum graph does not mean that our signal actually consists of them. It is like thinking that number 7 “consists” of numbers 3 and 4. The number 7 can be thought of as the sum of 3 and 4 – that is correct.
So also our signal… or rather not even “our signal”, but a periodic function composed by repeating our signal (sample) can be represented as a sum of harmonics (sine waves) with certain amplitudes and phases. But in many cases important for practice (see figures above) it is indeed possible to relate the harmonics obtained in the spectrum also to real processes having cyclic character and contributing significantly to the form of the signal.
Some results
1. 經 ADC 數位化、時長為 T 秒的實際測量訊號,即由一組離散樣本(N 個)表示,其頻譜為離散非週期性,由一組諧波分量(N/2 個)表示。
2. 訊號由一組實數值表示。其 DFT 頻譜為一組具有共軛對稱性的複數係數;由此可獲得振幅頻譜 – 即正頻率處的實數非負振幅(與相位)集合,而實務上繪製的正是此單邊振幅頻譜。包含負頻率的雙邊複數形式與單邊振幅/相位形式為同一頻譜的等效表示 – 對於訊號分析而言,通常使用單邊振幅頻譜更為方便。
3. 在時間 T 內測量的訊號僅在時間 T 內被確定。在我們開始測量訊號之前發生了什麼,以及之後會發生什麼,科學上並不知道。而在我們的情況下,這也不重要。有限時間訊號的 FFT 給出了其「真實」頻譜,意即在特定條件下,它允許計算其分量的振幅與頻率。