Google search

Saturday, November 14, 2009



PROGRAM:
%program for circular convolution
g=input('enter the first sequence');
h=input('enter the second sequence');
N1=length(g);
N2=length(h);
N=max(N1,N2);
N3=N1-N2;
%loop for getting equal length
if(N3==0)
    h=[h,zeros(1,N3)];
else
    g=[g,zeros(1,-N3)];
        end
        %computation of circular waves
        for n=1:N;
            y(n)=0;
            for i=1:N;
                j=n-i+1;
                if(j==0)
                    j=N+j;
                end
                y(n)=y(n)+g(i)*h(j);
            end
        end
        subplot(3,1,1);
        stem(g);
        ylabel('amplitude-->');
        xlabel('g(n)-->');
        subplot(3,1,2);
        stem(h);
        ylabel('amplitude-->');
        xlabel('h(n)-->');
        subplot(3,1,3);
        stem(y);
        ylabel('amplitude-->');
        xlabel('y(n)-->');
        disp('the resultant signal is:');y

Thursday, November 12, 2009


LINEAR CONVOLUTION

PROGRAM:
clc;
x=input('enter the first sequence');
h=input('enter the second sequence');
y=conv(h,x);
figure;
subplot(3,1,1);
stem(x);
ylabel('amplitude-->');
xlabel('a(n)-->');
subplot(3,1,2);
stem(h);
ylabel('amplitude-->');
xlabel('b(n)-->');
subplot(3,1,3);
stem(y);
ylabel('amplitude-->');
xlabel('c(n)-->');
disp('the resultant signal is');y

ECE Department




This website consists of all the information likes question papers, Q & A, programs etc for ECE Department engineering students.


Now here are some list of digital signal processing programs for 5th semester ECE dept engineering students.


5th semester
Program:


%generation of the unit impulse signal:
t=-2:1:2;
y=[zeros(1,2),ones(1,1),zeros(1,2)];
subplot(2,2,1);
stem(t,y);
ylabel('amplitude-->');
xlabel('a(n)-->');

%generation of unit step signal:
n=input('enter the N value:');
t=0:1:n-1;
y1=ones(1,n);
subplot(2,2,2);
stem(t,y1);
ylabel('amplitude-->');
xlabel('b(n)-->');

%generation of ramp signal:
n1=input('enter the length of the sequence:');
t=0:n1;
subplot(2,2,3);
stem(t,t);
ylabel('amplitude-->');
xlabel('c(n)-->');

%generation of exponential signal:
n2=input('enter the length of exponential sequence:');
t=0:2:n2;
a=input('enter the a value');
y2=exp(a*t);
subplot(2,2,4);
stem(t,y2);
ylabel('amplitude-->');
xlabel('d(n)-->');




%generation of sine signal:
t=0:.01:pi;
y=sin(2*pi*t);
figure(2);
subplot(2,1,1);
plot(t,y);
ylabel('amplitude-->');
xlabel('d(n)-->');


%generation of cosine signal:
t=0:.01:pi;
y1=cos(2*pi*t);
subplot(2,1,2);
plot(t,y1);
ylabel('amplitude-->');
xlabel('e(n)-->