Master Thesis Code
by Simon Moser
Loading...
Searching...
No Matches
exp_240213_pressureMembrane.m
Go to the documentation of this file.
1%
2% For LICENSE / TERMS OF USE, see the file LICENSE in the root directory of the repository.
3
4clear; close all; clc;
5
6%% get data path and files
7datapath = getDataPath();
8datapath = fullfile(datapath, "self_captured/240213_pressure_membrane");
9
10% get all the .BIN files in the directory
11files = dir(fullfile(datapath, "*.BIN"));
12
13% import the data
14for i = 1:length(files)
15data(i) = jumpReadData(fullfile(datapath, files(i).name));
16end
17
18% downsample the data to 5 Hz (actual pressure data is 5 Hz)
19for i = 1:length(data)
20data(i).tt = retime(data(i).tt, "regular", "nearest", "SampleRate", 5);
21end
22
23%% find risetimes
24% sensor 1 (indices found by hand)
25start_idx_1 = [ 1, 163, 326, 518, 693, 892, 1061, 1267];
26stop_idx_1 = [146, 289, 453, 670, 868, 1044, 1227, 1347];
27
28% sensor 2 (indices found by hand)
29start_idx_2 = [ 3, 157, 296, 490, 685, 883, 1057, 1262];
30stop_idx_2 = [147, 281, 448, 676, 871, 1043, 1217, 1345];
31
32% sensor 3 (indices found by hand)
33start_idx_3 = [ 6, 158, 298, 506, 691, 885, 1056, 1262];
34stop_idx_3 = [148, 281, 448, 673, 871, 1046, 1224, 1350];
35
36start_idx = [start_idx_1; start_idx_2; start_idx_3];
37stop_idx = [stop_idx_1; stop_idx_2; stop_idx_3];
38
39% find risetimes
40
41debug = false;
42
43for i = 1:length(data)
44 for j=1:length(start_idx)
45 risetimes(i,j) = risetime(data(i).tt.prs(start_idx(i,j):stop_idx(i,j)),5);
46 if debug
47 risetime(data(i).tt.prs(start_idx(i,j):stop_idx(i,j)),5);
48 title(sprintf("Risetime %0.2f s", round(risetimes(j),2)));
49 ylabel("Level (mbar)")
50 end
51 end
52end
53
54risetimes = reshape(risetimes, [1, numel(risetimes)]);
55
56stem(risetimes);
57
58% result: it seems that the risetimes are not very consistent, but the
59% average risetime is around 0.52 s. for the model I'm assuming a mean risetime
60% of 0.6 s with a standard deviation of 0.2 s.
function getDataPath()