首页 > 解决方案 > 不同时期的快速傅里叶变换(阶次分析)

问题描述

我正在尝试对来自以不同速度旋转的轴的加速度计数据进行快速傅立叶变换。

到目前为止我做了什么:

1:原始图在时域中,因此我进行了阶次分析(重新采样),得到了以下图: 在此处输入图像描述

该图显示了相对于幅度绘制的角旋转。

2:现在,使用以下代码完成了 FFT:

import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns

class FastFourierTransform:
    # Amplitudes is a row vector
    def __init__(self, amplitudes, t):
        self.s = amplitudes
        self.t = t

    # Plotting in the input domain before fft
    def plot_input(self):
        plt.ylabel("Amplitude")
        plt.xlabel("Shaft angle [Radians]")
        plt.plot(self.t, self.s)
        plt.margins(0)
        plt.show()

        '''
        The second half of this array of fft sequence have similar frequencies
        since the frequency is the absolute value of this value.
        '''
    def fft_transform(self):
        mean_amplitude = np.mean(self.s)
        self.s = self.s - mean_amplitude # Centering around 0
        fft = np.fft.fft(self.s)

        # We now have the fft for every timestep in out plot.

        # T is the sample frequency in the data set
        T = self.t[1] - self.t[0] # This is true when the period between each sample in the time waveform is equal
        N = self.s.size  # size of the amplitude vector
        f = np.linspace(0, 1 / T, N, )  # start, stop, number of. 1 / T = frequency is the bigges freq
        plt.ylabel("Amplitude")
        plt.xlabel("Frequency [Hz]")
        y = np.abs(fft)[:N // 2] * 1 /N

        # Cutting away half of the fft frequencies.

        sns.lineplot(f[:N // 2], y) # N // 2 is normalizing it
        plt.margins(0)
        plt.show()
        time = f[:N // 2]
        return fft, time

3. 结果,标绘归一化幅度: 在此处输入图像描述

问题:

  1. 这个思维过程看起来正确吗?

  2. 说最终的 fft 图在域中是否正确?从这个链接, http: //zone.ni.com/reference/en-XX/help/372416L-01/svtconcepts/svcompfftorder/,看起来最终的情节域应该在订单域中,但我不确定因为fft是从弧度域完成的。

Tomasz Barszcz的基于振动的风力涡轮机状态监测有这张图片在此处输入图像描述

提前致谢。

标签: pythonsignal-processingfftfrequency

解决方案


推荐阅读