In order to know how get the IP3,I find this in ads,but I can't understand the sentence that :
decl vIM = (vIMx >= 1e-304)*vIMx + (vIMx < 1e-304)*1e-304; //v3rd
What's the meaning of 1e-304?
The whole code isthis:
defun ip3_out(vOut,fundFreq,imFreq,zRef,Mix)
{
decl z0 = if (zRef == NULL) then 50.0 else zRef;
decl vFund =abs(mix(vOut,fundFreq,Mix)); //v1st
decl vIMx = abs(mix(vOut,imFreq,Mix));
decl vIM = (vIMx >= 1e-304)*vIMx + (vIMx < 1e-304)*1e-304; //v3rd
decl fund = 10 * log(0.5*real(vFund * conj(vFund)/conj(z0)))+30;
decl third = 10 * log(0.5*real(vIM * conj(vIM)/conj(z0)))+30;
return 0.5*(3*fund-third);
/*
decl vFund3 = pow(vFund,3);
decl toi = 10*log(vFund3/(2*z0*vIM));
return toi + 30;
*/
} //fun - ip3_out()
regards
Yang
decl vIM = (vIMx >= 1e-304)*vIMx + (vIMx < 1e-304)*1e-304; //v3rd
What's the meaning of 1e-304?
The whole code isthis:
defun ip3_out(vOut,fundFreq,imFreq,zRef,Mix)
{
decl z0 = if (zRef == NULL) then 50.0 else zRef;
decl vFund =abs(mix(vOut,fundFreq,Mix)); //v1st
decl vIMx = abs(mix(vOut,imFreq,Mix));
decl vIM = (vIMx >= 1e-304)*vIMx + (vIMx < 1e-304)*1e-304; //v3rd
decl fund = 10 * log(0.5*real(vFund * conj(vFund)/conj(z0)))+30;
decl third = 10 * log(0.5*real(vIM * conj(vIM)/conj(z0)))+30;
return 0.5*(3*fund-third);
/*
decl vFund3 = pow(vFund,3);
decl toi = 10*log(vFund3/(2*z0*vIM));
return toi + 30;
*/
} //fun - ip3_out()
regards
Yang
I hope I am not too late to post some answer...
I guess 1e-304 means 1*10^(-304), which is a really small number in double format (the smallest one would be around 1e-308).
So the entire line consists in assigning to vIM the value of vIMx if vIMx is larger than 1e-304, otherwise vIM will be "saturated" to the value of 1e-304.
Pascal