You are on page 1of 11

Q1

--> //to generate and compute the continous time and discrete time signal in scilab

--> t=[0:10:1000]

t =

column 1 to 15

0. 10. 20. 30. 40. 50. 60. 70. 80. 90. 100. 110. 120. 130. 140.

column 16 to 28
150. 160. 170. 180. 190. 200. 210. 220. 230. 240. 250. 260. 270.

column 29 to 41

280. 290. 300. 310. 320. 330. 340. 350. 360. 370. 380. 390. 400.

column 42 to 54

410. 420. 430. 440. 450. 460. 470. 480. 490. 500. 510. 520. 530.

column 55 to 67

540. 550. 560. 570. 580. 590. 600. 610. 620. 630. 640. 650. 660.

column 68 to 80

670. 680. 690. 700. 710. 720. 730. 740. 750. 760. 770. 780. 790.

column 81 to 93

800. 810. 820. 830. 840. 850. 860. 870. 880. 890. 900. 910. 920.

column 94 to 101

930. 940. 950. 960. 970. 980. 990. 1000.

--> ts=10

ts =

10.
--> fs=ts^-1

fs =

0.1

--> x=5*sind(t)

x =

column 1 to 9

0. 0.8682409 1.7101007 2.5 3.213938 3.8302222 4.330127 4.6984631 4.9240388

column 10 to 18

5. 4.9240388 4.6984631 4.330127 3.8302222 3.213938 2.5 1.7101007 0.8682409

column 19 to 27

0. -0.8682409 -1.7101007 -2.5 -3.213938 -3.8302222 -4.330127 -4.6984631 -4.9240388

column 28 to 36

-5. -4.9240388 -4.6984631 -4.330127 -3.8302222 -3.213938 -2.5 -1.7101007 -0.8682409

column 37 to 45

0. 0.8682409 1.7101007 2.5 3.213938 3.8302222 4.330127 4.6984631 4.9240388

column 46 to 54
5. 4.9240388 4.6984631 4.330127 3.8302222 3.213938 2.5 1.7101007 0.8682409

column 55 to 63

0. -0.8682409 -1.7101007 -2.5 -3.213938 -3.8302222 -4.330127 -4.6984631 -4.9240388

column 64 to 72

-5. -4.9240388 -4.6984631 -4.330127 -3.8302222 -3.213938 -2.5 -1.7101007 -0.8682409

column 73 to 81

0. 0.8682409 1.7101007 2.5 3.213938 3.8302222 4.330127 4.6984631 4.9240388

column 82 to 90

5. 4.9240388 4.6984631 4.330127 3.8302222 3.213938 2.5 1.7101007 0.8682409

column 91 to 99

0. -0.8682409 -1.7101007 -2.5 -3.213938 -3.8302222 -4.330127 -4.6984631 -4.9240388

column 100 to 101

-5. -4.9240388

--> subplot(121)

--> plot(x)
--> title("Sinosudial wave")

--> xlabel("time")

--> ylabel("amplitude")

--> xgrid

-->

--> subplot(122)

--> plot(x)

--> plot2d3(x)

--> plot2d2(x)

--> title("discrete signal")

--> xgrid
Q2

--> t=[1:0.25:5]

t =

column 1 to 15

1. 1.25 1.5 1.75 2. 2.25 2.5 2.75 3. 3.25 3.5 3.75 4. 4.25 4.5

column 16 to 17

4.75 5.

--> ts=0.25

ts =
0.25

--> fs=1/ts

fs =

4.

--> x=t

x =

column 1 to 15

1. 1.25 1.5 1.75 2. 2.25 2.5 2.75 3. 3.25 3.5 3.75 4. 4.25 4.5

column 16 to 17

4.75 5.

--> plot(x)

--> plot2d3(x)

--> plot2d2(x)

--> xgrid
Q3

--> t=[0:10]

t =

0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.

--> ts=1

ts =

1.

--> fs=ts^-1

fs =

1.
--> x=ones(1,10)

x =

1. 1. 1. 1. 1. 1. 1. 1. 1. 1.

--> plot(x)

--> plot2d3(x)

--> plot2d2(x)

--> xgrid(5)

--> title("discrete")

--> t=[0:0.5:10]

t =
column 1 to 17

0. 0.5 1. 1.5 2. 2.5 3. 3.5 4. 4.5 5. 5.5 6. 6.5 7. 7.5 8.

column 18 to 21

8.5 9. 9.5 10.

--> ts=0.5

ts =

0.5

--> fs=ts^-1

fs =

2.

--> x=ones(1,20)

x =

column 1 to 19

1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.

column 20

1.

--> plot(x)
--> plot2d3(x)

--> plot2d2(x)

--> xgrid(5)

--> title("discrete")

You might also like