Commit 18a3747e authored by Sakthivel Velumani's avatar Sakthivel Velumani

added the changed octave script

parent fbd4df01
......@@ -126,6 +126,49 @@ end
end
end
%%QPSK byte
for b0=0:1
for b1=0:1
for b2=0:1
for b3=0:1
for b4=0:1
for b5=0:1
for b6=0:1
for b7=0:1
qpsk_byte_table2(b7*128+b6*64+b5*32+b4*16+b3*8+b2*4+b1*2+b0*1+1,:)=[(1-b0*2)*QPSK (1-2*b1)*QPSK (1-b2*2)*QPSK (1-2*b3)*QPSK ...
(1-b4*2)*QPSK (1-2*b5)*QPSK (1-b6*2)*QPSK (1-2*b7)*QPSK];
end
end
end
end
end
end
end
end
%%16QAM byte
qam16_byte_table2=[];
for b0=0:1
for b1=0:1
for b2=0:1
for b3=0:1
for b4=0:1
for b5=0:1
for b6=0:1
for b7=0:1
qam16_byte_table2(b7*128+b6*64+b5*32+b4*16+b3*8+b2*4+b1*2+b0*1+1,:)=[qam16_table(b0*2+b2*1+1) qam16_table(b1*2+b3*1+1) ...
qam16_table(b4*2+b6*1+1) qam16_table(b5*2+b7*1+1) ];
end
end
end
end
end
end
end
end
table = round(K * [ 0; bpsk_table(:); qpsk_table(:);qam16_table2(:); qam64_table2(:);qam256_table2(:) ]);
%scatter (real(qam256_table2), imag(qam256_table2), 'x');
save mod_table.mat table
......@@ -133,6 +176,8 @@ save mod_table.mat table
table2 = zeros(1,length(table)*2);
table2(1:2:end) = real(table);
table2(2:2:end) = imag(table);
qpsk_byte_table2=round(K * qpsk_byte_table2'(:));
qam16_byte_table2=round(K * qam16_byte_table2'(:));
fd = fopen("nr_mod_table.h","w");
fprintf(fd,"#define NR_MOD_TABLE_SIZE_SHORT %d\n", length(table)*2);
......@@ -144,4 +189,10 @@ fprintf(fd,"#define NR_MOD_TABLE_QAM256_OFFSET %d\n", 87);
fprintf(fd,"short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT] = {");
fprintf(fd,"%d,",table2(1:end-1));
fprintf(fd,"%d};\n",table2(end));
fprintf(fd,"short nr_qpsk_mod_table[2048] = {");
fprintf(fd,"%d,",qpsk_byte_table2(1:end-1));
fprintf(fd,"%d};\n",qpsk_byte_table2(end));
fprintf(fd,"short nr_qam16_mod_table[1024] = {");
fprintf(fd,"%d,",qam16_byte_table2(1:end-1));
fprintf(fd,"%d};\n",qam16_byte_table2(end));
fclose(fd);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment