Skip to content

Commit

Permalink
Merge pull request modelica#4074 from christoff-buerger/modelica#3971-…
Browse files Browse the repository at this point in the history
…fix

Fix for modelica#3971.
  • Loading branch information
christoff-buerger committed Mar 7, 2023
2 parents f2af3b3 + 3281d92 commit ef08d88
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Modelica/Clocked/RealSignals/Interfaces/PartialNoise.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@ within Modelica.Clocked.RealSignals.Interfaces;
partial block PartialNoise
"Interface for SISO blocks with Real signals that add noise to the signal"
extends Clocked.RealSignals.Interfaces.PartialClockedSISO;

parameter Real noiseMax=0.1 "Upper limit of noise band";
parameter Real noiseMin=-noiseMax "Lower limit of noise band";
annotation (Documentation(info="<html>
<p>Interface block for uniformly distributed noise in some range noiseMin&nbsp;&hellip;&nbsp;noiseMax applied to a clocked Real input signal; the resulting noisy signal is provided as clocked Real output signal.</p>
</html>"));
end PartialNoise;
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
within Modelica.Clocked.RealSignals.Sampler.Utilities.Internal;
block UniformNoise "Add band-limited uniform noise using a variant of the Wichmann-Hill algorithm"
extends Clocked.RealSignals.Interfaces.PartialNoise;
parameter Real noiseMax=0.1 "Upper limit of noise band";
parameter Real noiseMin=-noiseMax "Lower limit of noise band";
parameter Integer firstSeed[3](each min=0, each max=255) = {23,87,187}
"Integer[3] defining random sequence; required element range: 0..255";
protected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ within Modelica.Clocked.RealSignals.Sampler.Utilities.Internal;
block UniformNoiseXorshift64star
"Add band-limited uniform noise based on a xorshift64* number generator"
extends Clocked.RealSignals.Interfaces.PartialNoise;
parameter Real noiseMax=0.1 "Upper limit of noise band";
parameter Real noiseMin=-noiseMax "Lower limit of noise band";

parameter Integer globalSeed = 30020 "Global seed to initialize random number generator";
// Random number generators with exposed state
Expand Down

0 comments on commit ef08d88

Please sign in to comment.