Code for Deliverable 05

This commit is contained in:
Silas Oettinghaus
2024-09-02 09:00:41 +02:00
parent 17a1dfbbd5
commit bb228ae2bd
20 changed files with 1094 additions and 73 deletions

View File

@@ -9,6 +9,9 @@ classdef PAMsource
fsym
randkey
mrds_code
mrds_blocklength
applypulseform
pulseformer
@@ -30,6 +33,9 @@ classdef PAMsource
options.fsym = 112e9;
options.randkey = 0;
options.mrds_code = 0;
options.mrds_blocklength = 512;
options.applypulseform = 1;
options.pulseformer Pulseformer;
@@ -84,22 +90,28 @@ classdef PAMsource
symbols = PAMmapper(obj.M,0).map(bits);
symbols.fs = obj.fsym;
if obj.mrds_code
symbols = MRDS_coding("blocklength",obj.mrds_blocklength).encode(symbols);
end
if obj.applyclipping
sym_min = min(symbols.signal);
sym_max = max(symbols.signal);
end
%%%%% Pulseforming %%%%%%
%%%%% Pulse-forming %%%%%%
if obj.applypulseform
digi_sig = obj.pulseformer.process(symbols);
else
digi_sig = symbols;
end
%%%%% Resample to f DAC %%%%%%
%%%%% Re-sample to f DAC %%%%%%
digi_sig = digi_sig.resample("fs_in",digi_sig.fs,"fs_out",obj.fs_out,"n",10,"beta",5);
% digi_sig.spectrum("fignum",111,"displayname","after pulseforming");
%%%%% Hard clip digital signal to PAM range before DAC %%%%%%
if obj.applyclipping
try