Sunday 17 September 2017

MATLAB Program for Exponentially Damped Sinusoidal Wave

%program to generate an exponentially damped sinusoidal wave


close all;
clear all;


A=input('Enter the amplitude of the sinusoidal wave A = ');
f= input('Enter the frequency of the sinusoidal wave F = ');
phi=input('Enter the phase angle of sinusoid phi = ');
a=input('Enter the attenuation factor a = ');


f=f*2*pi;
t=0:.001:1;
y=A*sin(f*t + phi).*exp(-a*t);


plot(t,y);
axis([0 1 -2.2 2.2]);


%output


%Enter the amplitude of the sinusoidal wave A = 2
%Enter the frequency of the sinusoidal wave F = 10
%Enter the phase angle of sinusoid phi = 0
%Enter the attenuation factor a = 6


No comments:

Post a Comment