Dsp matlab program to generate Discrete and Continuous

DISCRETE & CONTINUOUS WAVES


 


 

f=input('Enter the frequency =');    

a=input('Enter the amplitude =');

t=0:.01:1;

y=a*sin(2*pi*f*t);

subplot(2,2,1)

plot(t,y)

title('continuous sine')

xlabel('time')

ylabel('amplitude')

subplot(2,2,2)

stem(t,y)

title('discrete sine')

xlabel('time')

ylabel('amplitude')

z=a*cos(2*pi*f*t);

subplot(2,2,3)

plot(t,z)

title('continuous cosine')

xlabel('time')

ylabel('amplitude')

subplot(2,2,4)

stem(t,z)

title('discrete cosine')

xlabel('time')

ylabel('amplitude')


 


 


 


 


 


 


 


 


 


 


 


 


 

Observation:


 

Enter the frequency =5

Enter the amplitude =5


 


 


 

0 comments: