test-bench-pd200/matlab/analysis.m
2021-01-19 17:16:05 +01:00

22 lines
362 B
Matlab

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