SlideShare a Scribd company logo
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 1
Babaria Institute of Technology
Electrical Engineering Department
Semester :4 Branch:EE
Subject: Signals & Systems (2141005) Experiment No. 1
Aim: To familiarize with MATLAB software, general functions and signal processing
toolbox functions.
The name MATLAB stands for MATrix LABoratory produced by Mathworks Inc., USA. It is a
matrix-based powerful software package for scientific and engineering computation and
visualization. Complex numerical problems can be solved in a fraction of the time that
required with other high level languages. It provides an interactive environment with
hundreds of built -in –functions for technical computation, graphics and animation. In
addition to built-in-functions, user can create his own functions.
MATLAB offers several optional toolboxes, such as signal processing, control systems, neural
networks etc. It is command driven software and has online help facility.
MATLAB has three basic windows normally; command window, graphics window and edit
window.
Command window is characterized by the prompt ‘>>’.
All commands and the ready to run program filename can be typed here. Graphic window
gives the display of the figures as the result of the program. Edit window is to create
program files with an extension .m.
Some important commands in MATLAB
Help : List topics on which help is available
Help command name: Provides help on the topic selected
Demo : Runs the demo program
Who : Lists variables currently in the workspace
Whos : Lists variables currently in the workspace with their size
Clear : Clears the workspace, all the variables are removed
Clear x,y,z : Clears only variables x,y,z
Quit: Quits MATLAB
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 2
Some of the frequently used built-in-functions in Signal Processing Toolbox
filter(b.a.x): Syntax of this function is Y = filter(b.a.x)
It filters the data in vector x with the filter described by vectors
a and b to create the filtered data y.
fft (x): It is the DFT of vector x
ifft (x) : It is the DFT of vector x
conv (a,b) : Syntax of this function is C = conv (a,b)
It convolves vectors a and b. The resulting vector is ofLength,
Length (a) + Length (b)-1
deconv(b,a): Syntax of this function is [q,r] = deconv(b,a)
It deconvolves vector q and the remainder in vector r such that
b = conv(a,q)+r
butter(N,Wn): Designs an Nth order lowpass digital Butterworth filter and
returns the filter coefficients in length N+1 vectors B
(numerator) and A (denominator). The coefficients are listed in
descending powers of z. The cutoff frequency Wn must be 0.0
< Wn < 1.0, with 1.0 corresponding tohalf the sample rate.
buttord(Wp, Ws, Rp, Rs): Returns the order N of the lowest order digital Butterworth
filter that loses no more than Rp dB in the passband and has at
least Rs dB of attenuation in the stopband. Wp and Ws are the
passband and stopband edge frequencies, Normalized from 0
to 1 ,(where 1 corresponds to pi rad/sec)
Cheby1(N,R,Wn) : Designs an Nth order lowpass digital Chebyshev filter with R
decibels of peak-to-peak ripple in the passband. CHEBY1
returns the filter coefficients in length N+1 vectors B
(numerator) and A (denominator). The cutoff frequency Wn
must be 0.0 < Wn < 1.0, with 1.0 corresponding to half the
sample rate.
Cheby1(N,R,Wn,'high'): Designs a highpass filter.
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 3
Cheb1ord(Wp, Ws, Rp, Rs): Returns the order N of the lowest order digital Chebyshev
Type I filter that loses no more than Rp dBin the passband and
has at least Rs dB of attenuation in the stopband. Wp and Ws
are the passband and stopband edge frequencies, normalized
from 0 to 1 (where 1 corresponds to pi radians/sample)
cheby2(N,R,Wn) : Designs an Nth order lowpass digital Chebyshev filter with the
stopband ripple R decibels down and stopband edge
frequency Wn. CHEBY2 returns the filter coefficients in length
N+1 vectors B (numerator) and A. The cutoff frequency Wn
must be 0.0 < Wn < 1.0, with 1.0 corresponding to half the
sample rate.
cheb2ord(Wp, Ws, Rp, Rs): Returns the order N of the lowest order digital Chebyshev
Type II filter that loses no more than Rp dB in the passband
and has at least Rs dB of attenuation in the stopband. Wp and
Ws are the passband and stopband edge frequencies.
abs(x): It gives the absolute value of the elements of x. When x is
complex, abs(x) is the complex modulus (magnitude) of the
elements of x.
angle(H): It returns the phase angles of a matrix with complex elements
in
radians.
freqz(b,a,N) : Syntax of this function is [h,w] = freqz(b,a,N) returns the
Npoint
frequency vector w in radians and the N-point complex
frequency response vector h of the filter b/a.
stem(y) : It plots the data sequence y aa stems from the x axis
terminated
with circles for the data value.
stem(x,y): It plots the data sequence y at the values specified in x.
ploy(x,y) : It plots vector y versus vector x. If x or y is a matrix, then the
vector is plotted versus the rows or columns of the
matrix,cwhichever line up.
title(‘text’): It adds text at the top of the current axis.
xlabel(‘text’): It adds text beside the x-axis on the current axis.
ylabel(‘text’): It adds text beside the y-axis on the current axis.
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 4
Experiment :2
To plot graph of Continuous Time Signals
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 5
Unit step function
Program :
T=30;
x=ones(1,T);
t=0:1:T-1
plot(t,x);
grid on;
xlabel('time(sec)')
ylabel('x(t)')
Output :
0 5 10 15 20 25 30
0
0.5
1
1.5
2
time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 6
Unit ramp function
Program :
t=0:0.03:4;
x=t;
plot(t,x)
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
0 1 2 3 4
0
1
2
3
4
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 7
Unit parabolic function
Program :
t=0:0.01:2;
x=t.^2/2;
plot(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
0 0.5 1 1.5 2
0
0.5
1
1.5
2
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 8
Impulse function
Program :
for t = 0;
x = 1;
end;
plot(t,x);
stem(t,x)
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
-1 -0.5 0 0.5 1
0
0.2
0.4
0.6
0.8
1
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 9
Rectangular pulse function
Program :
t=-1:0.001:1;
x=rectpuls(t);
plot(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
-1 -0.5 0 0.5 1
0
0.2
0.4
0.6
0.8
1
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 10
Triangular pulse function
Program :
t=-1:0.002:1;
x=tripuls(t);
plot(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output:
Signum function
-1 -0.5 0 0.5 1
0
0.2
0.4
0.6
0.8
1
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 11
Program :
t=-10:0.001:10;
x=sign(t);
plot(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output:
-10 -5 0 5 10
-1
-0.5
0
0.5
1
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 12
Sinc function
Program :
t =-4:0.05:4;
x=sinc(t);
plot(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output:
-4 -2 0 2 4
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 13
Gaussian function
Program :
t=-5:0.03:5;
a=1;
x=exp(-a*t.^2);
plot(t,x)
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
-5 0 5
0
0.2
0.4
0.6
0.8
1
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 14
Sinusoidal signal
Program :
t=0:0.01:2;
x=2*sin(pi*t);
plot(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
0 0.5 1 1.5 2
-2
-1
0
1
2
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 15
Real exponential signals
Program :
t=0:0.04:4;
x=2*exp(1*t);
plot(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output : 1. a>0
0 1 2 3 4
0
10
20
30
40
50
60
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 16
Program :
t=0:0.04:4;
x=2*exp(-1*t);
plot(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output : 2. a<0
Program :
0 1 2 3 4
0
0.2
0.4
0.6
0.8
1
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 17
t=0:0.04:4;
x=2*exp(0*t);
plot(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output : 3. a=0
0 1 2 3 4
-1
-0.5
0
0.5
1
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 18
Complex exponential function
Program :
t=-10:0.001:10;
c=complex(0,1);
x=exp(c*t);
plot(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
-10 -5 0 5 10
-1
-0.5
0
0.5
1
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 19
Program :
t=-10:0.001:10;
c=complex(-1,12);
x=exp(c*t);
plot(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
-10 -5 0 5 10
-2
-1
0
1
2
3
x 10
4
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 20
Program :
t=-10:0.001:10;
c=complex(1,12);
x=exp(c*t);
plot(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
-10 -5 0 5 10
-2
-1
0
1
2
3
x 10
4
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 21
Experiment :3
To plot graph of Discrete Time Signals
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 22
Unit step sequence
Program :
T=30;
x=ones(1,T);
t=0:1:T-1
stem(t,x);
grid on;
xlabel('time(sec)')
ylabel('x(t)')
Output :
0 5 10 15 20 25 30
0
0.2
0.4
0.6
0.8
1
time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 23
Unit ramp sequence
Program :
t=0:0.5:4;
x=t;
stem(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
0 1 2 3 4
0
1
2
3
4
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 24
Unit impulse sequence
Program :
for t = 0;
x = 1;
end;
plot(t,x);
stem(t,x)
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
-1 -0.5 0 0.5 1
0
0.2
0.4
0.6
0.8
1
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 25
Exponential sequence
Program :
t=0:0.35:4;
x=2.^t;
stem(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
0 1 2 3 4
0
10
20
30
40
50
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 26
Program :
t=0:0.35:4;
x=0.2.^t;
stem(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
0 1 2 3 4
0
0.2
0.4
0.6
0.8
1
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 27
Program :
t=0:0.35:4;
x=-0.2.^t;
stem(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
0 1 2 3 4
-1
-0.8
-0.6
-0.4
-0.2
0
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 28
Program :
t=0:0.35:4;
x=-2.^t;
stem(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
0 1 2 3 4
-15
-10
-5
0
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 29
Sinusoidal sequence
Program :
t=0:0.1:2;
x=2*sin(pi*t);
stem(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
0 0.5 1 1.5 2
-2
-1
0
1
2
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 30
Complex exponential sequence
Program :
t=-10:0.3:10;
c=complex(0.3,4);
x=exp(c*t);
stem(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
-10 -5 0 5 10
-15
-10
-5
0
5
10
15
20
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 31
Program :
t=-10:0.3:10;
c=complex(0.3,4);
x=exp(c*t);
stem(t,x);
grid on;
xlabel('Time(sec)')
ylabel('x(t)')
Output :
-10 -5 0 5 10
-15
-10
-5
0
5
10
15
20
Time(sec)
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 32
Experiment :04
To perform signal operation using
stimulink
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 33
Program : u(t)-u(t-1)
Output :
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 34
Program : r(t)-2r(t-1)+r(t-2)
Output :
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 35
Program : r(t)-2u(t-1)-r(t-2)
Output :
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 36
Program : r(t)-r(t-1)-u(t-1)
Output :
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 37
Experiment :05
To perform the convolution sum
of discrete time signal.
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 38
Program :
a=[ 1 -1 2 3];
b=[ 1 -2 3 -1];
z=conv(a,b);
m=length(z);
y=0:m-1;
stem(y,z);
Output :
0 1 2 3 4 5 6
-5
0
5
10
a
b
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 39
Program :
a=[ 1 2 3 2];
b=[ 1 2 2];
z=conv(a,b);
m=length(z);
y=0:m-1;
stem(y,z);
Output :
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0
5
10
15
a
b
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 40
Program :
a=[ 1 4 3 2];
b=[ 1 3 2 1];
z=conv(a,b);
m=length(z);
y=0:m-1;
stem(y,z);
Output :
0 1 2 3 4 5 6
0
5
10
15
20
a
b
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 41
Program:
a=[ 1 -2 3 1];
b=[ 2 -3 -2];
z=conv(a,b);
m=length(z);
y=0:m-1;
stem(y,z);
Output:
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
-10
-5
0
5
10
a
b
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 42
Experiment :06
To perform z-transform using
MATLAB
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 43
Program :
syms f n;
f=2^n;
ztrans(f);
Output :
z/(z - 2)
Program :
syms f n w;
f=cos(n);
ztrans(f);
Output :
(z*(z - cos(1)))/(z^2 - 2*cos(1)*z + 1)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 44
Program :
syms f n w;
f=2^n+3^n;
ztrans(f);
Output :
z/(z - 2) + z/(z - 3)
Program :
syms f n w;
f=(n^2)*(2^n);
ztrans(f);
Output :
(z^2/4 + z/2)/(z/2 - 1)^3
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 45
Experiment :07
To plot zeros and poles in the z-plane
using MATLAB.
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 46
Program :
syms n d z
n=[1 1];
d=[1 2 3 4];
sys=tf(n,d),disp(z);
zplane(n,d);
Output :
s + 1
s^3 + 2 s^2 + 3 s + 4
-2 -1.5 -1 -0.5 0 0.5 1 1.5
-1.5
-1
-0.5
0
0.5
1
1.5
2
Real Part
ImaginaryPart
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 47
Program :
syms n d z
n=[1 0.5];
d=[1 1 1];
sys=tf(n,d),disp(z);
zplane(n,d);
Output :
s + 0.5
s^2 + s + 1
-1.5 -1 -0.5 0 0.5 1 1.5
-1
-0.5
0
0.5
1
Real Part
ImaginaryPart
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 48
Program :
syms n d z
n=[3 0];
d=[1 6 9];
sys=tf(n,d),disp(z);
zplane(n,d);
Output :
3 s
s^2 + 6 s + 9
-3 -2 -1 0 1
-1
-0.5
0
0.5
1
22
Real Part
ImaginaryPart
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 49
Program :
syms n d z
n=[1 1 0];
d=[1 3 1 1];
sys=tf(n,d),disp(z);
zplane(n,d);
Output :
s^2 + s
s^3 + 3 s^2 + s + 1
-2.5 -2 -1.5 -1 -0.5 0 0.5 1
-1
-0.5
0
0.5
1
2
Real Part
ImaginaryPart
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 50
Experiment -08
To perform FFT using MATLAB.
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 51
1. Program:
a = input('enter sequence');
b = length(a);
x = fft(a,b)
Output:
Enter sequence[1 2 3 4]
x =
10.0000 -2.0000 + 2.0000i -2.0000 -2.0000 - 2.0000i
2. Program :
a = input('enter sequence');
b = length(a);
x = fft(a,b)
Output :
enter sequence[5 7 9 5]
x =
26.0000 -4.0000 - 2.0000i 2.0000
-4.0000 + 2.0000i
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 52
Experiment -09
To perform IFFT using MATLAB.
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 53
1. Program:
a = input('Enter sequence');
b = length(a);
x = ifft(a,b)
Output:
Enter sequence[1 2 3 4]
x =
2.5000 -0.5000 - 0.5000i -0.5000
-0.5000 + 0.5000i
2. Program :
a = input('Enter sequence');
b = length(a);
x = ifft(a,b)
Output:
Enter sequence[2 5 8 6]
x =
5.2500 -1.5000 - 0.2500i -0.2500
-1.5000 + 0.2500i
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 54
Experiment - 10
To verify sampling theorem using
MATLAB.
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 55
Program:
T=0.04; % Time period of 50 Hz
signal
t=0:0.0005:0.02;
f = 1/T;
n1=0:40;
size(n1)
xa_t=sin(2*pi*2*t/T);
plot(200*t,xa_t);
title('Continuous signal');
grid on;
xlabel('t');
ylabel('x(t)');
Output:
0 0.5 1 1.5 2 2.5 3 3.5 4
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Continuous signal
t
x(t)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 56
Program:
ts1=0.002; %>Nyquist rate
n=0:20;
x_ts1=2*sin(2*pi*n*ts1/T);
stem(n,x_ts1);
grid on;
title('greater than Nq');
xlabel('n');
ylabel('x(n)');
Output:
0 2 4 6 8 10 12 14 16 18 20
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
greater than Nq
n
x(n)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 57
Program:
ts2=0.01; %=Nyquist rate
n=0:4;
x_ts2=2*sin(2*sym('pi')*n*ts2/T);
stem(n,x_ts2);
grid on;
title('Equal to Nq');
xlabel('n');
ylabel('x(n)');
Output:
0 0.5 1 1.5 2 2.5 3 3.5 4
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
Equal to Nq
n
x(n)
SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1
ELECTRICALDEPARTMENT
BITS EDU CAMPUS Page 58
Program:
ts3=0.1; %<Nyquist rate
n=0:10;
x_ts3=2*sin(2*pi*n*ts3/T);
stem(n,x_ts3);
grid on;
title('less than Nq');
xlabel('n');
ylabel('x(n)');
Output:
0 1 2 3 4 5 6 7 8 9 10
-2.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
x 10
-14 less than Nq
n
x(n)

More Related Content

What's hot

Mathematical model for communication channels
Mathematical model for communication channelsMathematical model for communication channels
Mathematical model for communication channels
safeerakd
 
RF Module Design - [Chapter 2] Noises
RF Module Design - [Chapter 2] NoisesRF Module Design - [Chapter 2] Noises
RF Module Design - [Chapter 2] Noises
Simen Li
 
Fm receiver
Fm receiverFm receiver
Fm receiver
Nasrullah Khan
 
Overview of sampling
Overview of samplingOverview of sampling
Overview of sampling
Sagar Kumar
 
Boolean expression org.
Boolean expression org.Boolean expression org.
Boolean expression org.
mshoaib15
 
Ch1
Ch1Ch1
Schmitt trigger circuit
Schmitt trigger circuitSchmitt trigger circuit
Schmitt trigger circuit
taranjeet10
 
5 DSB-SC-Demodulation.pdf
5 DSB-SC-Demodulation.pdf5 DSB-SC-Demodulation.pdf
5 DSB-SC-Demodulation.pdf
Mohamedshabana38
 
Filtros de audio
Filtros de audioFiltros de audio
Filtros de audio
Alfa Betta
 
Pulse & Linear Integrated Circuits
Pulse & Linear Integrated CircuitsPulse & Linear Integrated Circuits
Pulse & Linear Integrated Circuits
SRAVANIP22
 
measurement unit2.docx
measurement unit2.docxmeasurement unit2.docx
measurement unit2.docx
AMRITRAJ160
 
Tracking in receivers
Tracking in receiversTracking in receivers
Tracking in receivers
Jay Patel
 
Microphone and its characteristics.pdf
Microphone and its characteristics.pdfMicrophone and its characteristics.pdf
Microphone and its characteristics.pdf
Engineering Funda
 
Transmission line, single and double matching
Transmission line, single and double matchingTransmission line, single and double matching
Transmission line, single and double matching
Shankar Gangaju
 
Cauan (2)
Cauan (2)Cauan (2)
Cauan (2)
Sarah Krystelle
 
Generation of fm
Generation of fmGeneration of fm
Generation of fm
kaavyabalachandran
 
Rf power amplifier design
Rf power amplifier designRf power amplifier design
Rf power amplifier design
venkateshp100
 
High pass filter with analog electronic
High pass filter with analog electronicHigh pass filter with analog electronic
High pass filter with analog electronic
Dilouar Hossain
 
Information Theory and coding - Lecture 2
Information Theory and coding - Lecture 2Information Theory and coding - Lecture 2
Information Theory and coding - Lecture 2
Aref35
 
Resonance in series and parallel circuits
Resonance in series and parallel circuitsResonance in series and parallel circuits
Resonance in series and parallel circuits
hardikpanchal424
 

What's hot (20)

Mathematical model for communication channels
Mathematical model for communication channelsMathematical model for communication channels
Mathematical model for communication channels
 
RF Module Design - [Chapter 2] Noises
RF Module Design - [Chapter 2] NoisesRF Module Design - [Chapter 2] Noises
RF Module Design - [Chapter 2] Noises
 
Fm receiver
Fm receiverFm receiver
Fm receiver
 
Overview of sampling
Overview of samplingOverview of sampling
Overview of sampling
 
Boolean expression org.
Boolean expression org.Boolean expression org.
Boolean expression org.
 
Ch1
Ch1Ch1
Ch1
 
Schmitt trigger circuit
Schmitt trigger circuitSchmitt trigger circuit
Schmitt trigger circuit
 
5 DSB-SC-Demodulation.pdf
5 DSB-SC-Demodulation.pdf5 DSB-SC-Demodulation.pdf
5 DSB-SC-Demodulation.pdf
 
Filtros de audio
Filtros de audioFiltros de audio
Filtros de audio
 
Pulse & Linear Integrated Circuits
Pulse & Linear Integrated CircuitsPulse & Linear Integrated Circuits
Pulse & Linear Integrated Circuits
 
measurement unit2.docx
measurement unit2.docxmeasurement unit2.docx
measurement unit2.docx
 
Tracking in receivers
Tracking in receiversTracking in receivers
Tracking in receivers
 
Microphone and its characteristics.pdf
Microphone and its characteristics.pdfMicrophone and its characteristics.pdf
Microphone and its characteristics.pdf
 
Transmission line, single and double matching
Transmission line, single and double matchingTransmission line, single and double matching
Transmission line, single and double matching
 
Cauan (2)
Cauan (2)Cauan (2)
Cauan (2)
 
Generation of fm
Generation of fmGeneration of fm
Generation of fm
 
Rf power amplifier design
Rf power amplifier designRf power amplifier design
Rf power amplifier design
 
High pass filter with analog electronic
High pass filter with analog electronicHigh pass filter with analog electronic
High pass filter with analog electronic
 
Information Theory and coding - Lecture 2
Information Theory and coding - Lecture 2Information Theory and coding - Lecture 2
Information Theory and coding - Lecture 2
 
Resonance in series and parallel circuits
Resonance in series and parallel circuitsResonance in series and parallel circuits
Resonance in series and parallel circuits
 

Similar to signal and system

Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manual
Mukul Mohal
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual
Amairullah Khan Lodhi
 
Signals And Systems Lab Manual, R18 Batch
Signals And Systems Lab Manual, R18 BatchSignals And Systems Lab Manual, R18 Batch
Signals And Systems Lab Manual, R18 Batch
Amairullah Khan Lodhi
 
Dsp manual
Dsp manualDsp manual
Dsp manual
pramod naik
 
dsp.pdf
dsp.pdfdsp.pdf
dsp.pdf
Naol Worku
 
Dsp 1recordprophess-140720055832-phpapp01
Dsp 1recordprophess-140720055832-phpapp01Dsp 1recordprophess-140720055832-phpapp01
Dsp 1recordprophess-140720055832-phpapp01
Sagar Gore
 
Digital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE studentsDigital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE students
UR11EC098
 
BS LAB Manual (1).pdf
BS LAB Manual  (1).pdfBS LAB Manual  (1).pdf
BS LAB Manual (1).pdf
ssuser476810
 
Multirate sim
Multirate simMultirate sim
Multirate sim
Alim Sheikh
 
Dsp file
Dsp fileDsp file
Dsp file
Rakesh Thakur
 
13005810.ppt
13005810.ppt13005810.ppt
13005810.ppt
myatthanda1
 
Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report
Alamgir Hossain
 
Introduction to Adaptive filters
Introduction to Adaptive filtersIntroduction to Adaptive filters
Introduction to Adaptive filters
Firas Mohammed Ali Al-Raie
 
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
Loren Schwappach
 
Tutorial on convolutional neural networks
Tutorial on convolutional neural networksTutorial on convolutional neural networks
Tutorial on convolutional neural networks
Hojin Yang
 
R Language Introduction
R Language IntroductionR Language Introduction
R Language Introduction
Khaled Al-Shamaa
 
DSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docxDSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docx
ParthDoshi66
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
BilawalBaloch1
 
DSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdfDSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdf
ParthDoshi66
 
SlidesPartII_digital_control_power_electronics.pdf
SlidesPartII_digital_control_power_electronics.pdfSlidesPartII_digital_control_power_electronics.pdf
SlidesPartII_digital_control_power_electronics.pdf
ssuserb5b5f7
 

Similar to signal and system (20)

Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manual
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual
 
Signals And Systems Lab Manual, R18 Batch
Signals And Systems Lab Manual, R18 BatchSignals And Systems Lab Manual, R18 Batch
Signals And Systems Lab Manual, R18 Batch
 
Dsp manual
Dsp manualDsp manual
Dsp manual
 
dsp.pdf
dsp.pdfdsp.pdf
dsp.pdf
 
Dsp 1recordprophess-140720055832-phpapp01
Dsp 1recordprophess-140720055832-phpapp01Dsp 1recordprophess-140720055832-phpapp01
Dsp 1recordprophess-140720055832-phpapp01
 
Digital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE studentsDigital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE students
 
BS LAB Manual (1).pdf
BS LAB Manual  (1).pdfBS LAB Manual  (1).pdf
BS LAB Manual (1).pdf
 
Multirate sim
Multirate simMultirate sim
Multirate sim
 
Dsp file
Dsp fileDsp file
Dsp file
 
13005810.ppt
13005810.ppt13005810.ppt
13005810.ppt
 
Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report
 
Introduction to Adaptive filters
Introduction to Adaptive filtersIntroduction to Adaptive filters
Introduction to Adaptive filters
 
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
 
Tutorial on convolutional neural networks
Tutorial on convolutional neural networksTutorial on convolutional neural networks
Tutorial on convolutional neural networks
 
R Language Introduction
R Language IntroductionR Language Introduction
R Language Introduction
 
DSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docxDSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docx
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
DSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdfDSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdf
 
SlidesPartII_digital_control_power_electronics.pdf
SlidesPartII_digital_control_power_electronics.pdfSlidesPartII_digital_control_power_electronics.pdf
SlidesPartII_digital_control_power_electronics.pdf
 

More from SAURAV DAYAL SING

POWER GENERATION SCENERIO IN INDIA
POWER GENERATION SCENERIO IN INDIAPOWER GENERATION SCENERIO IN INDIA
POWER GENERATION SCENERIO IN INDIA
SAURAV DAYAL SING
 
Bulk oil and min oil circuit breaker
Bulk oil and min oil circuit breakerBulk oil and min oil circuit breaker
Bulk oil and min oil circuit breaker
SAURAV DAYAL SING
 
Theory of HVDC transmission
Theory of HVDC transmission Theory of HVDC transmission
Theory of HVDC transmission
SAURAV DAYAL SING
 
THE FABRICATION OF REGULATED DC POWER SUPPLY
THE FABRICATION OF REGULATED DC POWER SUPPLYTHE FABRICATION OF REGULATED DC POWER SUPPLY
THE FABRICATION OF REGULATED DC POWER SUPPLY
SAURAV DAYAL SING
 
THEORY OF PRODUCTION AND COST
THEORY OF PRODUCTION AND COSTTHEORY OF PRODUCTION AND COST
THEORY OF PRODUCTION AND COST
SAURAV DAYAL SING
 
ELECTRICAL LAMPS AND THEIR TYPES
ELECTRICAL LAMPS AND THEIR TYPESELECTRICAL LAMPS AND THEIR TYPES
ELECTRICAL LAMPS AND THEIR TYPES
SAURAV DAYAL SING
 
UKAI HYDRO POWER PLANT VISIT
UKAI HYDRO POWER PLANT VISITUKAI HYDRO POWER PLANT VISIT
UKAI HYDRO POWER PLANT VISIT
SAURAV DAYAL SING
 

More from SAURAV DAYAL SING (7)

POWER GENERATION SCENERIO IN INDIA
POWER GENERATION SCENERIO IN INDIAPOWER GENERATION SCENERIO IN INDIA
POWER GENERATION SCENERIO IN INDIA
 
Bulk oil and min oil circuit breaker
Bulk oil and min oil circuit breakerBulk oil and min oil circuit breaker
Bulk oil and min oil circuit breaker
 
Theory of HVDC transmission
Theory of HVDC transmission Theory of HVDC transmission
Theory of HVDC transmission
 
THE FABRICATION OF REGULATED DC POWER SUPPLY
THE FABRICATION OF REGULATED DC POWER SUPPLYTHE FABRICATION OF REGULATED DC POWER SUPPLY
THE FABRICATION OF REGULATED DC POWER SUPPLY
 
THEORY OF PRODUCTION AND COST
THEORY OF PRODUCTION AND COSTTHEORY OF PRODUCTION AND COST
THEORY OF PRODUCTION AND COST
 
ELECTRICAL LAMPS AND THEIR TYPES
ELECTRICAL LAMPS AND THEIR TYPESELECTRICAL LAMPS AND THEIR TYPES
ELECTRICAL LAMPS AND THEIR TYPES
 
UKAI HYDRO POWER PLANT VISIT
UKAI HYDRO POWER PLANT VISITUKAI HYDRO POWER PLANT VISIT
UKAI HYDRO POWER PLANT VISIT
 

Recently uploaded

Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 

Recently uploaded (20)

Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 

signal and system

  • 1. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 1 Babaria Institute of Technology Electrical Engineering Department Semester :4 Branch:EE Subject: Signals & Systems (2141005) Experiment No. 1 Aim: To familiarize with MATLAB software, general functions and signal processing toolbox functions. The name MATLAB stands for MATrix LABoratory produced by Mathworks Inc., USA. It is a matrix-based powerful software package for scientific and engineering computation and visualization. Complex numerical problems can be solved in a fraction of the time that required with other high level languages. It provides an interactive environment with hundreds of built -in –functions for technical computation, graphics and animation. In addition to built-in-functions, user can create his own functions. MATLAB offers several optional toolboxes, such as signal processing, control systems, neural networks etc. It is command driven software and has online help facility. MATLAB has three basic windows normally; command window, graphics window and edit window. Command window is characterized by the prompt ‘>>’. All commands and the ready to run program filename can be typed here. Graphic window gives the display of the figures as the result of the program. Edit window is to create program files with an extension .m. Some important commands in MATLAB Help : List topics on which help is available Help command name: Provides help on the topic selected Demo : Runs the demo program Who : Lists variables currently in the workspace Whos : Lists variables currently in the workspace with their size Clear : Clears the workspace, all the variables are removed Clear x,y,z : Clears only variables x,y,z Quit: Quits MATLAB
  • 2. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 2 Some of the frequently used built-in-functions in Signal Processing Toolbox filter(b.a.x): Syntax of this function is Y = filter(b.a.x) It filters the data in vector x with the filter described by vectors a and b to create the filtered data y. fft (x): It is the DFT of vector x ifft (x) : It is the DFT of vector x conv (a,b) : Syntax of this function is C = conv (a,b) It convolves vectors a and b. The resulting vector is ofLength, Length (a) + Length (b)-1 deconv(b,a): Syntax of this function is [q,r] = deconv(b,a) It deconvolves vector q and the remainder in vector r such that b = conv(a,q)+r butter(N,Wn): Designs an Nth order lowpass digital Butterworth filter and returns the filter coefficients in length N+1 vectors B (numerator) and A (denominator). The coefficients are listed in descending powers of z. The cutoff frequency Wn must be 0.0 < Wn < 1.0, with 1.0 corresponding tohalf the sample rate. buttord(Wp, Ws, Rp, Rs): Returns the order N of the lowest order digital Butterworth filter that loses no more than Rp dB in the passband and has at least Rs dB of attenuation in the stopband. Wp and Ws are the passband and stopband edge frequencies, Normalized from 0 to 1 ,(where 1 corresponds to pi rad/sec) Cheby1(N,R,Wn) : Designs an Nth order lowpass digital Chebyshev filter with R decibels of peak-to-peak ripple in the passband. CHEBY1 returns the filter coefficients in length N+1 vectors B (numerator) and A (denominator). The cutoff frequency Wn must be 0.0 < Wn < 1.0, with 1.0 corresponding to half the sample rate. Cheby1(N,R,Wn,'high'): Designs a highpass filter.
  • 3. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 3 Cheb1ord(Wp, Ws, Rp, Rs): Returns the order N of the lowest order digital Chebyshev Type I filter that loses no more than Rp dBin the passband and has at least Rs dB of attenuation in the stopband. Wp and Ws are the passband and stopband edge frequencies, normalized from 0 to 1 (where 1 corresponds to pi radians/sample) cheby2(N,R,Wn) : Designs an Nth order lowpass digital Chebyshev filter with the stopband ripple R decibels down and stopband edge frequency Wn. CHEBY2 returns the filter coefficients in length N+1 vectors B (numerator) and A. The cutoff frequency Wn must be 0.0 < Wn < 1.0, with 1.0 corresponding to half the sample rate. cheb2ord(Wp, Ws, Rp, Rs): Returns the order N of the lowest order digital Chebyshev Type II filter that loses no more than Rp dB in the passband and has at least Rs dB of attenuation in the stopband. Wp and Ws are the passband and stopband edge frequencies. abs(x): It gives the absolute value of the elements of x. When x is complex, abs(x) is the complex modulus (magnitude) of the elements of x. angle(H): It returns the phase angles of a matrix with complex elements in radians. freqz(b,a,N) : Syntax of this function is [h,w] = freqz(b,a,N) returns the Npoint frequency vector w in radians and the N-point complex frequency response vector h of the filter b/a. stem(y) : It plots the data sequence y aa stems from the x axis terminated with circles for the data value. stem(x,y): It plots the data sequence y at the values specified in x. ploy(x,y) : It plots vector y versus vector x. If x or y is a matrix, then the vector is plotted versus the rows or columns of the matrix,cwhichever line up. title(‘text’): It adds text at the top of the current axis. xlabel(‘text’): It adds text beside the x-axis on the current axis. ylabel(‘text’): It adds text beside the y-axis on the current axis.
  • 4. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 4 Experiment :2 To plot graph of Continuous Time Signals
  • 5. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 5 Unit step function Program : T=30; x=ones(1,T); t=0:1:T-1 plot(t,x); grid on; xlabel('time(sec)') ylabel('x(t)') Output : 0 5 10 15 20 25 30 0 0.5 1 1.5 2 time(sec) x(t)
  • 6. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 6 Unit ramp function Program : t=0:0.03:4; x=t; plot(t,x) grid on; xlabel('Time(sec)') ylabel('x(t)') Output : 0 1 2 3 4 0 1 2 3 4 Time(sec) x(t)
  • 7. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 7 Unit parabolic function Program : t=0:0.01:2; x=t.^2/2; plot(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : 0 0.5 1 1.5 2 0 0.5 1 1.5 2 Time(sec) x(t)
  • 8. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 8 Impulse function Program : for t = 0; x = 1; end; plot(t,x); stem(t,x) grid on; xlabel('Time(sec)') ylabel('x(t)') Output : -1 -0.5 0 0.5 1 0 0.2 0.4 0.6 0.8 1 Time(sec) x(t)
  • 9. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 9 Rectangular pulse function Program : t=-1:0.001:1; x=rectpuls(t); plot(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : -1 -0.5 0 0.5 1 0 0.2 0.4 0.6 0.8 1 Time(sec) x(t)
  • 10. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 10 Triangular pulse function Program : t=-1:0.002:1; x=tripuls(t); plot(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output: Signum function -1 -0.5 0 0.5 1 0 0.2 0.4 0.6 0.8 1 Time(sec) x(t)
  • 11. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 11 Program : t=-10:0.001:10; x=sign(t); plot(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output: -10 -5 0 5 10 -1 -0.5 0 0.5 1 Time(sec) x(t)
  • 12. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 12 Sinc function Program : t =-4:0.05:4; x=sinc(t); plot(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output: -4 -2 0 2 4 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time(sec) x(t)
  • 13. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 13 Gaussian function Program : t=-5:0.03:5; a=1; x=exp(-a*t.^2); plot(t,x) grid on; xlabel('Time(sec)') ylabel('x(t)') Output : -5 0 5 0 0.2 0.4 0.6 0.8 1 Time(sec) x(t)
  • 14. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 14 Sinusoidal signal Program : t=0:0.01:2; x=2*sin(pi*t); plot(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : 0 0.5 1 1.5 2 -2 -1 0 1 2 Time(sec) x(t)
  • 15. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 15 Real exponential signals Program : t=0:0.04:4; x=2*exp(1*t); plot(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : 1. a>0 0 1 2 3 4 0 10 20 30 40 50 60 Time(sec) x(t)
  • 16. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 16 Program : t=0:0.04:4; x=2*exp(-1*t); plot(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : 2. a<0 Program : 0 1 2 3 4 0 0.2 0.4 0.6 0.8 1 Time(sec) x(t)
  • 17. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 17 t=0:0.04:4; x=2*exp(0*t); plot(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : 3. a=0 0 1 2 3 4 -1 -0.5 0 0.5 1 Time(sec) x(t)
  • 18. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 18 Complex exponential function Program : t=-10:0.001:10; c=complex(0,1); x=exp(c*t); plot(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : -10 -5 0 5 10 -1 -0.5 0 0.5 1 Time(sec) x(t)
  • 19. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 19 Program : t=-10:0.001:10; c=complex(-1,12); x=exp(c*t); plot(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : -10 -5 0 5 10 -2 -1 0 1 2 3 x 10 4 Time(sec) x(t)
  • 20. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 20 Program : t=-10:0.001:10; c=complex(1,12); x=exp(c*t); plot(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : -10 -5 0 5 10 -2 -1 0 1 2 3 x 10 4 Time(sec) x(t)
  • 21. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 21 Experiment :3 To plot graph of Discrete Time Signals
  • 22. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 22 Unit step sequence Program : T=30; x=ones(1,T); t=0:1:T-1 stem(t,x); grid on; xlabel('time(sec)') ylabel('x(t)') Output : 0 5 10 15 20 25 30 0 0.2 0.4 0.6 0.8 1 time(sec) x(t)
  • 23. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 23 Unit ramp sequence Program : t=0:0.5:4; x=t; stem(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : 0 1 2 3 4 0 1 2 3 4 Time(sec) x(t)
  • 24. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 24 Unit impulse sequence Program : for t = 0; x = 1; end; plot(t,x); stem(t,x) grid on; xlabel('Time(sec)') ylabel('x(t)') Output : -1 -0.5 0 0.5 1 0 0.2 0.4 0.6 0.8 1 Time(sec) x(t)
  • 25. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 25 Exponential sequence Program : t=0:0.35:4; x=2.^t; stem(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : 0 1 2 3 4 0 10 20 30 40 50 Time(sec) x(t)
  • 26. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 26 Program : t=0:0.35:4; x=0.2.^t; stem(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : 0 1 2 3 4 0 0.2 0.4 0.6 0.8 1 Time(sec) x(t)
  • 27. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 27 Program : t=0:0.35:4; x=-0.2.^t; stem(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : 0 1 2 3 4 -1 -0.8 -0.6 -0.4 -0.2 0 Time(sec) x(t)
  • 28. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 28 Program : t=0:0.35:4; x=-2.^t; stem(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : 0 1 2 3 4 -15 -10 -5 0 Time(sec) x(t)
  • 29. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 29 Sinusoidal sequence Program : t=0:0.1:2; x=2*sin(pi*t); stem(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : 0 0.5 1 1.5 2 -2 -1 0 1 2 Time(sec) x(t)
  • 30. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 30 Complex exponential sequence Program : t=-10:0.3:10; c=complex(0.3,4); x=exp(c*t); stem(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : -10 -5 0 5 10 -15 -10 -5 0 5 10 15 20 Time(sec) x(t)
  • 31. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 31 Program : t=-10:0.3:10; c=complex(0.3,4); x=exp(c*t); stem(t,x); grid on; xlabel('Time(sec)') ylabel('x(t)') Output : -10 -5 0 5 10 -15 -10 -5 0 5 10 15 20 Time(sec) x(t)
  • 32. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 32 Experiment :04 To perform signal operation using stimulink
  • 33. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 33 Program : u(t)-u(t-1) Output :
  • 34. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 34 Program : r(t)-2r(t-1)+r(t-2) Output :
  • 35. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 35 Program : r(t)-2u(t-1)-r(t-2) Output :
  • 36. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 36 Program : r(t)-r(t-1)-u(t-1) Output :
  • 37. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 37 Experiment :05 To perform the convolution sum of discrete time signal.
  • 38. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 38 Program : a=[ 1 -1 2 3]; b=[ 1 -2 3 -1]; z=conv(a,b); m=length(z); y=0:m-1; stem(y,z); Output : 0 1 2 3 4 5 6 -5 0 5 10 a b
  • 39. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 39 Program : a=[ 1 2 3 2]; b=[ 1 2 2]; z=conv(a,b); m=length(z); y=0:m-1; stem(y,z); Output : 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0 5 10 15 a b
  • 40. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 40 Program : a=[ 1 4 3 2]; b=[ 1 3 2 1]; z=conv(a,b); m=length(z); y=0:m-1; stem(y,z); Output : 0 1 2 3 4 5 6 0 5 10 15 20 a b
  • 41. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 41 Program: a=[ 1 -2 3 1]; b=[ 2 -3 -2]; z=conv(a,b); m=length(z); y=0:m-1; stem(y,z); Output: 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -10 -5 0 5 10 a b
  • 42. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 42 Experiment :06 To perform z-transform using MATLAB
  • 43. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 43 Program : syms f n; f=2^n; ztrans(f); Output : z/(z - 2) Program : syms f n w; f=cos(n); ztrans(f); Output : (z*(z - cos(1)))/(z^2 - 2*cos(1)*z + 1)
  • 44. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 44 Program : syms f n w; f=2^n+3^n; ztrans(f); Output : z/(z - 2) + z/(z - 3) Program : syms f n w; f=(n^2)*(2^n); ztrans(f); Output : (z^2/4 + z/2)/(z/2 - 1)^3
  • 45. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 45 Experiment :07 To plot zeros and poles in the z-plane using MATLAB.
  • 46. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 46 Program : syms n d z n=[1 1]; d=[1 2 3 4]; sys=tf(n,d),disp(z); zplane(n,d); Output : s + 1 s^3 + 2 s^2 + 3 s + 4 -2 -1.5 -1 -0.5 0 0.5 1 1.5 -1.5 -1 -0.5 0 0.5 1 1.5 2 Real Part ImaginaryPart
  • 47. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 47 Program : syms n d z n=[1 0.5]; d=[1 1 1]; sys=tf(n,d),disp(z); zplane(n,d); Output : s + 0.5 s^2 + s + 1 -1.5 -1 -0.5 0 0.5 1 1.5 -1 -0.5 0 0.5 1 Real Part ImaginaryPart
  • 48. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 48 Program : syms n d z n=[3 0]; d=[1 6 9]; sys=tf(n,d),disp(z); zplane(n,d); Output : 3 s s^2 + 6 s + 9 -3 -2 -1 0 1 -1 -0.5 0 0.5 1 22 Real Part ImaginaryPart
  • 49. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 49 Program : syms n d z n=[1 1 0]; d=[1 3 1 1]; sys=tf(n,d),disp(z); zplane(n,d); Output : s^2 + s s^3 + 3 s^2 + s + 1 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 -1 -0.5 0 0.5 1 2 Real Part ImaginaryPart
  • 50. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 50 Experiment -08 To perform FFT using MATLAB.
  • 51. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 51 1. Program: a = input('enter sequence'); b = length(a); x = fft(a,b) Output: Enter sequence[1 2 3 4] x = 10.0000 -2.0000 + 2.0000i -2.0000 -2.0000 - 2.0000i 2. Program : a = input('enter sequence'); b = length(a); x = fft(a,b) Output : enter sequence[5 7 9 5] x = 26.0000 -4.0000 - 2.0000i 2.0000 -4.0000 + 2.0000i
  • 52. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 52 Experiment -09 To perform IFFT using MATLAB.
  • 53. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 53 1. Program: a = input('Enter sequence'); b = length(a); x = ifft(a,b) Output: Enter sequence[1 2 3 4] x = 2.5000 -0.5000 - 0.5000i -0.5000 -0.5000 + 0.5000i 2. Program : a = input('Enter sequence'); b = length(a); x = ifft(a,b) Output: Enter sequence[2 5 8 6] x = 5.2500 -1.5000 - 0.2500i -0.2500 -1.5000 + 0.2500i
  • 54. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 54 Experiment - 10 To verify sampling theorem using MATLAB.
  • 55. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 55 Program: T=0.04; % Time period of 50 Hz signal t=0:0.0005:0.02; f = 1/T; n1=0:40; size(n1) xa_t=sin(2*pi*2*t/T); plot(200*t,xa_t); title('Continuous signal'); grid on; xlabel('t'); ylabel('x(t)'); Output: 0 0.5 1 1.5 2 2.5 3 3.5 4 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Continuous signal t x(t)
  • 56. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 56 Program: ts1=0.002; %>Nyquist rate n=0:20; x_ts1=2*sin(2*pi*n*ts1/T); stem(n,x_ts1); grid on; title('greater than Nq'); xlabel('n'); ylabel('x(n)'); Output: 0 2 4 6 8 10 12 14 16 18 20 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 greater than Nq n x(n)
  • 57. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 57 Program: ts2=0.01; %=Nyquist rate n=0:4; x_ts2=2*sin(2*sym('pi')*n*ts2/T); stem(n,x_ts2); grid on; title('Equal to Nq'); xlabel('n'); ylabel('x(n)'); Output: 0 0.5 1 1.5 2 2.5 3 3.5 4 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 Equal to Nq n x(n)
  • 58. SIGNALS & SYSTEMS (2141005) EXPERIMENT- 1 ELECTRICALDEPARTMENT BITS EDU CAMPUS Page 58 Program: ts3=0.1; %<Nyquist rate n=0:10; x_ts3=2*sin(2*pi*n*ts3/T); stem(n,x_ts3); grid on; title('less than Nq'); xlabel('n'); ylabel('x(n)'); Output: 0 1 2 3 4 5 6 7 8 9 10 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 x 10 -14 less than Nq n x(n)