21 lines
450 B
Matlab
21 lines
450 B
Matlab
function [disp] = voltageToDisplacementL22(voltage, time, gain)
|
|
% voltageToDisplacementL22 -
|
|
%
|
|
% Syntax: [disp] = voltageToDisplacementL22(voltage, time, gain)
|
|
%
|
|
% Inputs:
|
|
% - voltage - Measured voltage
|
|
% - time - Time vector
|
|
% - gain - Gain of the voltage amplifier in dB
|
|
%
|
|
% Outputs:
|
|
% - disp -
|
|
|
|
s = zpk('s');
|
|
|
|
voltage = voltage - mean(voltage);
|
|
|
|
velocity = voltageToVelocityL22(voltage, time, gain);
|
|
|
|
disp = lsim(1/s, velocity, time);
|