This video shows the steps to implement a 3 harmonics periodic Analog signal. It further shows how one can plot the discrete time signal for the equation in both MATLAB and Simulink.
It writes a simple MATLAB script and uses STEM function to plot the discrete time signal. It also makes a Simulink model and in the scope block’s window it changes the style to STEM to display the discrete time signal.
In this video it uses the below Periodic Analog signal equation with three harmonics as an example:
y = sin(wt)-3cos(2wt)+2sin(3w*t);
Complete source code and other details:
fs = 24; w = 2*pi*fs; t = 1:0.1:5; y = sin(w*t)-3*cos(2*w*t)+2*sin(3*w*t); plot(t,y, 'Marker', '*'); figure(2) stem(t,y);
Simulink Model Design: