首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >fft Matlab振动时域到频率测量duration= 60 s

fft Matlab振动时域到频率测量duration= 60 s
EN

Stack Overflow用户
提问于 2020-07-20 15:50:49
回答 1查看 223关注 0票数 0

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

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

代码语言:javascript
复制
%% 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

时域信号:

星等谱:

相位谱:

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-07-20 16:52:12

你的幅度谱看起来还可以,但你只需要画出谱的一半(实际信号具有复共轭对称性)。

还可以查看MATLAB函数,如periodogram,它们为您完成了大量上述工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62990883

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档