nass-micro-station-measurem.../disturbance-control-system/matlab/effect_symetrie_driver.m
2019-05-14 10:23:44 +02:00

47 lines
1.2 KiB
Matlab

%% Clear Workspace and Close figures
clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
% Load data
% We load the data of the z axis of two geophones.
d_18 = load('mat/data_018.mat', 'data'); d_18 = d_18.data;
d_19 = load('mat/data_019.mat', 'data'); d_19 = d_19.data;
% Analysis - Time Domain
figure;
hold on;
plot(d_19(:, 3), d_19(:, 1), 'DisplayName', 'Driver - Ground');
plot(d_18(:, 3), d_18(:, 1), 'DisplayName', 'Driver - Granite');
hold off;
xlabel('Time [s]'); ylabel('Voltage [V]');
xlim([0, 50]);
legend('Location', 'bestoutside');
% Analysis - Frequency Domain
dt = d_18(2, 3) - d_18(1, 3);
Fs = 1/dt;
win = hanning(ceil(10*Fs));
% Vibrations at the sample location
% First, we compute the Power Spectral Density of the signals coming from the Geophone located at the sample location.
[px_18, f] = pwelch(d_18(:, 1), win, [], [], Fs);
[px_19, ~] = pwelch(d_19(:, 1), win, [], [], Fs);
figure;
hold on;
plot(f, sqrt(px_19), 'DisplayName', 'Driver - Ground');
plot(f, sqrt(px_18), 'DisplayName', 'Driver - Granite');
hold off;
set(gca, 'xscale', 'log');
set(gca, 'yscale', 'log');
xlabel('Frequency [Hz]'); ylabel('Amplitude Spectral Density $\left[\frac{V}{\sqrt{Hz}}\right]$')
xlim([0.1, 500]);
legend('Location', 'southwest');