Pages

Monday, December 13, 2010

MATLAB PROGRAM TO DISPLAY THE PROPERTIES OF DISCRETE FOURIER TRANSFORM (DFT) - MULTIPLICATION PROPERTY

%multiplication property x1(n)*x2(n)=(1/N)*circonv(X1(k)*X2(k))
clear all;
x1=input('enter the sequence=');
x2=input('enter the second seq of same length=');
N9=input ('enter the number of samples=');
x3=(x1).*(x2);  %multiplication of 2 signals
x4=fft(x1,N9);%dft of first seq
N1=length(x4);%length of sequence
x5=fft(x2,N9);%dft of secnd sequence
N2=length(x5);%length of second sequence
%finding circonvolution of 2 signals
x=x4;
h=x5;
N1=length(x);
N2=length(h);
N=max(N1,N2);
x=[x zeros(1,N-N1)];
h=[h zeros(1,N-N2)];
for n=0:N-1
    y(n+1)=0;
    for i=0:N-1
        j=mod(n-i,N);
       y(n+1)=y(n+1)+x(i+1)*h(j+1);
    end
end
y=y/N;   %rhs
x6=fft(x3,N);   %lhs
n=0:1:N-1;
subplot(121);
stem(n,x6);
title('dft of 2 multiplied signals');
grid on;
subplot(122);
stem(n,y);
title('Nth part of circular convolution of 2 dfts');
grid on;
 
OUTPUT WAVEFORM 

1 comment:

  1. kindly send posting matlab program to my mail id..
    that helping for my final year project completion...

    ReplyDelete