The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> Negative power for flicker_noise()
https://designers-guide.org/forum/YaBB.pl?num=1545748007

Message started by cheap_salary on Dec 25th, 2018, 6:26am

Title: Negative power for flicker_noise()
Post by cheap_salary on Dec 25th, 2018, 6:26am

See Junction diode by Marek Mierzwinski.
http://www.designers-guide.org/VerilogAMS/semiconductors/diode/diode.va

Negative power is used for flicker_noise() in this code like following.

Code:
if (Id > 0)
  AbsId = pow(Id, af);
else
  AbsId = -pow(-Id, af);

I(anode, internal) <+ flicker_noise(kf * AbsId, 1.0, "flicker");


What does this negative power mean ?

I think negative power is nonsense.

BTW, ahdllint of Cadence Spectre does not give any warning fir this negative power.

Title: Re: Negative power for flicker_noise()
Post by Geoffrey_Coram on Jan 2nd, 2019, 1:03pm

I suspect simulators probably take the absolute value of the first argument to flicker_noise (as well as white_noise).

Title: Re: Negative power for flicker_noise()
Post by Ken Kundert on Jan 2nd, 2019, 4:03pm

I am not really sure what you mean by negative power.

Perhaps your question regards this code:

Code:
if (Id > 0)
  AbsId = pow(Id, af);
else
  AbsId = -pow(-Id, af);


This is basically a hack to handle negative currents. The pow() function requires its first argument to be non-negative, but you don't want to simply pass the first argument through an abs() function, because that changes the behavior of the model in a non-physical way.

To understand this, consider the case where af=1. In this case, the pow() function becomes a no-op, and the above collapses down to:

Code:
AbsId = Id

If you were to add an abs() function to protect the pow() function, and then set af=1, the equivalent would be

Code:
AbsId = abs(Id)

This is clearly a different behavior. To see that, consider the case were Id is a sinusoid. In the first case you are modulating the noise with a pure tone, in the second you are modulating it with a rectified sinewave, which has a high harmonic content but no component at the fundamental frequency.

If you are not comfortable with this model, just assume af=1 and simplify it down to:

Code:
I(anode, internal) <+ kf*flicker_noise(Id, 1, "flicker");


-Ken

Title: Re: Negative power for flicker_noise()
Post by cheap_salary on Jan 2nd, 2019, 10:30pm

I mean -pow()

Title: Re: Negative power for flicker_noise()
Post by Ken Kundert on Jan 2nd, 2019, 11:11pm

Did my response answer your question? If not, perhaps you can explain why the
minus sign in from of the pow() function bothers you?

-Ken

Title: Re: Negative power for flicker_noise()
Post by cheap_salary on Jan 3rd, 2019, 8:37am


Ken Kundert wrote on Jan 2nd, 2019, 11:11pm:
Did my response answer your question?
No.


Ken Kundert wrote on Jan 2nd, 2019, 11:11pm:
If not, perhaps you can explain why the
minus sign in from of the pow() function bothers you?
Yes.
AbsId<0 for Id<0.

Title: Re: Negative power for flicker_noise()
Post by Ken Kundert on Jan 3rd, 2019, 3:51pm

AbsID is a poor choice of names for that variable.

Title: Re: Negative power for flicker_noise()
Post by Geoffrey_Coram on Jan 8th, 2019, 8:40am

Indeed, AbsId is misleading.

As I mentioned in my first response, I expect simulators probably take the absolute value of the argument to flicker_noise -- for standard spice small-signal noise analysis.

For PNoise (or HBNoise), Ken's point comes into play:

Quote:
This is clearly a different behavior. To see that, consider the case were Id is a sinusoid. In the first case you are modulating the noise with a pure tone, in the second you are modulating it with a rectified sinewave, which has a high harmonic content but no component at the fundamental frequency.

Title: Re: Negative power for flicker_noise()
Post by cheap_salary on Jan 11th, 2019, 5:11am


Quote:
white_noise( PSD [ , "name"])
PSD is the power spectral density of the source where PSD is specified in units of A2/Hz or V2/Hz.

flicker_noise( power, exp [ , "name"])
power is the power of the source at 1 Hz.

[Conclusion]
Argument of Small-Signal Noise Sources in Verilog-A is power.

However negative power reflects polarity of Noise Source.

This is true for white_noise().

Quote:
I(anode, internal) <+ white_noise(2 * `P_Q * Id, "thermal");
Here PSD is not always positive.

flicker_noise(-pow()) is equivalent to -flicker_noise(pow()).


Quote:
if (Id > 0)
  AbsId = pow(Id, af);
else
  AbsId = -pow(-Id, af);
I(anode, internal) <+ flicker_noise(kf * AbsId, 1.0, "flicker");
is equivalent to

Quote:
if (Id > 0)
  I(anode, internal) <+ flicker_noise(kf * pow(abs(Id), af), 1.0, "flicker");
else
  I(anode, internal) <+ -flicker_noise(kf * pow(abs(Id), af), 1.0, "flicker");

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.