+
+%% generate IQ file with valid constellation, for DL modulation compression
+% only in mu1_100mhz
+%constellation = [4096, -4096];
+%constellation = [2590, 7770, -7770, -2590];
+%constellation = [633, 1897, 3161, 4425, -4424, -3160, -1897, -633];
+constellation_all = [628, 1885, 3141, 4398, 5654, 6911, 8167, 9424, -9424, -8167, -6911, -5654, -4398, -3141, -1885, -628;
+ 633, 1897, 3161, 4425, -4424, -3160, -1897, -633, 633, 1897, 3161, 4425, -4424, -3160, -1897, -633;
+ 2590, 7770, -7770, -2590, 2590, 7770, -7770, -2590, 2590, 7770, -7770, -2590, 2590, 7770, -7770, -2590;
+ 4096, -4096, 4096, -4096, 4096, -4096, 4096, -4096, 4096, -4096, 4096, -4096, 4096, -4096, 4096, -4096;
+ ];
+
+numRBs = 273
+nSlots = 20
+path_all = ...
+ [
+ "./usecase/cat_a/mu1_100mhz/";
+ "./usecase/cat_b/mu1_100mhz/";
+ "./usecase/cat_b/mu1_100mhz/";
+ "./usecase/cat_b/mu1_100mhz/";
+ ]
+path_all = cellstr(path_all)
+modtype_all = ...
+ [
+ "256qam_ant_";
+ "64qam_ant_";
+ "16qam_ant_";
+ "qpsk_ant_";
+ ]
+modtype_all = cellstr(modtype_all)
+
+for test_num = 1:4
+ path = path_all(test_num);
+ constellation=constellation_all(test_num,:);
+ modtype = modtype_all(test_num);
+ for ant = 1:4
+ ant_in = rand(2*12*numRBs*14*nSlots,1); % random constellation
+ ant_in = 1+round(15 * ant_in);
+ ant_out = constellation(ant_in);
+ file_name = strcat(path,modtype, num2str(ant-1),".bin");
+ disp(file_name)
+ fileID = fopen(file_name,'w');
+ fwrite(fileID, ant_out, 'int16');
+ fclose(fileID);
+ end
+end
+
+