diff --git a/matlab/analysis.m b/matlab/analysis.m new file mode 100644 index 0000000..b7696a7 --- /dev/null +++ b/matlab/analysis.m @@ -0,0 +1,21 @@ + + +pd200_7 = load('mat/noise_PD200_7.mat', 't', 'Vn', 'notes'); + +Ts = t(2)-t(1); + +pd200_7.Vn = pd200_7.Vn/pd200_7.notes.pre_amp.gain; + +% Peak to peak in mV +1000*(max(Vn)-min(Vn)) + +% RMS in uV +1e6*rms(Vn) + +win = hann(ceil(length(Vn)/20)); +[pxx, f] = pwelch(Vn, win, [], [], 1/Ts); + +figure; +plot(f, sqrt(pxx)); +set(gca, 'xscale', 'log'); +set(gca, 'yscale', 'log'); diff --git a/matlab/mat/noise_PD200_1.mat b/matlab/mat/noise_PD200_1.mat new file mode 100644 index 0000000..94a18af Binary files /dev/null and b/matlab/mat/noise_PD200_1.mat differ diff --git a/matlab/mat/noise_PD200_2.mat b/matlab/mat/noise_PD200_2.mat new file mode 100644 index 0000000..099bc38 Binary files /dev/null and b/matlab/mat/noise_PD200_2.mat differ diff --git a/matlab/mat/noise_PD200_3.mat b/matlab/mat/noise_PD200_3.mat new file mode 100644 index 0000000..662f72b Binary files /dev/null and b/matlab/mat/noise_PD200_3.mat differ diff --git a/matlab/mat/noise_PD200_4.mat b/matlab/mat/noise_PD200_4.mat new file mode 100644 index 0000000..d0c443e Binary files /dev/null and b/matlab/mat/noise_PD200_4.mat differ diff --git a/matlab/mat/noise_PD200_5.mat b/matlab/mat/noise_PD200_5.mat new file mode 100644 index 0000000..9e37987 Binary files /dev/null and b/matlab/mat/noise_PD200_5.mat differ diff --git a/matlab/mat/noise_PD200_6.mat b/matlab/mat/noise_PD200_6.mat new file mode 100644 index 0000000..5d6852c Binary files /dev/null and b/matlab/mat/noise_PD200_6.mat differ diff --git a/matlab/mat/noise_PD200_7.mat b/matlab/mat/noise_PD200_7.mat new file mode 100644 index 0000000..66bd080 Binary files /dev/null and b/matlab/mat/noise_PD200_7.mat differ diff --git a/matlab/run_test.m b/matlab/run_test.m new file mode 100644 index 0000000..f81d7b8 --- /dev/null +++ b/matlab/run_test.m @@ -0,0 +1,26 @@ +%% +tg = slrt; + +f = SimulinkRealTime.openFTP(tg); +mget(f, 'data/data.dat'); +close(f); + +%% Convert the Data +data = SimulinkRealTime.utils.getFileScopeData('data/data.dat').data; + +Vn = data(:, 1); +t = data(:, end); + +%% Notes +pre_amp = struct('coupling', 'DC A-B', ... + 'gain', 1000, ... + 'LPF', '12dB 0.1Hz', ... + 'HPF', '1MHz'); + +pd200 = struct('input', '50 Ohm', ... + 'offset', 0.2); + +notes = struct('pre_amp', pre_amp, 'pd_200', pd200); + +%% Save +save('mat/noise_PD200_6.mat', 't', 'Vn', 'notes'); \ No newline at end of file diff --git a/matlab/setup.m b/matlab/setup.m new file mode 100644 index 0000000..90f1344 --- /dev/null +++ b/matlab/setup.m @@ -0,0 +1,2 @@ +Fs = 20e3; % [Hz] +Ts = 1/Fs; % [s] \ No newline at end of file diff --git a/matlab/speedgoat_IO318_100k_CI_01585.mat b/matlab/speedgoat_IO318_100k_CI_01585.mat new file mode 100644 index 0000000..094402c Binary files /dev/null and b/matlab/speedgoat_IO318_100k_CI_01585.mat differ diff --git a/matlab/test_bench_pd200_noise.slx b/matlab/test_bench_pd200_noise.slx new file mode 100644 index 0000000..3c448af Binary files /dev/null and b/matlab/test_bench_pd200_noise.slx differ