Noise measurement

This commit is contained in:
Operator Cad 2021-01-19 17:16:05 +01:00
parent 8650bb266e
commit edba0b35f5
12 changed files with 49 additions and 0 deletions

21
matlab/analysis.m Normal file
View File

@ -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');

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

26
matlab/run_test.m Normal file
View File

@ -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');

2
matlab/setup.m Normal file
View File

@ -0,0 +1,2 @@
Fs = 20e3; % [Hz]
Ts = 1/Fs; % [s]

Binary file not shown.

Binary file not shown.