Sie sind auf Seite 1von 10

INDEX

S.NO EXPERIMENT NAME


1.

To plot the square waveform of 40% duty


cycle.

2.
To plot the waveform of functions x(t) = (sin
t)^2 + (cos t)^3 and y(t) = t ^ 2*exp(t).
3.
To draw the response of unit step,unit impulse
and unit ramp function.
4.
To draw the waveform of sine, cosine and
exponential function.
5.
To plot the underdamped waveform of sine and
cosine functions.
6.
To find the convolution of two functions
h[n]=[1 2 1] and x[n]=[1 3 2 ].
7.
To find the co-orelation between the functions
x1[n]=[1 2 3] and x2[n]=[1 2 3 4].
8.
To evaluate the 4-point dft and idft of the
function x[n]=1 for 0<=n<=3, otherwise 0.

DATE

SIGNATURE

Program-1

Object- To plot the square waveform of 40% duty cycle.

Programt=0:pi/4:2*pi;
y=square(t,40)
plot(t,y)

Output-

1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1

Program-2

Object- To plot the waveform of functions x(t) = (sin t)^2 + (cos t)^3 and
y(t) = t ^ 2*exp(t).

Programt=pi:pi/4:2*pi
x= (sin(t)).^2+(cos(t)).^3
y=(t.^2).*exp(t)
subplot(1,2,1)
plot(t,x)
subplot(1,2,2)
plot(t,y)
Output4

2.5

x 10

0.8
0.6

0.4
0.2

1.5

0
-0.2

-0.4
-0.6

0.5

-0.8
-1

Program-3

Object- To draw the waveforms of unit step, unit impulse and unit ramp functions.

Programx=0:4:16
y1=[1;zeros(99,1)]
y2=[1;ones(99,1)]
y3=(x)
subplot(1,3,1)
plot(y1)
subplot(1,3,2)
plot(y2)
subplot(1,3,3)
plot(y3)
Output1

0.9

1.8

0.8

1.6

16
14
12

0.7

1.4

0.6

1.2

0.5

0.4

0.8

0.3

0.6

10
8
6
4

0.2

0.4

0.1

0.2

50

100

50

100

Program-4
Object- To draw the waveform of sine, cosine and exponential functions.

Programx=0:pi/10:2*pi;
y=sin(x)
z=cos(x)
u=exp(x)
subplot(1,3,1)
plot(x,y)
subplot(1,3,2)
plot(x,z)
subplot(1,3,3)
plot(x,u)
Output1

0.8

0.8

0.6

0.6

0.4

0.4

0.2

0.2

-0.2

-0.2

-0.4

-0.4

-0.6

-0.6

-0.8

-0.8

-1

10

-1

600

500

400

300

200

100

10

10

Program-5

Object- To plot the underdamped waveforms of sine and cosine functions.

Programt=linspace(-10,10)
x=(sin(pi*t))./(pi*t)
y=(cos(pi*t))./(pi*t)
subplot(1,2,1)
plot(t,x)
subplot(1,2,2)
plot(t,y)

Output-

0.8

0.6
1
0.4
0
0.2
-1
0
-2

-0.2

-0.4
-10

-5

10

-3
-10

-5

10

Program-6

Object- To find the convolution of two functions h[n]=[1 2 1] and x[n]=[1 3 2 ].

Programn=-1,1
h=[1 2 1]
x=[1 3 2]
y=conv(h,x)
stem(y)

Output-

9
8
7
6
5
4
3
2
1
0

1.5

2.5

3.5

4.5

Program-7

Object- To find the co-orelation between the functions x1[n]=[1 2 3] and


x2[n]=[1 2 3 4].

Programx1=[1 2 3]
x2=[1 2 3 4]
y=xcorr(x1,x2)
stem(y)

Output-

20
18
16
14
12
10
8
6
4
2
0

Program-8

Object- To evaluate the 4-point dft and idft of the function x[n]=1 for 0<=n<=3
otherwise 0.

ProgramFor dftx=[ones(1,4) zeros(1,6)]


y=fft(x,4)
stem(y)

for idftx=[4 0 0 0]
y=ifft(x,4)
stem(y)

Output

of

dft-

4
3.5
3
2.5
2
1.5
1
0.5
0

1.5

2.5

3.5

Output of idft1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0

1.5

2.5

3.5

Das könnte Ihnen auch gefallen