From a8daf12b20c99c121e35edaefcaa10e41f07a3b2 Mon Sep 17 00:00:00 2001 From: magf Date: Mon, 2 Feb 2026 10:15:07 +0100 Subject: [PATCH] Added: - Class folder 'Timing Recovery' with different methods - Minimal example for the timing recovery in the FSO folder - New evaluation scripts for FSO data --- Classes/00_signals/Signal.m | 11 +++++-- Classes/01_transmit/Pulseformer.m | 1 + Classes/04_DSP/Timing_Recovery.m | 49 ------------------------------- 3 files changed, 10 insertions(+), 51 deletions(-) delete mode 100644 Classes/04_DSP/Timing_Recovery.m diff --git a/Classes/00_signals/Signal.m b/Classes/00_signals/Signal.m index 3356196..e06c41f 100644 --- a/Classes/00_signals/Signal.m +++ b/Classes/00_signals/Signal.m @@ -482,6 +482,11 @@ classdef Signal yticks(round(linspace(y_min, y_max, min(10, max(4, ceil(y_range/10)))))); end grid on; + + % Add legend if not already present + if isempty(get(gca, 'Legend')) + legend; + end end @@ -924,7 +929,7 @@ classdef Signal options.displayname = ""; end - mode = 1; + mode = 2; histpoints = 2048; %% verticale resolution histpoints = floor(histpoints/2)*2+1; %% to have the eye digram centered around one point make the vertical resolution uneven @@ -965,7 +970,9 @@ classdef Signal hold on plot(eye_mat(:,n),'LineStyle',':','LineWidth',0.1,'Color',col(2,:)); end - ylabel('Amplitude of Signal'); + xlabel('Samples','Interpreter','latex') + ylabel('Amplitude of Signal','Interpreter','latex'); + xlim([0 histpoints_horizontal]) elseif mode == 1 % generate eye diagram using histogram diff --git a/Classes/01_transmit/Pulseformer.m b/Classes/01_transmit/Pulseformer.m index d137924..ebd0409 100644 --- a/Classes/01_transmit/Pulseformer.m +++ b/Classes/01_transmit/Pulseformer.m @@ -99,6 +99,7 @@ function data_out = process_(obj, data_in_signal) % For your setup (powers of 2), it will likely be integer. racos_len = obj.pulselength; % span in symbols h = rcosdesign(obj.alpha, racos_len, sps_filter, filtertype); + % h = gaussdesign(obj.alpha, racos_len, sps_filter); % Matched Filter Flip (Complex Conjugate Time Reversal) if obj.matched diff --git a/Classes/04_DSP/Timing_Recovery.m b/Classes/04_DSP/Timing_Recovery.m deleted file mode 100644 index 3999ad7..0000000 --- a/Classes/04_DSP/Timing_Recovery.m +++ /dev/null @@ -1,49 +0,0 @@ -classdef Timing_Recovery < handle - - properties(Access=public) - modulation - timing_error_detector - sps - damping_factor - normalized_loop_bandwidth - detector_gain - end - - methods(Access=public) - function obj = Timing_Recovery(options) - arguments(Input) - - options.modulation = 'PAM/PSK/QAM'; - options.timing_error_detector = 'Gardner (non-data-aided)'; - options.sps = 2; - options.damping_factor = 1.0; - options.normalized_loop_bandwidth = 0.01; - options.detector_gain = 2.7; - - end - - fn = fieldnames(options); - for n = 1:numel(fn) - obj.(fn{n}) = options.(fn{n}); - end - - %obj-Initialization here% - - end - - function [data_out, timing_error] = process(obj, data_in) - - timing_synchronization = comm.SymbolSynchronizer( ... - "Modulation", obj.modulation,... - "TimingErrorDetector", obj.timing_error_detector, ... - "SamplesPerSymbol", obj.sps, ... - "DampingFactor", obj.damping_factor, ... - "NormalizedLoopBandwidth", obj.normalized_loop_bandwidth, ... - "DetectorGain", obj.detector_gain); - data_out = data_in; - [data_out.signal, timing_error] = timing_synchronization(data_in.signal); - - end - end -end -