add simulink file for testing apa stroke
This commit is contained in:
parent
65abbd0ec7
commit
0a848276c7
25
matlab/run_test.m
Normal file
25
matlab/run_test.m
Normal file
@ -0,0 +1,25 @@
|
||||
%%
|
||||
tg = slrt;
|
||||
|
||||
f = SimulinkRealTime.openFTP(tg);
|
||||
mget(f, 'data/data.dat');
|
||||
close(f);
|
||||
|
||||
%% Convert the Data
|
||||
data = SimulinkRealTime.utils.getFileScopeData('data/data.dat').data;
|
||||
|
||||
V = data(:, 1);
|
||||
d = data(:, 2)*1000e-6/3.333;
|
||||
t = data(:, end);
|
||||
|
||||
%% Save
|
||||
save('mat/stroke_apa_1stacks_2.mat', 't', 'V', 'd');
|
||||
|
||||
%%
|
||||
d = d - mean(d(t > 1.9 & t < 2.0));
|
||||
|
||||
figure;
|
||||
plot(t, d)
|
||||
|
||||
figure;
|
||||
plot(V, d)
|
24
matlab/setup.m
Normal file
24
matlab/setup.m
Normal file
@ -0,0 +1,24 @@
|
||||
Fs = 10e3; % [Hz]
|
||||
Ts = 1/Fs; % [s]
|
||||
|
||||
%%
|
||||
freq_LPF = 0.5; % [Hz]
|
||||
s = tf('s');
|
||||
G_lpf = (1)/(1 + s/2/pi/freq_LPF);
|
||||
Gz = c2d(G_lpf, Ts, 'tustin');
|
||||
|
||||
%%
|
||||
t = 0:Ts:12;
|
||||
V = -1*ones(size(t));
|
||||
|
||||
t0 = 2; t1 = t0 + 1;
|
||||
V(t < t0-1) = 0;
|
||||
V(t > t0 & t < t0 + pi) = 3.25 + 4.25*cos(t(t > t0 & t < t0 + pi) - t0 + pi);
|
||||
V(t > t0 + pi & t < t1 + pi) = 7.5;
|
||||
V(t > t1 + pi & t < t1 + 2*pi) = 3.25 + 4.25*cos(t(t > t1 + pi & t < t1 + 2*pi) - t1 + pi);
|
||||
V(t > t1 + 2*pi + 2) = 0;
|
||||
|
||||
w0 = 2*pi*10; xi = 1;
|
||||
V = lsim(1/(1 + 2*xi*s/w0 + s^2/w0^2), V, t);
|
||||
|
||||
Vin = [t', V];
|
BIN
matlab/speedgoat_IO318_100k_CI_01585.mat
Normal file
BIN
matlab/speedgoat_IO318_100k_CI_01585.mat
Normal file
Binary file not shown.
BIN
matlab/test_bench_apa300ml_stroke.slx
Normal file
BIN
matlab/test_bench_apa300ml_stroke.slx
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user