Reworked the analysis for the Ty stage motion

This commit is contained in:
2019-05-14 17:55:59 +02:00
parent de8bf8eae9
commit 00614b2ef3
15 changed files with 324 additions and 138 deletions

View File

@@ -36,6 +36,10 @@ This Matlab function is accessible [[file:voltageToVelocityL22.m][here]].
S = S0*(s/2/pi/f0)/(1+s/2/pi/f0);
#+end_src
#+begin_src matlab
voltage = detrend(voltage);
#+end_src
#+begin_src matlab
velocity = lsim((S*10^(gain/20))\1, voltage, time);
#+end_src
@@ -70,9 +74,128 @@ This Matlab function is accessible [[file:voltageToDisplacementL22.m][here]].
#+end_src
#+begin_src matlab
voltage = voltage - mean(voltage);
velocity = voltageToVelocityL22(voltage, time, gain);
disp = lsim(1/s, velocity, time);
#+end_src
* getGroundVelocity
:PROPERTIES:
:header-args:matlab+: :tangle getGroundVelocity.m
:header-args:matlab+: :comments org :mkdirp yes
:header-args:matlab+: :eval no :results none
:END:
<<sec:getGroundVelocity>>
This Matlab function is accessible [[file:getGroundVelocity.m][here]].
#+begin_src matlab
function [time, velocity] = getGroundVelocity()
% getGroundVelocity -
%
% Syntax: [time, velocity] = voltageToVelocityL22()
%
% Inputs:
% - -
%
% Outputs:
% - time - in [s]
% - velocity - in [m/s]
current_dir = pwd;
src_dir = mfilename('fullpath');
src_dir = strsplit(src_dir, '/');
src_dir = strjoin(src_dir(1:end-1), '/');
cd(src_dir);
data = load('mat/data_028.mat', 'data'); data = data.data;
time = data(:, 3);
[velocity] = voltageToVelocityL22(data(:, 1), time, 60);
cd(current_dir);
end
#+end_src
* getGroundDisplacement
:PROPERTIES:
:header-args:matlab+: :tangle getGroundDisplacement.m
:header-args:matlab+: :comments org :mkdirp yes
:header-args:matlab+: :eval no :results none
:END:
<<sec:getGroundDisplacement>>
This Matlab function is accessible [[file:getGroundDisplacement.m][here]].
#+begin_src matlab
function [time, displacement] = getGroundDisplacement()
% getGroundDisplacement -
%
% Syntax: [time, displacement] = voltageToVelocityL22()
%
% Inputs:
% - -
%
% Outputs:
% - time - in [s]
% - displacement - in [m]
s = zpk('s');
[time, velocity] = getGroundVelocity();
displacement = lsim(1/s, velocity, time);
end
#+end_src
* getPSDGroundVelocity
:PROPERTIES:
:header-args:matlab+: :tangle getPSDGroundVelocity.m
:header-args:matlab+: :comments org :mkdirp yes
:header-args:matlab+: :eval no :results none
:END:
<<sec:getPSDGroundVelocity>>
This Matlab function is accessible [[file:getPSDGroundVelocity.m][here]].
#+begin_src matlab
function [pxx, f] = getPSDGroundVelocity()
% getPSDGroundVelocity -
%
% Syntax: [pxx, f] = voltageToVelocityL22(in_data)
%
% Outputs:
% - psd -
% - f -
[time, velocity] = getGroundVelocity();
dt = time(2) - time(1);
Fs = 1/dt;
win = hanning(ceil(10*Fs));
[pxx, f] = pwelch(velocity, win, [], [], Fs);
#+end_src
* getPSDGroundDisplacement
:PROPERTIES:
:header-args:matlab+: :tangle getPSDGroundDisplacement.m
:header-args:matlab+: :comments org :mkdirp yes
:header-args:matlab+: :eval no :results none
:END:
<<sec:getPSDGroundDisplacement>>
This Matlab function is accessible [[file:getPSDGroundDisplacement.m][here]].
#+begin_src matlab
function [pxx, f] = getPSDGroundDisplacement()
% getPSDGroundDisplacement -
%
% Syntax: [pxx, f] = voltageToVelocityL22(in_data)
%
% Outputs:
% - pxx -
% - f -
[pxx, f] = getPSDGroundVelocity();
pxx = (sqrt(pxx)./(2*pi*f)).^2;
#+end_src

View File

@@ -13,8 +13,6 @@ function [disp] = voltageToDisplacementL22(voltage, time, gain)
s = zpk('s');
voltage = voltage - mean(voltage);
velocity = voltageToVelocityL22(voltage, time, gain);
disp = lsim(1/s, velocity, time);

View File

@@ -18,4 +18,6 @@ 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);