Académique Documents
Professionnel Documents
Culture Documents
2
%Aim: To generate basic signals- unit sample, unit step, ramp signal, exponential, complex
signal.
%Author: Ameya Singru, Akshay Jain, Abhishek Sharma
close all;
%sine
subplot(3,3,1);
title('Sine function');
x=0:0.1:4;
y=sin(2*pi*x/2);
stem(y);
xlabel('time');
ylabel('amplitude');
title('Sine function');
%unit step
subplot(3,3,2);
x=0:0.01:4;
y=ones(5,1);
plot(y);
stem(y);
xlabel('time');
ylabel('amplitude');
title('Unit step');
%ramp signal
subplot(3,3,3);
x=0:0.1:4;
y=x;
stem(y);
xlabel('time');
ylabel('amplitude')
title('Ramp');
%exponential signal
subplot(3,3,4);
x=0:0.05:2;
y=exp(x);
stem(y);
xlabel('time');
ylabel('amplitude')
title('Exponential');
%Complex signal;
subplot(3,3,5);
p=-0.166 + (pi*i);
n=0:0.01:4;
h=2*exp(p*n);
plot(h);
xlabel('time');
ylabel('amplitude')
title('Complex');
subplot(3,3,6);
plot(real(h));
xlabel('time');
ylabel('amplitude');
title('Real part');
subplot(3,3,7);
plot(imag(h));
xlabel('time');
ylabel('amplitude');
title('Imaginary');