Sunteți pe pagina 1din 10

EKT 353 | Principles of Digital Signal Processing

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');

EKT 353 | Principles of Digital Signal Processing

2. Unit step signal


Equation :

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');

EKT 353 | Principles of Digital Signal Processing

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');

EKT 353 | Principles of Digital Signal Processing

4. Sinusoidal signal
Equation :

x (n)=5 sin ( ( 0.1 ) n ) + sin ((0.01 )n)

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');

EKT 353 | Principles of Digital Signal Processing

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');

EKT 353 | Principles of Digital Signal Processing

title('Exponential Continuous Signal');

6. Random signal
Equation :

x=rand (1,100)

N=100;
x=rand(1,N);
subplot(2,1,1);

EKT 353 | Principles of Digital Signal Processing

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

EKT 353 | Principles of Digital Signal Processing

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

EKT 353 | Principles of Digital Signal Processing

downsampling_x = x(1:2:length(x)); //downsampled by a factor of 2


subplot(2,1,1)
plot(1:length(x),x);
xtitle('original signal')
subplot(2,1,2)
plot(1:length(downsampling_x),downsampling_x);
xtitle('Downsampled Signal by a factor of 2');

Upsampling a sinusoidal signal by a factor of 2


n = 0:%pi/200:2*%pi;
x = sin(%pi*n); //original signal
upsampling_x = zeros(1,2*length(x)); //upsampled by a factor of 2
upsampling_x(1:2:2*length(x)) = x;
subplot(2,1,1)
9

EKT 353 | Principles of Digital Signal Processing

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

S-ar putea să vă placă și