Bald fertig für richtige Nutzung - Move_it vergleich fertig

Complete Checkup with Move_it: this framework is an almost perfect reproduction.
This commit is contained in:
Silas Oettinghaus
2023-06-08 15:33:57 +02:00
parent 2868887a15
commit 2aeacafe78
14 changed files with 198 additions and 122 deletions

View File

@@ -41,7 +41,7 @@ classdef Pulseformer
signalclass_in.signal = obj.process_(signalclass_in.signal);
% append to logbook
lbdesc = ['Applied Pulseshaping'];
lbdesc = 'Applied Pulseshaping';
signalclass_in = signalclass_in.logbookentry(lbdesc);
% write to output
@@ -83,23 +83,56 @@ classdef Pulseformer
if obj.pulseform == pulseform.rrc
%Bau das Filter (hier rrc)
racos_len = obj.pulselength ;
racos_len = obj.pulselength*2 ;
alpha = obj.rrcalpha;
h = rcosdesign(alpha,racos_len,sps);
h = h./ max(h);
end
%Apply Filter using Matlab build in fctn.
data_out = upfirdn(data_in,h,up,dn);
% Apply filter the long way (from move_it)
% block length in samples
data_in = data_in';
blen = length(data_in)*sps;
% oversample symbol sequence
symbolov=zeros(size(data_in,1),blen);
symbolov(:,1:sps:blen-sps+1)=data_in;
%cut signal, which is longer due to fir filter
st = round(up/dn*racos_len/2); %we need to cut y_out
en = round(st + (length(data_in)*up/dn) -1);
H=fft(h,blen);
% Convolution of Bit sequence with impulse response
data_out = data_out(st:en);
% cyclic convolution
data_out=ifft( fft(symbolov.') .* repmat( H,size(data_in,1),1 ).' ).';
data_out = circshift(data_out,[0 -(obj.pulselength*sps)]);
if rem(obj.fdac,obj.fsym)
data_out = data_out(1:dn:end); %!
end
% %Apply Filter using Matlab build in fctn.
% data_out = upfirdn(data_in,h,up,dn);
%
% %cut signal, which is longer due to fir filter
% st = round(up/dn*racos_len/2); %we need to cut y_out
% en = round(st + (length(data_in)*up/dn) -1);
%
% data_out = data_out(st:en);
%scaling?! see pulsef module line 696
scale = max(max([abs(real(data_out)) abs(imag(data_out))])); %find max value from real and imag part
data_out = data_out./scale;
data_out = data_out';
%Check output integrity
if round(up/dn * length(data_in)) ~= length(data_out)
warning('Check signal length after pulse shaping');
%warning('Check signal length after pulse shaping');
disp('Check signal length after pulse shaping');
end