Thursday 21 August 2014

Write a Program to develop program module based on operatios on sequences like signal folding and signal shifting.


Code:
n=0:3
x=input('Enter Input Signal:')
%Input Signal
subplot(2,2,1)
stem(n,x)
xlabel('n-->')
ylabel('x(n)-->')
title('Input Signal:')
%Folded Signal
subplot(2,2,2)
n1=-n
stem(n1,x)
xlabel('n-->')
ylabel('x(n)-->')
title('Folded Signal:')
%Shifted Signal
N=length(x)
a=input('Enter the +ve Shift:')
b=input('Enter the -ve shift:')
subplot(2,2,3)
c=a:a+N-1
stem(c,x)
xlabel('n-->')
ylabel('c(n)-->')
title('Delayed Shifted Signal:')
subplot(2,2,4)
d=b:b+N-1
stem(d,x)
xlabel('n-->')
ylabel('d(n)-->')
title('Advanced Shifted Signal:')

No comments:

Post a Comment