- Class folder 'Timing Recovery' with different timing recoveries - Minimal example for the timing recovery on the FSO data - New evaluation scripts in the FSO project folder
40 lines
809 B
Matlab
40 lines
809 B
Matlab
classdef Time_Shifter < handle
|
|
|
|
properties(Access=public)
|
|
value
|
|
end
|
|
|
|
methods(Access=public)
|
|
function obj = Time_Shifter(options)
|
|
arguments(Input)
|
|
|
|
options.value = 0;
|
|
|
|
end
|
|
|
|
fn = fieldnames(options);
|
|
for n = 1:numel(fn)
|
|
obj.(fn{n}) = options.(fn{n});
|
|
end
|
|
|
|
%obj-Initialization here%
|
|
|
|
end
|
|
|
|
function [data_out, tau_hat] = process(obj, data_in)
|
|
|
|
data_out = data_in;
|
|
x = data_in.signal;
|
|
R = fft(x);
|
|
k = (0:length(R)-1).';
|
|
phaseRamp = exp(-1j * 2*pi * (k/length(R)) * obj.value);
|
|
R_shifted = R .* phaseRamp;
|
|
data_out.signal = real(ifft(R_shifted));
|
|
|
|
end
|
|
|
|
|
|
end
|
|
end
|
|
|