Wednesday, July 20, 2011

MATLAB Programs 15: Generating an exponentially damped sinusoidal signal

Program to illustrate the concept of exponentially damped sinusoidal signal is given below.


%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

1 comments:

Anonymous said...

thank you

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | coupon codes