function [velocity] = voltageToVelocityL22(voltage, time, gain)
% voltageToVelocityL22 -
%
% Syntax: [velocity] = voltageToVelocityL22(voltage, time, gain)
%
% Inputs:
%    - voltage - Measured voltage
%    - time - Time vector
%    - gain - Gain of the voltage amplifier in dB
%
% Outputs:
%    - velocity -

s = zpk('s');

S0 = 88; % Sensitivity [V/(m/s)]
f0 = 2; % Cut-off frequnecy [Hz]

S = S0*(s/2/pi/f0)/(1+s/2/pi/f0);

voltage = detrend(voltage);

velocity = lsim((S*10^(gain/20))\1, voltage, time);
