code comments added

This commit is contained in:
Stefan Frederik 2022-02-04 18:21:25 +01:00
parent d7b45bfbf9
commit d7c35a0a3d
1 changed files with 3 additions and 3 deletions

View File

@ -253,11 +253,11 @@ static void read_binary_block(FILE *fd)
/* assign to xschem struct, memory aligned per variable, for cache locality */
if(ac) {
for(v = 0; v < xctx->graph_nvars; v += 2) { /*AC analysis: calculate magnitude */
if( v == 0 )
if( v == 0 ) /* log scale x */
xctx->graph_values[v][offset + p] = log10(sqrt( tmp[v] * tmp[v] + tmp[v + 1] * tmp[v + 1]));
else
else /* dB */
xctx->graph_values[v][offset + p] = 20 * log10(sqrt(tmp[v] * tmp[v] + tmp[v + 1] * tmp[v + 1]));
/* AC analysis: calculate phase */
xctx->graph_values[v + 1] [offset + p] = atan2(tmp[v + 1], tmp[v]) * 180.0 / XSCH_PI;
}
}