Matlab数据处理(一):归一化处理

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

%归一化处理
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('归一化后');

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