Added:
- 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
This commit is contained in:
39
Classes/04_DSP/Timing Recovery/Time_Shifter.m
Normal file
39
Classes/04_DSP/Timing Recovery/Time_Shifter.m
Normal file
@@ -0,0 +1,39 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user