Study and Generate The Discrete
Study and Generate The Discrete
Study and Generate The Discrete
Task 1 : Study and generate the discrete-time signal and continuous-time signal for the
following waveforms
1. Pulse signal
t1=-3:1:3;
x1=[0,0,0,1,0,0,0];
subplot(2,1,1);
plot2d3(t1,x1);
xlabel('time');
ylabel('amplitude');
title('Unit Impulse Discrete signal');
subplot(2,1,2);
plot(t1,x1);
xlabel('time');
ylabel('amplitude');
title('Unit Impulse Continuous signal');
y (t )={1t >0
t=0:4;
y=ones(1,5);
subplot(2,1,1);
plot2d3 (t,y);
xlabel('time');
ylabel('amplitude');
title('Unit Step Discrete Signal');
subplot(2,1,2);
plot(t,y);
xlabel('time');
ylabel('amplitude');
title('Unit Step Continuous Signal');
3. Ramp signal
Equation : y1 = n1
n1=0:8;
y1=n1;
subplot(2,1,1);
plot2d3 (n1,y1);
xlabel('time');
ylabel('amplitude');
title('Unit Ramp Discrete Signal');
subplot(2,1,2);
plot(n1,y1);
xlabel('time');
ylabel('amplitude');
title('Unit Ramp Continuous Signal');
4. Sinusoidal signal
Equation :
n = 0:100;
x = 5*sin(((0.1)*%pi)*n)+sin((0.01*%pi)*n);
subplot(2,1,1);
plot2d3('gnn',n,x);
xlabel("samples");
ylabel("magnitude");
title('Sinusoidal Discrete Signal');
subplot(2,1,2);
plot('gnn',n,x);
xlabel("samples");
ylabel("magnitude");
title('Sinusoidal Continuous Signal');
5. Exponential signal
Equation :
y 2=e n 1
n1=0:8;
y1=n1;
y2=exp(n1);
subplot(2,1,1);
plot2d3 (n1,y2);
xlabel('time');
ylabel('amplitude');
title('Exponential Discrete Signal');
subplot(2,1,2);
plot(n1,y2);
xlabel('time');
ylabel('amplitude');
6. Random signal
Equation :
x=rand (1,100)
N=100;
x=rand(1,N);
subplot(2,1,1);
plot2d3 (x);
title('Random Discrete Signal');
subplot(2,1,2);
plot(x);
title('Random Continuous Signal');
Task 2 : Study and perform the basic operations on the discrete time signals. The
operations are related to amplitude manipulation and time manipulation on dependent
variable.
n1=0:10;
y1=[ones(1,5),zeros(1,6)];
7
y2=[zeros(1,3),ones(1,4),zeros(1,4)];
y3=y1+y2;
y4=y1-y2;
subplot(2,3,1);
plot2d3 (n1,y1);
xlabel('time');
ylabel('amplitude');
title('1st Signal');
subplot(2,3,2);
plot2d3 (n1,y2);
xlabel('time');
ylabel('amplitude');
title('2nd Signal');
subplot(2,3,4);
plot2d3(n1,y3);
xlabel('time');
ylabel('amplitude');
title('Addition of two discrete Signals');
subplot(2,3,5);
plot(n1,y3);
xlabel('time');
ylabel('amplitude');
title('Addition of two continuous Signals');
Task 3 : Study and perform sampling rate conversion for any arbitrary sequence signal
for up-sampling and down-sampling.
Downsampling a sinusoidal signal by a factor of 2
n = 0:%pi/200:2*%pi;
x = sin(%pi*n); //original signal
8
plot(1:length(x),x);
xtitle('original signal')
subplot(2,1,2)
plot(1:length(upsampling_x),upsampling_x);
xtitle('Upsampled Signal by a factor of 2');
10