You are on page 1of 10

Experiment -1

AIM: Generation of basic signals.

1. Generation of discrete unit impulse signal.


t=-2:1:2;
y=[zeros(1,2),ones(1,1),zeros(1,2)];
subplot(2,2,1);
stem(t,y);
ylabel('amplitude -->');
xlabel('a(n) -->');

output:

2. Generation of analog unit impulse signal.


t=-2:1:2;
y=[zeros(1,2),ones(1,1),zeros(1,2)];
subplot(2,2,1);
plot(t,y);
ylabel('amplitude -->');
xlabel('a(t) -->');

Output:

3. Generation of discrete unit step signal.


t=0:1:8-1;
y1=ones(1,8);
subplot(2,2,2);
stem(t,y1);
ylabel('amplitude -->');
xlabel('a(n) -->');

Output:

4. Generation of analog unit step signal.


t=0:1:8-1;
y1=ones(1,8);
subplot(2,2,2);
plot(t,y1);
ylabel('amplitude -->');
xlabel('a(t) -->');

Output:

5. Generation of discrete ramp signal.


n=input('enter the length of ramp sequence = ');
t=0:n;
subplot(2,2,3);
stem(t,t);
ylabel('amplitude -->');
xlabel('a(n) -->');

Output:

6. Generation of analog ramp signal.


n=input('enter the length of ramp sequence = ');
t=0:n;
subplot(2,2,3);
plot(t,t);
ylabel('amplitude -->');
xlabel('a(t) -->');

Output:

7. Generation of discrete sine signal.


t=0:0.05:pi;
y=sin(2*pi*t);
figure(2);
subplot(2,1,1);
stem(t,y);
ylabel('amplitude -->');
xlabel('a(n) -->');

Output:

8. Generation of analog sine signal.


t=0:0.05:pi;
y=sin(2*pi*t);
figure(2);
subplot(2,1,1);
plot(t,y);
ylabel('amplitude -->');
xlabel('a(t) -->');

Output:

9. Generation of discrete cosine signal.


t=0:0.05:pi;
y=cos(2*pi*t);
figure(2);
subplot(2,1,1);
stem(t,y);
ylabel('amplitude -->');
xlabel('a(n) -->');

Output:

10. Generation of analog cosine signal.


t=0:0.05:pi;
y=cos(2*pi*t);
figure(2);
subplot(2,1,1);
plot(t,y);
ylabel('amplitude -->');
xlabel('a(t) -->');

Output:

You might also like