Ss matlab solved

33
Signals and Systems: List of MATLAB Problems: 1 Create a row vector x = (2; 3; 5; 7; 11; 13; 17; 19; 23; 29) in MATLAB. Now use the colon operator to display only the even entries of the vector, that is, the output should be the vector (3; 7; 13; 19; 29). Now do the same thing but display the output in reverse order, that is, the output should be (29; 19; 13; 7; 3) 2 Plot three functions (sin, cos, sin 2 ) with independent variables using three subplots. 3 Plot exponential decay function. Use commands title, grid, xlabel and ylabel. 4 Use Matlab’s linspace (a,b,n) command to generate n equally spaced numbers between a and b. for the given values of a, b, and n. Also zero out every odd indexed entry. Use Matlab’s stem command to plot the elements in the resulting vector versus their indices. 5 Plot following functions for t= -5 to 5 using inline command. (a) f(t)=e -t cos(2лt) (b) g(t)= e -3t 2sin(лt) 6 Plot unit step function u(t) with inline and axis modification. 7 Plot following pulse signals: (a) p(t) = u(t)-u(t-1) (b) q(t) = u(t-3)-u(t-5) 8 Plot following time shift and time scaled signals: g(t) = e -t cos(6t), g(t-1), g(t+1), g(2t+1) 9 Find the energy of following signals: (a) x(t) = e -t cos (2лt) u(t). (b) g(t) = e -t u(t)-u(t-1) 10 Write a MATLAB program to generate the following signals using sign(t) function. (a) Unit step signal u(t) (b) Unit Impulse signal impls(t) (a) a rectangular pulse of width of 2 (b) Unit ramp signal r(t) 11 Write a MATLAB program to generate the following signals using sign(t) function. (a) u(t-3) (b) u(2t+2) (c) impls(t-2.5) (d) r(t-3) 12 Write a MATLAB program to generate the following signals. (a) a 50 Hz sinusoidal signal sin(2pift) sampled at 600Hz. (b) A sinc function (c) A square wave 13 Find the roots of polynomial " ax 2 + bx + c” for given values of a,b,c. 14 Consider the LTI Sys specified by differential equation:

Transcript of Ss matlab solved

Signals and Systems:

List of MATLAB Problems:

1 Create a row vector x = (2; 3; 5; 7; 11; 13; 17; 19; 23; 29) in MATLAB. Now use the

colon operator to display only the even entries of the vector, that is, the output should be the vector (3; 7; 13; 19; 29). Now do the same thing but display the output in reverse order, that is, the output should be (29; 19; 13; 7; 3)

2 Plot three functions (sin, cos, sin2) with independent variables using three subplots.

3 Plot exponential decay function. Use commands title, grid, xlabel and ylabel.

4 Use Matlab’s linspace (a,b,n) command to generate n equally spaced numbers between a and b. for the given values of a, b, and n. Also zero out every odd indexed entry. Use Matlab’s stem command to plot the elements in the resulting vector versus their indices.

5 Plot following functions for t= -5 to 5 using inline command. (a) f(t)=e-t cos(2лt) (b) g(t)= e-3t 2sin(лt)

6 Plot unit step function u(t) with inline and axis modification.

7 Plot following pulse signals: (a) p(t) = u(t)-u(t-1) (b) q(t) = u(t-3)-u(t-5)

8 Plot following time shift and time scaled signals: g(t) = e-t cos(6t), g(t-1), g(t+1), g(2t+1)

9 Find the energy of following signals: (a) x(t) = e-t cos (2лt) u(t). (b) g(t) = e-t u(t)-u(t-1)

10 Write a MATLAB program to generate the following signals using sign(t) function. (a) Unit step signal u(t) (b) Unit Impulse signal impls(t) (a) a rectangular pulse of width of 2 (b) Unit ramp signal r(t)

11 Write a MATLAB program to generate the following signals using sign(t) function. (a) u(t-3) (b) u(2t+2) (c) impls(t-2.5) (d) r(t-3)

12 Write a MATLAB program to generate the following signals. (a) a 50 Hz sinusoidal signal sin(2pift) sampled at 600Hz. (b) A sinc function (c) A square wave

13 Find the roots of polynomial " ax2 + bx + c” for given values of a,b,c.

14 Consider the LTI Sys specified by differential equation:

RATHOR
Highlight

(D2 + 4D + 3)y(t)= (3D + 5) x(t). Using initial conditions y(0)=3, Dy(0)=-7, determine zero input component of the response.

15 Determine the impulse response h(t) for for an LTI sys specified by differential equation:

(A) (D2+3D+2) y(t) = D x(t) (B) (D2+2D+1) y(t) = D x(t) (C) D (D+2) y(t) = (D+4) x(t)

16 Solve the differential equation: (A) (D2+3D+2) y(t) = x(t)

using input x(t) = 5t + 3 and initial conditions y(0)=2 & Dy(0)=3. (B) (D2+5D+6) y(t) = (D+1) x(t)

using input x(t) = 6t2 and initial conditions y(0)=25/18 & Dy(0)=-2/3 17 Sketch the following discrete time signals:

(A) xa[n] = (-0.5)n (B) xb[n] = (2)n (C) xc[n] = - (-2)n

