changes from friday

This commit is contained in:
Silas Oettinghaus
2023-05-21 15:31:39 +02:00
parent 8d098a6c80
commit f5747bb863
9 changed files with 311 additions and 187 deletions

View File

@@ -0,0 +1,34 @@
function yout = applyPulseShaping(xin,fsym,fdac)
if ~rem(fdac,fsym)
%ist ein Vielfaches
sps = fdac / fsym;
up = sps;
dn = 1;
else
%ist kein Vielfaches
up = fdac / gcd(fdac, fsym);
dn = fsym / gcd(fdac, fsym);
sps= up;
end
%Bau das Filter (hier rrc)
racos_len = 2048;
alpha = 0.1;
h = rcosdesign(alpha,racos_len,sps);
%Apply Filter using Matlab build in fctn.
yout = upfirdn(xin,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(xin)*up/dn) -1);
yout = yout(st:en);
%Check output integrity
if round(up/dn * length(xin)) ~= length(yout)
warning('Check signal length after pulse shaping');
end
end