最近在做毕业设计,涉及了不少关于实验数据处理的方法。这里介绍一下数据归一化处理。
其中:ax是实验采集的加速度值,是关于时间变化的离散数值;读取数据之后利用巴特沃斯滤波器滤去高频信号,最后进行可视化和归一化处理;

%归一化处理
clear;clc;
%导入数据ax
StepData = xlsread(\'C:\Users\S5 war\Desktop\DataAnalsis\GROUND.xlsx\');
time = StepData(:,1);
ax = StepData(:,2);

%Butterworth滤波
fs = 20;
fc = 2;
Wc = 2*fc/fs;
[b,a] = butter(4,Wc);
SignalFilter = filter(b,a,ax);

%可视化
figure(1);
subplot(2,1,1);
plot(time,SignalFilter,\'b-\');legend(\'ax_1\');xlabel(\'时间\');ylabel(\'加速度\');title(\'归一化前\');
%归一化处理
subplot(2,1,2);
nMax = max(SignalFilter); nMin = min(SignalFilter);
ax_norm = (SignalFilter - nMin)/(nMax - nMin);
plot(time,ax_norm,\'r-\');legend(\'ax_2\');xlabel(\'时间\');ylabel(\'加速度\');title(\'归一化后\');

输出结果:
归一化前后数据比较

相关文章:

  • 2021-10-29
  • 2021-12-01
  • 2021-04-06
  • 2021-12-14
  • 2022-02-21
  • 2021-04-26
  • 2022-12-23
猜你喜欢
  • 2021-09-04
  • 2021-10-18
  • 2022-12-23
  • 2021-09-14
  • 2021-04-04
相关资源
相似解决方案