Module 5: Signal Generation and Basic Manipulation
5.1. Using the Signal Generator Block
While the ‘Sine Wave’ block is useful for creating pure sinusoidal signals, the ‘Signal Generator’ block offers a more versatile and powerful tool for creating the common test signals used in system modeling. This module will explore the capabilities of this block and then introduce the fundamental concept of signal manipulation through the application of time delays.
To begin, create a new blank model. From the Sources library, add a ‘Signal Generator’ block, and from the Sinks library, add a ‘Scope’ block.
The power of the ‘Signal Generator’ lies in its configurability. Double-click the block to open its parameters window. The most important parameter is the “Wave form” dropdown menu, which allows you to select from several standard waveforms, including:
- sine
- square
- sawtooth
- random
To illustrate this capability, we will examine two representative examples.
Square Wave Example
- In the ‘Signal Generator’ parameters, set the Wave form to ‘square’.
- Set the ‘Amplitude’ to 1 and the ‘Frequency’ to 1.
- Connect the ‘Signal Generator’ output to the ‘Scope’ input.
- Run the simulation. Opening the Scope will reveal a classic square wave oscillating between +1 and -1 with a frequency of 1 Hz.
Sawtooth Wave Example
- Re-open the ‘Signal Generator’ parameters and change the Wave form to ‘sawtooth’.
- Change the ‘Frequency’ to 2.
- Run the simulation again. The Scope will now display a sawtooth waveform, which ramps linearly from -1 to +1, with a higher frequency of 2 Hz.
Having explored single signal generation, we will now proceed to combine multiple signals for simultaneous analysis.
5.2. Combining Signals and Introducing Delays
Often in system analysis, it is necessary to observe the relationship between multiple signals. Let us modify our existing sawtooth model to add a second signal.
- Add a New Signal: From the Sources library, add a ‘Step’ signal block to your model. This block generates a signal that changes from one value to another at a specified time.
- Reconfigure the Scope: As we did in Module 4, open the ‘Scope’ block’s parameters and change the “Number of input ports” to 2.
- Connect Signals: Connect the ‘Signal Generator’ (still set to sawtooth) to the first scope input and the new ‘Step’ block to the second scope input.
- Run and Observe: Run the model. When you open the Scope, it will now display two plots simultaneously: the sawtooth wave and the step signal, allowing you to compare them directly.
Beyond combining signals, a fundamental operation in control systems is introducing a time delay. The ‘Transport Delay’ block is critical for modeling real-world phenomena such as signal propagation delays in communication systems or material transport times in chemical processes. We will now build a new model to demonstrate this.
- Create a New Model: Start with a ‘Sine Wave’ block and a ‘Scope’ block.
- Introduce the Delay Block: From the Continuous library, add a ‘Transport Delay’ block. This block outputs the signal that it received at a previous time.
- Configure Delay: Open the ‘Transport Delay’ block’s parameters and set the ‘Time delay’ value to 3. This means the output signal will lag the input signal by 3 seconds.
- Configure Scope: Set the ‘Scope’ block to accept two inputs.
- Make Connections: The signal routing in this configuration is critical to understanding the result:
- Connect the output of the ‘Sine Wave’ block directly to the first input of the ‘Scope’.
- Also connect the output of the ‘Sine Wave’ block to the input of the ‘Transport Delay’ block.
- Connect the output of the ‘Transport Delay’ block to the second input of the ‘Scope’.
- Analyze the Output: Run the simulation. The Scope will display two sine waves. One is the original signal, and the second is an identical wave that is shifted in time, lagging the original by exactly 3 seconds.
This module has demonstrated how to use the versatile ‘Signal Generator’ block and how to perform a basic but critical signal manipulation by introducing a time delay. Beyond these simple manipulations, Simulink’s true power lies in its ability to perform complex mathematical and logical operations on these signals.