Problems with Matlab Projects? You may face many Problems, but do not worry we are ready to solve your Problems. All you need to do is just leave your Comments. We will assure you that you will find a solution to your project along with future tips. On Request we will Mail you Matlab Codes for Registered Members of this site only, at free service...Follow Me.

Circular Convolution matlab code


AIM
To verify Circular Convolution.

EQUIPMENTS:

Operating System         – Windows XP
Constructor                  - Simulator
Software                      - CCStudio 3 & MATLAB 7.5

THEORY

Circular convolution is another way of finding the convolution sum of two input signals. It resembles the linear convolution, except that the sample values of one of the input signals is folded and right shifted before the convolution sum is found. Also note that circular convolution could also be found by taking the DFT of the two input signals and finding the product of the two frequency domain signals. The Inverse DFT of the product would give the output of the signal in the time domain which is the circular convolution output. The two input signals could have been of varying sample lengths. 

But we take the DFT of higher point, which ever signals levels to. For eg. If one of the signal is of length 256 and the other spans 51 samples, then we could only take 256 point DFT. So the output of IDFT would be containing 256 samples instead of 306 samples, which follows N1+N2 – 1 where N1 & N2 are the lengths 256 and 51 respectively of the two inputs. Thus the output which should have been 306 samples long is fitted into 256 samples. The256 points end up being a distorted version of the correct signal. This process is called circular convolution.

%circular convolution program

clc;
clear all;
close all;
disp('circular convolution program');

x=input('enter i/p x(n):');
m=length(x);
h=input('enter i/p sequence h(n)');
n=length(h);

subplot(2,2,1), stem(x);
title('i/p sequencce x(n)is:');
xlabel('---->n');
ylabel('---->x(n)');grid;

subplot(2,2,2), stem(h);
title('i/p sequencce h(n)is:');
xlabel('---->n');
ylabel('---->h(n)');grid;

disp('circular convolution of x(n) & h(n) is y(n):');
if(m-n~=0)
    if(m>n)
        h=[h,zeros(1,m-n)];
        n=m;
    end
        x=[x,zeros(1,n-m)];
        m=n;
end

y=zeros(1,n);
y(1)=0;
a(1)=h(1);

for j=2:n
    a(j)=h(n-j+2);
end

%ciruclar conv
for i=1:n
    y(1)=y(1)+x(i)*a(i);
    end

for k=2:n
    y(k)=0;
    % circular shift
    for j=2:n
        x2(j)=a(j-1);
    end
    x2(1)=a(n);
       
    for i=1:n
        if(i<n+1)
            a(i)=x2(i);
        y(k)=y(k)+x(i)*a(i);
        end
    end
end
y
subplot(2,2,[3,4]),stem(y);
title('convolution of x(n) & h(n) is:');
xlabel('---->n');
ylabel('---->y(n)');grid;

Result :



1 comments:

Shruti said...

Hey Bharadwaj projects! I am doing my final year project in image processing and our topic is "fast MULTIMODAL BIOMETRICS system using dybanic fingerprint authentication and enhanced iris features". It is an IEEE paper. I need codes for iris recognition using CIRCULAR HOUGH TRANSFORM and fingerprint recognition.In that I need the code for core point detection of fingerprint. Sir please help me,I really need help.Your help will be highly appreciated. Please reply asap.

Post a Comment

Recent Comments

Popular Matlab Topics

Share your knowledge - help others

Crazy over Matlab Projects ? - Join Now - Follow Me

Sites U Missed to Visit ?

Related Posts Plugin for WordPress, Blogger...

Latest Articles

Special Search For Matlab Projects

MATLAB PROJECTS

counter

Bharadwaj. Powered by Blogger.