Join The Community

Premium WordPress Themes

Showing posts with label matlab. Show all posts
Showing posts with label matlab. Show all posts

Wednesday

Digital Signal Processing Lab Experiment

1) To synthesize the sequence x(n)=1,,1,2,2,3,3,2,1 for -2<=n<=5

Solution:
n=[-2:5];
x=[1,1,2,2,3,3,2,1];
plot(n,x,'o')
stem(n,x)

Write this on your MATLAB software and then you will see the graph.


2) To synthasize the expoonential impulse response x(n)=(0.9)^n for index values n=0,1,2, ..........,50

Solution:
n=[0:50];
x=(0.9).^n;
plot(n,x,'o')
grid

Write this on your MATLAB software and then you will see the graph.

Digital Signal Processing Lab Experiment 2

3) Superimposing two plots for comparison (N.B.- Problem 1 & 2)

Solution:
y=exp(-n/10);
plot(n,y,'+');
hold on
plot(n,x,'o');
hold off

Write this on your MATLAB software and then you will see the graph.



4) To generate a complex valued exponential sequence

Solution:
x=exp((2+3j)*n);
subplot(2,2,1)
plot(n,real(x),'o');
subplot(2,2,2);
plot(n,imag(x),'o');
subplot(2,2,3);
plot(n,abs(x),'o');

Write this on your MATLAB software and then you will see the graph.