Sinusoidal Signal | Scigyan

Sinusoidal Signal

Matlab program to generate Sinusoidal Sequence/Signal in discrete and continuous form.

Matlab code

clc;
clear all; close all;
A=input('Enter the Amplitude of Sinewave=');
f=input('Enter the Frequency of Sinewave=');
n=input('Enter the Number of Cycle=');
Theta=input('Enter the Phase of Sinewave='); t=0:.01:n/f;
x=A*sin(2*pi*f*t+Theta); subplot(2,1,1);
plot(t,x);
axis([0 n/f -(A+.5) (A+.5)]);
title('Graph for Sinusoidal Sequence [Continuous form]'); xlabel('Time->');
ylabel('x(t)');
subplot(2,1,2);
stem(t,x);
axis([0 n/f -(A+.5) (A+.5)]);
title('Graph for Sinusoidal Sequence [Discrete form]'); xlabel('Time->');
ylabel('x[t]');

Command window

Enter the Amplitude of Sinewave=1. 
Enter the Frequency of Sinewave=5. 
Enter the Number of Cycle=2.
Enter the Phase of Sinewave=0

Figure window

Sinusoidal-Signal
No comments:
Post a Comment

Related Posts Plugin for WordPress, Blogger...