Signal Math.Generate Square Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
Overload List
GenerateSquare(Double, Double, Double, Double, Span<Double>)
Generates a square wave signal.
public static void GenerateSquare(
double amplitude,
double angularFrequency,
double phase,
double duty,
Span<double> destination
)Parameters
- amplitude Double
- The amplitude of the square wave.
- angularFrequency Double
- The angular frequency in radians per sample.
- phase Double
- The initial phase in radians.
- duty Double
- The duty cycle (fraction of period that is positive), typically 0.5.
- destination Span<Double>
- The destination span to write the generated signal.
Remarks
Generates a square wave where the output alternates between +A and -A based on the duty cycle. The fractional part of (ωn + φ)/(2π) determines the position within each period.
GenerateSquare(Int32, Double, Double, Double, Double)
Generates a square wave signal and returns it as a vector.
public static Vector<double> GenerateSquare(
int count,
double amplitude,
double angularFrequency,
double phase,
double duty
)Parameters
- count Int32
- The number of points in the signal.
- amplitude Double
- The amplitude of the square wave.
- angularFrequency Double
- The angular frequency in radians per sample.
- phase Double
- The initial phase in radians.
- duty Double
- The duty cycle (fraction of period that is positive), typically 0.5.
Return Value
Vector<Double>A vector containing the generated square wave signal.
GenerateSquare(Vector<Double>, Double, Double, Double, Double)
Generates a square wave signal at explicit x values and returns it as a vector.
public static Vector<double> GenerateSquare(
Vector<double> x,
double amplitude,
double angularFrequency,
double phase,
double duty
)Parameters
- x Vector<Double>
- The x values at which to evaluate the square wave.
- amplitude Double
- The amplitude of the square wave.
- angularFrequency Double
- The angular frequency in radians per x-unit.
- phase Double
- The initial phase in radians.
- duty Double
- The duty cycle (fraction of period that is positive), typically 0.5.
Return Value
Vector<Double>A vector containing the generated square wave signal.
GenerateSquare(Double, Double, Double, Double, Double, Span<Double>)
Generates a square wave signal with DC offset.
public static void GenerateSquare(
double amplitude,
double angularFrequency,
double phase,
double duty,
double offset,
Span<double> destination
)Parameters
- amplitude Double
- The amplitude of the square wave.
- angularFrequency Double
- The angular frequency in radians per sample.
- phase Double
- The initial phase in radians.
- duty Double
- The duty cycle (fraction of period that is positive), typically 0.5.
- offset Double
- The DC offset to add to the signal.
- destination Span<Double>
- The destination span to write the generated signal.
Remarks
Generates a square wave where the output alternates between c+A and c-A based on the duty cycle.
GenerateSquare(Int32, Double, Double, Double, Double, Double)
Generates a square wave signal with DC offset and returns it as a vector.
public static Vector<double> GenerateSquare(
int count,
double amplitude,
double angularFrequency,
double phase,
double duty,
double offset
)Parameters
- count Int32
- The number of points in the signal.
- amplitude Double
- The amplitude of the square wave.
- angularFrequency Double
- The angular frequency in radians per sample.
- phase Double
- The initial phase in radians.
- duty Double
- The duty cycle (fraction of period that is positive), typically 0.5.
- offset Double
- The DC offset to add to the signal.
Return Value
Vector<Double>A vector containing the generated square wave signal.
GenerateSquare(ReadOnlySpan<Double>, Double, Double, Double, Double, Span<Double>)
Generates a square wave signal at explicit x values.
public static void GenerateSquare(
ReadOnlySpan<double> x,
double amplitude,
double angularFrequency,
double phase,
double duty,
Span<double> destination
)Parameters
- x ReadOnlySpan<Double>
- The x values at which to evaluate the square wave.
- amplitude Double
- The amplitude of the square wave.
- angularFrequency Double
- The angular frequency in radians per x-unit.
- phase Double
- The initial phase in radians.
- duty Double
- The duty cycle (fraction of period that is positive), typically 0.5.
- destination Span<Double>
- The destination span to write the generated signal.
GenerateSquare(Vector<Double>, Double, Double, Double, Double, Double)
Generates a square wave signal with DC offset at explicit x values and returns it as a vector.
public static Vector<double> GenerateSquare(
Vector<double> x,
double amplitude,
double angularFrequency,
double phase,
double duty,
double offset
)Parameters
- x Vector<Double>
- The x values at which to evaluate the square wave.
- amplitude Double
- The amplitude of the square wave.
- angularFrequency Double
- The angular frequency in radians per x-unit.
- phase Double
- The initial phase in radians.
- duty Double
- The duty cycle (fraction of period that is positive), typically 0.5.
- offset Double
- The DC offset to add to the signal.
Return Value
Vector<Double>A vector containing the generated square wave signal.
GenerateSquare(ReadOnlySpan<Double>, Double, Double, Double, Double, Double, Span<Double>)
Generates a square wave signal with DC offset at explicit x values.
public static void GenerateSquare(
ReadOnlySpan<double> x,
double amplitude,
double angularFrequency,
double phase,
double duty,
double offset,
Span<double> destination
)Parameters
- x ReadOnlySpan<Double>
- The x values at which to evaluate the square wave.
- amplitude Double
- The amplitude of the square wave.
- angularFrequency Double
- The angular frequency in radians per x-unit.
- phase Double
- The initial phase in radians.
- duty Double
- The duty cycle (fraction of period that is positive), typically 0.5.
- offset Double
- The DC offset to add to the signal.
- destination Span<Double>
- The destination span to write the generated signal.