MATLAB CODE TO VERIFY LINEARTY PROPERTY OF DFT

CODE:
x1=input('Enter the first sequence');
x2=input('enter the second sequence');
alpha=input('Enter a constant');
beta=input('Enter a constant');
z=alpha*x1+beta*x2;
Z=fft(z);
X1=fft(x1);
X2=fft(x2);


sum=alpha*X1+beta*X2;
subplot(2,2,2);
stem(abs(Z));
title('DFT of(alpha*x1+beta*x2)');
xlabel('time index');
ylabel('amplitude');
subplot(2,1,2);
stem(abs(sum));
title('alpha*X1+beta*X2');
xlabel('time index');
ylabel('amplitude');




OUTPUT :
Enter the first sequence[9 8 7 6 5 4 3 2 1]
enter the second sequence[9 8 3 7 1 7 9 4 5]
Enter a constant2

Enter a constant3



0 comments:

Post a Comment