2019-07-15 11:07:24 +02:00
|
|
|
% computePsdDispl
|
|
|
|
% :PROPERTIES:
|
|
|
|
% :header-args:matlab+: :tangle src/computePsdDispl.m
|
|
|
|
% :header-args:matlab+: :comments org :mkdirp yes
|
|
|
|
% :header-args:matlab+: :eval no :results none
|
|
|
|
% :END:
|
|
|
|
% <<sec:computePsdDispl>>
|
|
|
|
|
|
|
|
% This Matlab function is accessible [[file:src/computePsdDispl.m][here]].
|
|
|
|
|
|
|
|
|
2018-10-07 22:07:21 +02:00
|
|
|
function [psd_object] = computePsdDispl(sys_data, t_init, n_av)
|
|
|
|
i_init = find(sys_data.time > t_init, 1);
|
|
|
|
|
|
|
|
han_win = hanning(ceil(length(sys_data.Dx(i_init:end, :))/n_av));
|
|
|
|
Fs = 1/sys_data.time(2);
|
|
|
|
|
|
|
|
[pdx, f] = pwelch(sys_data.Dx(i_init:end, :), han_win, [], [], Fs);
|
|
|
|
[pdy, ~] = pwelch(sys_data.Dy(i_init:end, :), han_win, [], [], Fs);
|
|
|
|
[pdz, ~] = pwelch(sys_data.Dz(i_init:end, :), han_win, [], [], Fs);
|
|
|
|
|
|
|
|
[prx, ~] = pwelch(sys_data.Rx(i_init:end, :), han_win, [], [], Fs);
|
|
|
|
[pry, ~] = pwelch(sys_data.Ry(i_init:end, :), han_win, [], [], Fs);
|
|
|
|
[prz, ~] = pwelch(sys_data.Rz(i_init:end, :), han_win, [], [], Fs);
|
|
|
|
|
|
|
|
psd_object = struct(...
|
|
|
|
'f', f, ...
|
|
|
|
'dx', pdx, ...
|
|
|
|
'dy', pdy, ...
|
|
|
|
'dz', pdz, ...
|
|
|
|
'rx', prx, ...
|
|
|
|
'ry', pry, ...
|
|
|
|
'rz', prz);
|
|
|
|
end
|