Hoffice push
This commit is contained in:
Binary file not shown.
@@ -3,11 +3,17 @@
|
||||
params = struct;
|
||||
|
||||
params.M = [4];
|
||||
params.datarate = [440];
|
||||
params.datarate = [300];
|
||||
params.rop = [0];
|
||||
|
||||
precomp_mode = 2; %0=do nothing ; 1= measure; 2=precomp active
|
||||
precomp_path = "C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\standard_system\";
|
||||
|
||||
if ismac
|
||||
precomp_path = "/Users/silasoettinghaus/Documents/MATLAB/imdd_simulation/projects/standard_system";
|
||||
else
|
||||
precomp_path = "C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\standard_system\";
|
||||
end
|
||||
|
||||
precomp_fn = "400G_simulative_setup";
|
||||
usemrds = 0;
|
||||
|
||||
@@ -46,7 +52,7 @@ for M = wh.parameter.M.values
|
||||
[Digi_sig,Symbols,Bits] = PAMsource("fsym",fsym,"M",M,"order",18,"useprbs",0,...
|
||||
"fs_out",M8199.fdac,"applyclipping",1,"clipfactor",1.7,...
|
||||
"applypulseform",0,"pulseformer",Pform,"randkey",pn_key,...
|
||||
"db_precode",1,...
|
||||
"db_precode",0,...
|
||||
"mrds_code",usemrds,"mrds_blocklength",512).process();
|
||||
|
||||
Digi_sig.eye(fsym,M);
|
||||
@@ -56,7 +62,7 @@ for M = wh.parameter.M.values
|
||||
freqresp = ChannelFreqResp("Nacq",1024,"Navg",64,"Ncp",63,'f_ref',Digi_sig.fs);
|
||||
Digi_sig = freqresp.buildOFDM();
|
||||
elseif precomp_mode == 2
|
||||
Digi_sig = freqresp.precomp(Digi_sig,'maxampdb',3,'loadPath',precomp_path,'fileName',precomp_fn);
|
||||
Digi_sig = ChannelFreqResp("Nacq",1024,"Navg",64,"Ncp",63,'f_ref',Digi_sig.fs).precomp(Digi_sig,'maxampdb',3,'loadPath',precomp_path,'fileName',precomp_fn);
|
||||
Digi_sig.spectrum("fignum",11,"displayname",'after precomp');
|
||||
end
|
||||
|
||||
@@ -165,7 +171,7 @@ for M = wh.parameter.M.values
|
||||
|
||||
toc
|
||||
disp(['Simulated: ',num2str(cnt/endcnt*100),' %']);
|
||||
wh.save('C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\MPI_August\auswertung\')
|
||||
% wh.save('C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\MPI_August\auswertung\')
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
% Define parameters
|
||||
n = 1; % Define the memory length n+1 (e.g., 1 for duobinary, 2 for tribinary, 3 for tetrabinary)
|
||||
M = 4; % Modulation order (e.g., 4 for QPSK)
|
||||
d = randi([0 M-1], 1, 100); % Example input sequence d(k)
|
||||
|
||||
% Pre-coding: bPR(k) = (d(k) - bPR(k-1)) mod M
|
||||
bPR = zeros(size(d));
|
||||
%bPR(1) = d(1); % Initial condition for pre-coding
|
||||
|
||||
for k = 1:numel(d)-1
|
||||
bPR(k+1) = mod( d(k) - bPR(k), M );
|
||||
end
|
||||
|
||||
% Polybinary coding: Convolution with (1 + z^-1)^n
|
||||
% Generate coefficients for the polybinary filter (1 + z^-1)^n
|
||||
coeff = ones(1, n+1); % Initialize coefficients with ones
|
||||
|
||||
for i = 2:n+1
|
||||
coeff(i) = nchoosek(n, i-1); % Binomial coefficient for expansion
|
||||
end
|
||||
|
||||
% Apply convolution to get the polybinary coded sequence
|
||||
polybinary_data = conv(bPR, coeff, "same");
|
||||
|
||||
% Modulo operation for decoding to stay within M levels
|
||||
d_reconstructed = mod(polybinary_data, M);
|
||||
|
||||
% Check if reconstruction is correct
|
||||
reconstruction_success = isequal(d, d_reconstructed);
|
||||
|
||||
figure(111)
|
||||
hold on
|
||||
stairs(d_reconstructed)
|
||||
stairs(d)
|
||||
|
||||
disp(['Reconstruction success: ', num2str(reconstruction_success)]);
|
||||
Reference in New Issue
Block a user