【问题标题】:fft Matlab vibration time domain to frequency measurement duration= 60 sfft Matlab 振动时域到频率测量持续时间 = 60 s
【发布时间】:2020-07-20 07:50:48
【问题描述】:

我正在尝试将时域中的振动信号转换为频域(使用 fft)以显示幅度响应。但是图表是这样显示的。你能看看我哪里错了吗?

关于数据是从 1/4/2015 0:00:00 - 15/4/2015 1:46:00 开始的时域往复式压缩机的振动有 20267 行,测量持续时间 = 60 s 或 1分钟,压缩机的 RPM = 372.99152 RPM Link to dataset 在数据中 x45 = 振动 (m/s^2) 和 x52 = 压缩机的转速

%% load vibration data in csv file
filename = 'data.csv';
T = readtable(filename);

T1 = T(:,1:2);
x45 = T1{:,2};

plot(T.time,T.x45);
xlabel('Time in seconds');
ylabel('Amplitude of signal');

dc3 = dsp.DCBlocker('Algorithm','Subtract mean'); % I use mean to remove dc-offset
y3 = dc3(T.x45); 

%% Use FFT convert time domain signal into frequency domain
% FFT output follows complex notation (a+ib)
X45 = fft(y3); % X45 is the frequency domain representation

%% Retrieve the magnitude information from X45
X45_mag = abs(X45); 

%% Retrieve the phase information from X45
X45_phase = angle(X45); 

%% Frequency bins
N = length(x45);
Ts = 60; % measurement duration= 60 s or 1 minute
Fs = 1 / Ts ;
Fbins = ((0: 1/N: 1-1/N)*Fs).'; 

%% Plot magnitude response
helperFFT(Fbins,X45_mag,'Magnitude Response')

%% Plot phase response
helperFFT(Fbins,X45_phase,'Phase Response')


function helperFFT(bin, yVal,titleStr)
%Copyright 2014 The MathWorks, Inc
close all;clc;
figure;
plot(bin, yVal,'Color',[0,0,1],'LineWidth',1.5); box on; grid on;
xlabel('Frequency (Hz).'); 
if strcmp(titleStr,'Phase Response');
ylabel('Radians');
title('FFT - Phase Response');
else
ylabel('Magnitude');
title('FFT - Magnitude Response');
end

时域信号:

幅度谱:

相谱:

【问题讨论】:

    标签: matlab signal-processing fft spectrum


    【解决方案1】:

    您的幅度谱看起来不错,但您只需要绘制一半的频谱(实际信号具有复杂的共轭对称性)。

    还可以查看 periodogram 等 MATLAB 函数,它们可以为您完成上述许多工作。

    【讨论】:

    • 感谢您的建议。我对直流偏移有一些疑问。我不确定 dc-offset 是否已经删除?或者不是因为在 x=0 的频域中,幅度非常大。
    • 是的,您的时域数据显然具有较大的直流偏移,因此这在 bin 0 处显示为较大的尖峰,这是意料之中的。
    猜你喜欢
    • 2012-04-07
    • 1970-01-01
    • 1970-01-01
    • 2021-09-25
    • 2021-01-17
    • 2017-01-31
    • 1970-01-01
    • 2022-12-12
    • 2011-12-16
    相关资源
    最近更新 更多