Monday 26 May 2014

find the stability of the following systems and responce using matlab


1.       Write the program to find the stability of the following systems:
a.       H(z) = (1 – 0.8 z-1)/(1 – 1.5z-1  - 0.9z-2 )
Plot all the responses.
Programme :
clc;
clear all;
close all;
b=input('Enter the coefficeint of input(numerator) : ');
a=input('Enter the coefficeint of output(denominator) :');
n = [-100:1000];
h = impz(b,a,n);
subplot(1,1,1);
stem(n,h);
title('Impulse Response Q1');
xlabel('n');
ylabel('h(n)');

OUTPUT:

Ø  Here, IR (impulse response)  of system goes to infinity,
Ø  So We can say that SYSTEM IS  NOT STABLE.
2.       Write the program to find the stability of the following systems:
b.      y(n) = x(n) – 4 x(n - 1) + 3 x(n - 2) + 1.7 x(n - 3) + 1.7 y(n - 1) –y(n - 2)

Plot all the responses.
Programme :
clc;
clear all;
close all;
b=input('Enter the coefficeint of input(numerator) : ');
a=input('Enter the coefficeint of output(denominator) :');
n = [-100:1000];
h = impz(b,a,n);
subplot(1,1,1);
stem(n,h);
title('Impulse Response Q1');
xlabel('n');
ylabel('h(n)');

OUTPUT:



Ø  Here, IR (impulse response)  of system DOES NOT goes to infinity,
Ø  So we can say that SYSTEM IS STABLE.

1.       Write the program to find the stability of the following systems:

c.       y(n) = x(n – 1) + y(n - 1) +y(n - 2)

Plot all the responses.
Programme :
clc;
clear all;
close all;
b=input('Enter the coefficeint of input(numerator) : ');
a=input('Enter the coefficeint of output(denominator) :');
n = [-100:1000];
h = impz(b,a,n);
subplot(1,1,1);
stem(n,h);
title('Impulse Response Q1');
xlabel('n');
ylabel('h(n)');

OUTPUT:



Ø  Here, IR (impulse response)  of system goes to infinity,
Ø  So We can say that SYSTEM IS  NOT STABLE.


1.       Write the program to find the stability of the following systems:

d.      y(n) = 2 x(n) – x(n – 2) +0.7 y(n – 1) – 1.1 y(n – 2)
Plot all the responses.
Programme :
clc;
clear all;
close all;
b=input('Enter the coefficeint of input(numerator) : ');
a=input('Enter the coefficeint of output(denominator) :');
n = [-100:1000];
h = impz(b,a,n);
subplot(1,1,1);
stem(n,h);
title('Impulse Response Que-1.d');
xlabel('n');
ylabel('h(n)');

OUTPUT:

Ø  Here, IR (impulse response)  of system goes to infinity,
Ø  So We can say that SYSTEM IS  NOT STABLE.
1.       Write the program to find the stability of the following systems:

e.      y(n) = x( n) + 0.6 y(n – 1) – 0.08y(n – 2)
Plot all the responses.
Programme :
clc;
clear all;
close all;
b=input('Enter the coefficeint of input(numerator) : ');
a=input('Enter the coefficeint of output(denominator) :');
n = [-100:1000];
h = impz(b,a,n);
subplot(1,1,1);
stem(n,h);
title('Impulse Response Que-1.e');
xlabel('n');
ylabel('h(n)');

OUTPUT:

Ø  Here, IR (impulse response)  of system DOES NOT  goes to infinity,
Ø  So We can say that SYSTEM IS  STABLE.
2.       Consider the following two discrete time systems characterized by the difference equation for 200 samples:
a.       y(n) = 0.5 x(n) + 0.27x(n - 1) + 0.77 x(n - 2)
b.      y(n) = 0.45x(n) + 0.5 x(n - 1) + 0.45x(n - 2) + 0.53 y(n - 1) – 0.46 y(n - 2)
Compute the output of the above two systems for an input
X(n) = cos(20πn/256) + cos(200πn/256), with 0≤ n ≤ 299.
 Plot all the responses. Also plot the time shifted responses by selecting appropriate time delay.
Program:

% Generate the input sequence
clc;
close all;
clear all;
n = 0:299;
x1 = cos(2*pi*10*(n)/256);
x2 = cos(2*pi*100*(n)/256);
x = x1+x2;
x3 = cos(2*pi*10*(n-5)/256);  %input sequence Delayed by 5 samples/time
x4 = cos(2*pi*100*(n-5)/256); %input sequence Delayed by 5 samples/time
x5 = x3+x4;

% Compute the output sequences
%den1 = [0 1 0 0];
num1 = [0.5 0.27 0.77];
y1 = filter(num1,1,x); % Output of System No. 1
y5 = filter(num1,1,x5); % Delayed Output of System No. 1

den2 = [1 -0.53 0.46];
num2 = [0.45 0.5 0.45];
y2 = filter(num2,den2,x); % Output of System No. 2
y6 = filter(num2,den2,x5); % Delayed Output of System No. 1

% Plot the output sequences
subplot(2,2,1);
plot(n,y1);axis([0 300 -2 2]);
ylabel('Amplitude');
title('Output of System No. 1');grid;
subplot(2,2,2);
plot(n,y2);axis([0 300 -2 2]);
xlabel('Time index n');
ylabel('Amplitude');
title('Output of System No. 2');grid;
subplot(2,2,3);
plot(n,y5);axis([0 300 -2 2]);
ylabel('Amplitude');
title('delayed Output of System No. 1');grid;
subplot(2,2,4);
plot(n,y6);axis([0 300 -2 2]);
xlabel('Time index n');
ylabel('Amplitude');
title('delayed Output of System No. 2');grid;

OUTPUT:


No comments: