ecoc measurements

This commit is contained in:
Silas Labor Zizou
2025-04-13 16:29:12 +02:00
parent 00f1c557c0
commit 0236103b13
19 changed files with 709 additions and 359 deletions

View File

@@ -703,7 +703,8 @@ classdef Signal
end
if options.debug_plots
figure()
figure(121212);clf
subplot(1,2,1);
findpeaks(abs(co./max(co)),'MinPeakDistance',length(b)/2,'MinPeakHeight',0.2,'NPeaks',maxpeaknum,'SortStr','descend')
end
@@ -711,7 +712,7 @@ classdef Signal
shifts = lags(pkpos);
shifts = shifts(shifts>=0);
% shifts = shifts(shifts>=0);
if numel(shifts) > 0
@@ -720,25 +721,21 @@ classdef Signal
isFlipped = 1;
end
for c = shifts(shifts>=0)
for c = shifts
sig = obj.delay(-c,'mode','samples');
sig.signal = sig.signal(1:length(b)).*-isFlipped;
S{end+1,1} = sig;
end
%
%return/keep the sinal with the highest correlation (only within positive shifts)
[~,idx]=max(pks(shifts>=0));
[~,idx]=max(pks);
obj.signal = S{idx}.signal;
%put signal with highest corr. to first index in S array
swap = S{1};
S{1} = S{idx};
S{idx} = swap;
for c = 1:numel(shifts(shifts>0))
for c = 1:numel(shifts)
S{c}.logbook = [];
end
@@ -750,11 +747,14 @@ classdef Signal
%plot all synced signals and the ref signal
if options.debug_plots
figure;hold on;
figure(121212);hold on;
subplot(1,2,2);
for i = 1:size(S,1)
hold on
plot(S{i}.normalize('mode','oneone').signal(1000:1100),'LineWidth',0.1,'Color',[0.2157 0.4941 0.7216]);
plot(b(1000:1100),'LineWidth',1);
end
drawnow;
end
@@ -913,14 +913,12 @@ classdef Signal
elseif mode == 1
% generate eye diagram using histogram
maxA = max(sig(100:end-100));
minA = min(sig(100:end-100));
maxA = max(sig(100:end-100))*2;
minA = min(sig(100:end-100))*2;
% maxA = 0.0015;
% minA = 0;
difference= maxA-minA;
data_ind_y=round((eye_mat-minA)/difference*(histpoints-1)) +1;
@@ -940,11 +938,9 @@ classdef Signal
% beautify
cm=flip(cbrewer2("RdYlBu",4096));
% cm=flip(cbrewer2("RdBu",4096));
cm(1,:) = [1,1,1];
cm(1,:) = [0,0,0];
cm(1,:) = [1,1,1]; % set zeros to white => clean background
colormap(cm);
% colormap('turbo');
ax.Colormap(1,:) = [1,1,1];
% ax.CLim = [0 50];
if isa(obj,'Opticalsignal')
title(['Optical Eye ',options.displayname])