Posts

Showing posts with the label unit step

Realization of Discrete signals using MATLAB

Image
  MATLAB Program to plot Unit Step, Unit Impulse, Exponential, Sine and Sinc functions. Copy the following program code and paste in your MATLAB or any other similar software's Editor to run the code. Program Code: % UNIT INPULSE FUNCTION n = -5:5; r = [zeros(1,5),ones(1,1),zeros(1,5)]; subplot(2,3,1); stem(n,r); xlabel('time index'); ylabel('amplitude'); title('Unit Impluse Function'); % UNIT STEP FUNCTION n = -5:5; r = [zeros(1,5),ones(1,6)]; subplot(2,3,2); stem(n,r); xlabel('time index'); ylabel('amplitude'); title('Unit Step Function'); % EXPONENTIAL FUNCTION n = -5:5; a = 1; r = exp(a*n); subplot(2,3,4) stem(n,r); xlabel('time index'); ylabel('amplitude'); title('Exponential Function'); % SINUSOIDAL FUNCTION n = -5:5; r = sin(n); subplot(2,3,5) stem(n,r); xlabel('time index'); ylabel('amplitude'); title('Sinusoidal Function'); % SINC FUNCTION n = -10:10; r = sinc(n*.2); subplot(2,...