Generating Simple Signal in MATLAB

Generating Simple Signal in MATLAB
Here in the tutorial Generating Simple Signal in MATLAB, I will explain you the step by step procedure that how can you generate simple sinusoidal signal in MATLAB and how to visualize it.- First of all open your MATLAB software and open the editor.
- Define a time duration at which the sinusoidal signal is completely defined.
- Set the frequency of the sinusoidal signal.
- Define the sinusoidal signal as the function of time and frequency.
- Then at the end plot that sinusoidal signal across the time duration using the command
- All of the above steps are shown in the figure below.
- You can download the MATLAB simulation here by clicking on the button below.
- Download .rar file, extract it and enjoy the complete simulation.
- You can see that I have defined the time duration from 0 to
- And adjusted the frequency of the signal as
- Now press the Run button as encircled in the figure above.
- A new figure having a sinusoidal signal will be appeared on the screen.
- The sinusoidal signal is shown in the figure below.
- Now, I am going to reduce the frequency of the signal to observe that what will happen to the shape of the signal.
- I am going to reduce the frequency from 10 to 5Hz and want to observe the new shape of the signal.
- The new code with the updated frequency is shown in the figure below.
- The new signal generated is shown in the figure below.
- If we compare the both of the signals we can conclude that there is an inverse relation between the frequency and the width of the signal.
- Smaller the frequency greater will be the width of the signal and vice versa.
- So, that was the brief description of the signal generation in MATLAB.
×
![]()





































































