0% found this document useful (0 votes)
2 views

signals & system

The document contains MATLAB code for generating various continuous signals, including sinusoidal, cosine, ramp, unit step, parabolic, exponential, and impulse signals. Each section of the code plots the respective signal with specified parameters and titles. The exponential signal section includes different cases based on the values of 'a' and 'c', allowing for user input to customize the output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

signals & system

The document contains MATLAB code for generating various continuous signals, including sinusoidal, cosine, ramp, unit step, parabolic, exponential, and impulse signals. Each section of the code plots the respective signal with specified parameters and titles. The exponential signal section includes different cases based on the values of 'a' and 'c', allowing for user input to customize the output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Sinusoidal Signal:-

clc;
clear all;
close all;
t=0: 0.001: 5/50;
A=2;
f=50;
T=1/f;
x=A*sin(2*3.14*f*t);
plot(t,x);
title('Generation of continuous sinusoidal signals 22EER087');
xlabel('Time in seconds');
ylabel('Amplitude in volts');
Cosine Signal:-
clc;
clear all;
close all;
t=0: 0.001: 5/50;
A=2;
f=50;
T=1/f;
x=A*cos(2*3.14*f*t);
plot(t,x);
title('Generation of continuous cosine signals
22EER087');
xlabel('Time in seconds');
ylabel('Amplitude in volts');
Ramp Signal:-
clc;
clear all;
close all;
t=0: 0.001: 10
A=2;
x=A*t;
plot(t,x);
title('Generation of ramp signals 22EER087');
xlabel('Time in seconds');
ylabel('Amplitude in volts');
Unit Step Signal:-
clc;
clear all;
close all;
t=0:1:10;
A=2;
x=ones(1,11);
plot(t,x);
title('Generation of unit step signals
22EER087');
xlabel('Time in seconds');
ylabel('Amplitude in volts');
Unit one sided Parabolic Signal:-

clc;
clear all;
close all;
t=0:1:30;
A=2;
x=A*t.^2;
plot(t,x);
title('Generation of unit one sided parabolic signals
22EER087');
xlabel('Time in seconds');
ylabel('Amplitude in volts');
Unit two sided parabolic signal:-

clc;
clear all;
close all;
t=-30:1:30;
A=2;
x=A*t.^2;
plot(t,x);
title('Generation of unit two sided parabolic signals
22EER087');
xlabel('Time in seconds');
ylabel('Amplitude in volts');
EXPONENTIAL SIGNAL:

i) a<0:clear all;

close all;
c=input('Enter value of c:')
a=input('Enter value of a:')
t=0:0.1:50;
y=c*exp(a*t)
plot(t,y)
xlabel('TIME in seconds')
ylabel('AMPLITUDE in volts')
title('Continuous exponential Signal with a and c are
real(a<0)-22EER087')

ii) a>0:
clc;
clear all;
close all;
c=input('Enter value of c:')
a=input('Enter value of a:')
t=0:0.1:50;
y=c*exp(a*t)
plot(t,y)
xlabel('TIME in seconds')
ylabel('AMPLITUDE in volts')
title('Continuous exponential Signal with a and c are real(a>0)-
22EER087')

Enter value of c:5 c = 5


Enter value of a:2 a =2

iii) a=0:
clc;
clear all;
close all;
c=input('Enter value of c:')
a=input('Enter value of a:')
t=0:0.1:50;
y=c*exp(a*t)
plot(t,y)
xlabel('TIME in seconds')
ylabel('AMPLITUDE in volts')
title('Continuous exponential Signal with a and c are
real(a=0)-22EER087')

Enter value of c:5 c = 5


Enter value of a:0 a =0

iv) a is imaginary and c is complex:


clc;
clear all;
close all;
c=input('Enter value of c:')
a=input('Enter value of a:')
t=0:0.1:50;
y=c*exp(a*t)
xlabel('TIME in seconds')
ylabel('Amplitude in volts')
title('Continuous exponential Signal with a is imaginary and c
is complex- 22EER087')

Enter value of c:1+2i c =1.0000 + 2.0000i


Enter value of a:2i a =0.0000 + 2.0000i

v)Both a and c are imaginary:


clc;
clear all;
close all;
c=input('Enter value of c:')
a=input('Enter value of a:')
t=0:0.1:50;
y=c*exp(a*t)
plot(t,y)
xlabel('TIME in seconds')
ylabel('AMPLITUDE in volts')
title('Continuous exponential Signal with a and c are imaginary-
22EER087')
Enter value of c:1+2i
Enter value of a:1+2i

06)IMPLUSE SIGNAL :

clc;
clear all;
close all;
t=-20:0.01:20
del_t=t==0
plot(t,del_t)
title('Continuous Impulse Signal 22EER087')
xlabel('TIME in seconds')
ylabel('Amplitude in volts')
RESULT:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy