Description
The Signal Generator produces various types of electrical signals with configurable parameters including amplitude, frequency, offset, phase, and duty cycle. It supports multiple waveform profiles and automatically detects signal states such as high, low, rising edge, and falling edge.
Example Use Cases
- Clock Signal Generation: Provide timing signals for digital components and data encoding models.
- Sensor Excitation: Generate test signals for sensor calibration and verification.
- Control System Testing: Produce reference waveforms for control loop analysis.
Module Implementation
The signal generator produces time-varying output based on the selected profile and control type (voltage or current).
Signal Profiles
The generator supports the following waveform types:
| Profile | Description |
|---|---|
| Constant | Fixed DC value |
| Sine | Sinusoidal waveform |
| Square | Digital square wave with configurable duty cycle |
| Triangle | Symmetric triangle wave |
| Sawtooth | Rising ramp that resets at each period |
| Pulse | Pulse wave with variable duty cycle |
| Ramp | Bidirectional ramp waveform |
Sine Wave
The sinusoidal output is calculated as:
where is the amplitude, is the frequency, is the phase, and is the DC offset.
Square and Pulse Waves
For square and pulse waveforms, the duty cycle determines the fraction of each period spent in the high state:
State Detection
The generator automatically determines the signal state based on the waveform:
- High/Low: Signal is at or near peak/trough values
- Rising Edge: Signal is transitioning from low to high
- Falling Edge: Signal is transitioning from high to low
- Constant: Signal is not time-varying
An edge detection window parameter controls how transitions are classified relative to the simulation time step.
Assumptions/Limitations
- The generator outputs either voltage or current based on the control type setting, not both simultaneously.
- Edge detection accuracy depends on the simulation time step relative to the signal frequency.