DSP EXP NO 2


EXP NO. 2TITLE: TO STUDY AND VERIFY DFT PROPERTIES 

clc;
clear all;
close all;
X1 = input('Enter the first sequence');
X2 = input('Enter the second sequence');
a = 2;
b = 3;
L1 = length(X1);
L2 = length(X2);
N = max(L1,L2);
X1= [X1,zeros(1,N-L1)];
X2= [X2,zeros(1,N-L2)];
X3= a*X1 + b*X2;
LHS = fft(X3);
disp(LHS);
RHS = a*fft(X1) + b*fft(X2);
disp(RHS);
n=0:N-1;
subplot(1,2,1);
stem(n,LHS);
xlabel('samples');
ylabel('amplitude');
subplot(1,2,2);
stem(n,RHS);
xlabel('samples');
ylabel('amplitude');

Previous Post Next Post