dot13
New Member
Offline
Posts: 5
|
Hi, everyone I need a balun with such performance: when the single-end port is floating or load 50 ohms, add a signal to one of the unbalanced-end, the other port will get a 180 degree inverse signal to the input, and the same p-p voltage. I found that the balun model in the rfLib can't reach my demand. When I add a signal to one of the unbalanced-end with the other two ports load 50 ohms, the single-end port have a signal, but the other unbalanced-end get nothing. So I modified the veriloga file as following, but I don't konw if it is correct. Could someone tell me? Thanks.
module balun(single, bal_p, bal_n); inout single, bal_p, bal_n; electrical single, bal_p, bal_n; parameter real rin = 50 from (0:inf); parameter real rout = 50 from (0:inf); parameter real loss = 0 from [0:inf);
real a1, a2, a3; real s21, s31, s12, s13, s23, s32;
electrical single_int, bal_p_int, bal_n_int;
analog begin
@(initial_step("static") or initial_step("pss") or initial_step("pdisto")) begin // unfold the S parameters from dB to real values s21 = pow(10,-loss/20); s21 = s21/sqrt(2.0); // energy converation law! s31 = -s21; s12 = s21; s13 = s31; s23 = -1; s32 = -1; end
// calculate the normalized incident waves: a1, a2 a1 = V(single)/sqrt(rin) + I(single, single_int)*sqrt(rin); a2 = V(bal_p)/sqrt(rout) + I(bal_p, bal_p_int)*sqrt(rout); a3 = V(bal_n)/sqrt(rout) + I(bal_n, bal_n_int)*sqrt(rout); // input // be careful about the sign of the controlled source I(single_int) <+ V(single)/rin; I(single_int) <+ -a2*s12/sqrt(rin); I(single_int) <+ -a3*s13/sqrt(rin); // output positive node I(bal_p_int) <+ V(bal_p)/rout; I(bal_p_int) <+ -a1*s21/sqrt(rout); I(bal_p_int) <+ -a3*s23/sqrt(rout); // output negative node I(bal_n_int) <+ V(bal_n)/rout; I(bal_n_int) <+ -a1*s31/sqrt(rout); I(bal_n_int) <+ -a2*s32/sqrt(rout);
end endmodule // balun
|