The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 10th, 2024, 9:30pm
Pages: 1
Send Topic Print
Amplifier model in C++ for simulationg in CppSim (Read 2019 times)
fjp@micrel.no
New Member
*
Offline



Posts: 1
Oslo, Norway
Amplifier model in C++ for simulationg in CppSim
May 30th, 2007, 7:18am
 
Hi,

I'm making a C++ model for an amplifier for simulation using CppSim. By reading "Modeling RF Systems", I can make a model that takes IIP2 and IIP3 into account, but I'm not sure how to model noise using the rand() function. Any suggestions?

What I got so far is shown below. The code and syntax adhers to CppSim rules.

init:
     a = pow(10, gain/20);
     b = a/(pow(10, iip2/10)*2*50*0.001);
     c = a*(4/3)/(pow(10, iip3/10)*2*50*0.001);
     rnf = pow(10, nf/10);
     noise_voltage_squared = 2*(rnf-1)*1.3806504e-23*300*50;
code:
     in_noisy = ((rand()/RAND_MAX)*noise_voltage_squared) - 0.5 + in;
     out = dcout + (a*in_noisy) - (b*in_noisy*in_noisy) - (c*in_noisy*in_noisy*in_noisy);


Best regards,
Fred-J.
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.