-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f590a48
commit a4b2def
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
Analog circuit modelings | ||
@file ame_Circuit.hpp | ||
@author Akiyuki Okayasu ([email protected]) | ||
@copyright Copyright (c) 2021 - Akiyuki Okayasu | ||
AME is released under the MIT license. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <concepts> | ||
|
||
namespace ame | ||
{ | ||
/** diode modeling. | ||
https://jatinchowdhury18.medium.com/complex-nonlinearities-epsiode-2-harmonic-exciter-cd883d888a43 | ||
@param x | ||
@return FloatType | ||
@note When the input is 1.0, the output is larger than 1.0 | ||
*/ | ||
template <std::floating_point FloatType> | ||
inline FloatType diode (FloatType x) | ||
{ | ||
return static_cast<FloatType> (0.2) * (std::exp (x * static_cast<FloatType> (0.05 / 0.0259)) - static_cast<FloatType> (1.0)); | ||
} | ||
} // namespace ame |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters