高速フーリエ変換 - 基礎編

FFT（Fast Fourier Transformation）高速フーリエ変換は、音響・振動測定分野において重要な解析手法です。FFTを使うことにより、ある信号をいくつかの周波数成分に分解し、それらの大きさをスペクトルとして表すことできます。用途として、機器や機械の異常の検出、品質管理、振動観測などがあります。ここでは、FFTの基本的な考え方と選択されたパラメータが測定結果にどのように反映されているかを説明します。

FFTとは、DFT（Discrete Fourier Transformation）離散フーリエ変換を求めるための最適化されたアルゴリズムと言うことができます。解析する信号波形を一定の時間で切り取り、この波形を周波数成分に分割して表します。これら離散的な周波数成分は、振幅と位相の異なる単純な正弦波です。一例を下の図に示します。測定された時間波形には三つの単純な周波数が含まれています。 信号処理の流れ

1. 測定システムのサンプリングレート、またはサンプリング周波数fs（例えば48 kHz）は、1秒間のサンプル数を表します。
2. ブロックサイズBL（選択されたサンプリング点数）は 、FFTにおいて常に低2の整数乗となります。（例えば 2^10 = 1024サンプル）

これら二つの 基本的なパラメータfsとBLから、様々なパラメータが算出されます。

fn = fs / 2

D = BL / fs.

df = fs / BL

サンプリング周波数fsは、通常、測定システムにより与えられる値です。一方、時間窓長と周波数分解能はブロックサイズBLを選択することにより算出され、次のことがあてはまります。

• ブロックサイズが小さい場合、低い周波数分解能で速い繰り返し測定になります。
• ブロックサイズが大きい場合、高い周波数分解能でゆるやかな繰り返し測定になります。 ブロックサイズ小（左）と大（右）のFFT画面

リーケージの問題

フーリエ変換では、切り取られた信号波形が無限の期間で周期的に繰り返されていると仮定しています。これにより二つの結論が導かれます。

1. FFTは周期的な信号にのみ適している。
2. 切り取られた信号波形は、全ての周期を含んでいる必要がある。

2.の結論から言えることは、適用できる信号がほとんどないということです。信号のサンプリング時間長に含まれる周波数が周波数分解能dfの整数倍とは限らず、2のn乗サンプルのブロックサイズで開始、終了しないこともあります。下図では、時間信号が周期の途中で終了し、正弦波であってもFFTスペクトルが大きく広がっています。（リーケージとも言います。） 周期性が成立しない時間信号と大きく広がったスペクトル

ウィンドウイング

このリーケージの発生を抑制するため、信号サンプルにウィンドウイングが適用されます。（窓関数をかける。）重み付け関数を適用することで、信号サンプルのオンとオフがある程度ゆるやかになります。その結果、窓関数のかけられた信号は、開始と終了の振幅が0になります。そして、サンプルは極端な過渡的変化を持たずに周期的に繰り返されます。 窓関数が適用された時間信号とスペクトル

波形例 This video shows the creation of a 500 Hz square wave as a time signal and spectrum.

How to measure?

The portable audio and acoustic analyzer XL2 is ideally suited for fast and simple FFT analysis up to 20 kHz. For multi-channel and more detailed analysis or calculations, a more powerful system with large bandwidth and fast signal processors such as the FLEXUS FX100 Audio Analyzer is required. In conjunction with the FX-Control PC software, the FFT can be easily and quickly adapted and visualized according to the requirements of the measurement. The larger internal memory of the FLEXUS FX100 allows significantly longer blocklengths to be processed, resulting in a much finer frequency resolution.

FFT Further Considerations

This second part of this article deals with specific aspects that are helpful in the practical application of FFT measurements. FFT measurements are used in numerous applications. The results are usually presented as graphs and are easy to interpret. For accurate FFT measurements, there are some things to look out for. This article provides valuable tips.

As explained in the first part, the sampling rate fs of the measuring system and the block length BL are the two central parameters of an FFT. The sampling rate indicates how often the analog signal to be analyzed is scanned. When recording wav files via a commercially-available PC sound card, for example, the audio signal is usually sampled 44,100 times per second.

Nyquist Theorem

Harry Nyquist was the discoverer of a fundamental rule in the sampling of analog signals: the sampling frequency must be at least double the highest frequency of the signal. If, for example, a signal containing frequencies up to 24 kHz is to be sampled, a sampling rate of at least 48 kHz is required for this purpose. Half the sampling rate, in this example 24 kHz,  is called the "Nyquist frequency".
But what happens if signals above the Nyquist frequency are fed in to the system?

Aliasing

For the most, a signal is sampled with a more-than-sufficient number of samples. With a 48 kHz sampling rate, for example, the 6 kHz frequency is sampled 8 times per cycle, while the 12 kHz frequency is only sampled 4 times per cycle. At the Nyquist frequency, only 2 samples are available per cycle.
With 2 samples or more it is still possible to reconstruct the signal without loss. If, however, less than 2 samples are available, artifacts which do not occur in the sampled (original) signal are generated.

Mirror frequencies

In the FFT, these artifacts appear as mirror frequencies. If the Nyquist frequency is exceeded, the signal is reflected at this imaginary limit and falls back into the useful frequency band. The following video shows an FFT system with 44.1 kHz sampling rate. A sweep signal of 15 kHz to 25 kHz is fed in to this system.

These unwanted mirror frequencies are counteracted with an analog low-pass filter (anti-aliasing filter) before the scanning. The filter ensures that frequencies above the Nyquist frequency are suppressed.

Time window

In the case of periodically-continuous signals, the time windowing serves to smooth the undesired transitional jumps at the end of the scanning (see part 1). This prevents smearing in the spectrum. There are numerous types of windows, some of which differ only slightly. When selecting the time window, the following rule applies: Each window requires a compromise between frequency selectivity and amplitude accuracy. Averaging of Spectra

In the analysis of non-periodic signals, e.g. noise or music, it is often advantageous to capture multiple FFT blocks and determine mean values therefrom. There are two possible approaches:

1.  The classical mean: A number of FFTs are measured. Each result is considered in equal parts in the averaged final result. This method is suitable for measurements with a defined duration.
2. The exponential mean: FFTs are continuously measured. Here, too, a fixed number of results of the continuous measurements are considered. However, the weighting is inversely proportional to the 'age' of the result. The oldest of the measurements is taken the least into account, the most recent measurement contributes most effectively to the averaged result. This exponential average is used when the spectrum is continuously monitored over a long period of time. Power vs. Peak detector

Modern high-resolution FFT analyzers offer the possibility to decouple the number of measurement results from the FFT block length. This results in an increase in measurement performance time, especially for high-resolution FFTs. Thus, for example, with a 2MB block length it is no longer necessary to measure and represent more than 1 Million points (bins), but only the number necessary for the display, e.g. 1024.
The value chosen for each FFT bin can be defined in two ways:

1. "MaxPeak": Here the maximum value of the FFT results is used. This type is well suited for the visual representation of FFTs
2. "Power": Here the FFT results are summed up and averaged energetically. This is necessary when the FFT is used for calculations.

Calculations with FFT results

FFTs are mainly used to visualize signals. However, there are also applications where FFT results are used in calculations. For example, very simple levels of defined frequency bands can be calculated by adding them via an RSS (Root Sum Square) algorithm.

Another application is the comparison of spectra. The example below shows an acoustic measurement of a cordless screwdriver. The measured spectrum is subtracted from a defined reference spectrum. This difference is compared against an upper and lower tolerance. The upper spectrum shows a functional cordless screwdriver. In the lower, the acoustic spectrum suggests that the test specimen is defective.  