% Calcualte the linear offset from data and find RMS
close all
clc

% Import file
inputSignal = NoiseProfile05;

for i=1:3
    offset_value(1,i) = mean(inputSignal(:,i));
    %detrend_value(:,i) = detrend(inputSignal(:,i));
    accel(:,i) = inputSignal(:,i)-offset_value(1,i);
    accel_RMS(1,i) = rms(accel(:,i));
end

% After removing average offset
figure;
plot(accel(:,1), 'r');
grid

figure;
plot(accel(:,2), 'g');
grid

figure;
plot(accel(:,3), 'b');
grid


% Raw Data
% figure;
% plot(inputSignal(:,1), 'r');
% grid
% 
% figure;
% plot(inputSignal(:,2), 'g');
% grid
% 
% figure;
% plot(inputSignal(:,3), 'b');

offset_value
accel_RMS