18 Sketch the following Discrete Time Sinusoid (A) xa[n] = cos( (л/12) n + (л/4)) (B) xb[n] = cos( (л /12) n ) (C) xc[n] = sin( (л/12) n + (л/4))

19 solve: y[n+2]-y[n+1]+0.24y[n] = x[n+2]-2x[n+1] with initial condition y[-1] = 2, y[-2] = 1 and a causal input x[n] = n (starting at n=0).

20 Write a scilab code to generate following signals. (A) x(t)=e-2t u(t) (B) x(t-1) ; x(t) delayed by 1 second (C) x(t+1) ; x(t) advanced by 1 second

21 Write a scilab code to generate following sampled signals. Take sampling frequency fs = 150Hz.

(A) x1 = sin(2л 10 t) (B) x2 = sin(2л 20 t) (C) x3 = x1+ x2

RATHOR
Highlight
RATHOR
Highlight
RATHOR
Highlight
RATHOR
Highlight

STEMS - 2141005

MATLAB SOLVED PROBLEMS [1-10]

RATHOR VIJENDRASINGH RAMSAHAY

Enrollment no. 130170111092

EC 4th SEMESTER – 2015

SIGNALS AND SYSTEMS - 2141005

1. Create a row vector x = (2; 3; 5; 7; 11; 13; 17; 19; 23; 29) in MATLAB. Now use the colon operator to display only

the even entries of the vector, that is, the output should be the vector (3; 7; 13; 19; 29). Now do the same thing

but display the output in reverse order, that is, the output should be (29; 19; 13; 7; 3)

2. Plot three functions (sin, cos, sin2) with independent variables using three subplots.

3. Plot exponential decay function. Use commands title, grid, xlabel and ylabel.

4. Use Matlab’s linspace (a,b,n) command to generate n equally spaced numbers between a and b. for the given

values of a, b, and n. Also zero out every odd indexed entry. Use Matlab’s stem command to plot the elements

in the resulting vector versus their indices.

5. Plot following functions for t= -5 to 5 using inline command.

(a) f(t)=e-t cos(2лt)

(b) g(t)= e-3t 2sin(лt)

6. Plot unit step function u(t) with inline and axis modification.

7. Plot following pulse signals:

(a) p(t) = u(t)-u(t-1)

(b) q(t) = u(t-3)-u(t-5)

8. Plot following time shift and time scaled signals:

g(t) = e-t cos(6t), g(t-1), g(t+1), g(2t+1)

9. Find the energy of following signals:

(a) x(t) = e-t cos (2лt) u(t).

(b) (b) g(t) = e-t u(t)-u(t-1)

10. Write a MATLAB program to generate the following signals using sign(t) function.

(a) Unit step signal u(t)

(b) Unit Impulse signal impls(t)

(a) a rectangular pulse of width of 2

(b) Unit ramp signal r(t)

SIGNALS AND SYSTEMS – 2141005

MATLAB & SCILAB SOLVED PROBLEMS [11-21]

RATHOR VIJENDRASINGH RAMSAHAY

Enrollment no. 130170111092

EC 4th SEMESTER – 2015

11. Write a MATLAB program to generate the following signals using sign(t) function.

(a) u(t-3)

(b) u(2t+2)

(c) impulse(t-2.5)

(d) r(t-3)

12. Write a MATLAB program to generate the following signals.

(a) A 50 Hz sinusoidal signal sin(2 pi f t) sampled at 600Hz.

(b) A sinc function

(c) A square wave

13. Find the roots of polynomial " ax2 + bx + c” for given values of a,b,c.

14. Consider the LTI Sys specified by differential equation:

(D2 + 4D + 3)y(t)= (3D + 5) x(t).

Using initial conditions y(0)=3, Dy(0)=-7, determine zero input component of the response.

15. Determine the impulse response h(t) for for an LTI sys specified by differential equation:

(A) (D2+3D+2) y(t) = D x(t)

(B) (D2+2D+1) y(t) = D x(t)

(C) D (D+2) y(t) = (D+4) x(t)

16. Solve the differential equation:

(A) (D2+3D+2) y(t) = x(t) using input x(t) = 5t + 3 and initial conditions y(0)=2 & Dy(0)=3.

(B) (D2+5D+6) y(t) = (D+1) x(t) using input x(t) = 6t2 and initial conditions y(0)=25/18 & Dy(0)=-2/3

17. Sketch the following discrete time signals:

(A)xa[n] = (-0.5)n

(B) xb[n] = (2)n

(C) xc[n] = - (-2)n

18. Sketch the following Discrete Time Sinusoid

(A) xa[n] = cos( (л/12) n + (л/4))

(B) xb[n] = cos( (л /12) n )

(C) xc[n] = sin( (л/12) n + (л/4))

19. solve: y[n+2]-y[n+1]+0.24y[n] = x[n+2]-2x[n+1] with initial condition y[-1] = 2, y[-2] = 1 and a causal input x[n] = n (starting at n=0).

20. Write a scilab code to generate following signals.

(A) x(t)=e-2t

u(t)

(B) x(t-1) ; x(t) delayed by 1 second

(C) x(t+1) ; x(t) advanced by 1 second

21. Write a scilab code to generate following sampled signals. Take sampling frequency fs= 150Hz.

(A) x1 = sin(2л 10 t)

(B) x2 = sin(2л 20 t)

(C) x3 = x1+ x2