Update April
This commit is contained in:
55
projects/MPI_April/simulate_tx_sig.m
Normal file
55
projects/MPI_April/simulate_tx_sig.m
Normal file
@@ -0,0 +1,55 @@
|
||||
function simulate_tx_sig(filename)
|
||||
|
||||
%% Params
|
||||
M=4;
|
||||
digimod = PAMmapper(M,0);
|
||||
|
||||
fdac = 120e9;
|
||||
fsym = 112e9;
|
||||
pulseform = Pulseformer("pulseform","rrc","fdac",fdac,"fsym",fsym,"pulselength",32,"rrcalpha",0.027);
|
||||
|
||||
kover = 16;
|
||||
awg = AWG('fdac',fdac,'kover',kover,'lpf_active',1,'f_cutoff',56e9,'lpf_type',filtertypes.gaussian,'bit_resolution',5.5);
|
||||
%awg = M8199B();
|
||||
|
||||
lp_laser = Filter('filtdegree',2,"f_cutoff",50e9,"fsamp",fdac*kover,"filterType",filtertypes.butterworth);
|
||||
|
||||
|
||||
|
||||
%% PROCESS TX
|
||||
|
||||
% 1) PRBS Generation
|
||||
O = 20; %order of prbs
|
||||
N = 2^(O-1); %length of prbs
|
||||
[~,seed] = prbs(O,1); %initialize first seed of prbs
|
||||
for i = 1:log2(M)
|
||||
[bitpattern(:,i),seed] = prbs(O,N,seed);
|
||||
end
|
||||
|
||||
% 2 ) Build Inf. signal class
|
||||
bits = Informationsignal(bitpattern);
|
||||
|
||||
% 3) Digi modulation -> PAM-M signal
|
||||
digimod_out = digimod.map(bits);
|
||||
|
||||
% 4) Pulse shaping -> racos
|
||||
X = pulseform.process(digimod_out);
|
||||
|
||||
% 5) AWG (lowpass, quantization, sample and hold)
|
||||
X = awg.process(X);
|
||||
|
||||
% 6) Lowpass behavior before laser
|
||||
X = lp_laser.process(X);
|
||||
|
||||
% 7) Normalize signal
|
||||
X = X.normalize("mode","oneone");
|
||||
X.signal = X.signal;
|
||||
|
||||
spectrum_plot(X.signal',X.fs,'spectrum');
|
||||
|
||||
if nargin == 1
|
||||
save(['C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\',char(filename)],'X');
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user