MatLAB

17
SIGNAL SYSTEM SKEE2073-10 MATLAB REPORT GROUP MEMBERS NIK AHMAD FAISAL BIN MOHD KAMAROLZAMAN B14KE0038 MAZRUL BIN KARIM B14KE0052 MUHAMMAD ZULHILMI BIN HALIM B14KE0035 Lecturer DR MUHAMMAD RAMLEE KAMARUDIN

description

l

Transcript of MatLAB

Page 1: MatLAB

SIGNAL SYSTEM

SKEE2073-10 

MATLAB REPORT

GROUP MEMBERS

NIK AHMAD FAISAL BIN MOHD KAMAROLZAMAN B14KE0038

MAZRUL BIN KARIM B14KE0052

MUHAMMAD ZULHILMI BIN HALIM B14KE0035

Lecturer

DR MUHAMMAD RAMLEE KAMARUDIN

Page 2: MatLAB

Introduction

From what we have learnt in Signal and System class, wave-like periodic signal for example square waves actually is a sum of a lot sinusoidal graph that makes up in the end to behave a desired shaped wave. In this report, we will discuss on how square waves make up a lot of sinusoidal wave with certain equation. We called this as Fourier Series. Fourier Series has two types, it is fourier series trigonometric and complex exponential fourier series form.

Fourier series is a representation of a complicated periodic signal in the frequency domain by its frequency components(spectrum.) For example, the representation of musical sounds as sums of waves of various frequencies is an audible example. Mostly in electrical engineering, we will focus on electrical signal in term of communication.

2

Page 3: MatLAB

ObjectiveMATLAB is a software package for carrying out numerical computations and analyses. Ituses blocks of data called matrices (MATLAB stands for matrix laboratory). MATLAB isprobably the most commonly used scientific and engineering numerical software. (Othersoftware commonly used are PV-WAVE for processing seismograms and EDL forprocessing satellite data. They are all converging and looking like each other at the front endeven if underneath they work on different principles.)

The objectives of doing this mat lab assignments are, firstly, is to train and expose students to use MATLAB to plot results. It is an easy to use high-level language for solving engineering and mathematical problems. It has become a popular tool of choice for research and development in the industry. Our second objective is to evaluate the response of a linear time invariant system due to signal operations. This is to enhance our knowledge about the system and to gain better understanding about signal operations. Also give student a chance on practicality of what they have learnt in class. Last but not least, the objective of this assignment is to establish good report and to train student to work efficiently in groups. Since teamwork is very important in a real working life, this mat lab assignment help improve our teamwork skills.

The end of this assignment, student shoulde be able :-

Student should be able to access MATLAB Student able to use the MATLAB help facility, do simple (but large) calculations and

print out graphs. Student able to do the full report of their work.

3

Page 4: MatLAB

Methodology

4 Questions were given to be calculated and the process need to involve the answers with Matlab analysis on wave plotted. What we have learn before by using equation below we could identify the shape of the graph.

is the time average of v(t). It is zero if it is symmetry in the period of time T. is zero for question 1, 3 and 4

if v(1) has cosine-like symmetry along the time axis about t=0. In other words for t and –t of time magnitude is the same. This is true for question 4 based on observation.

if v(t) has sine-like odd symmetry along the time axis about t=0. In other words it has same magnitude but but opposite sign at t and –t. This is true for question 1,2, and 3.

if v(t) has skew symmetry. This is not applicable in square waves

Based on calculation of , ,and , we could conclude the shape of the wave based on the representation of equation.

4

Page 5: MatLAB

Flow chart

Analyse the question for the assignment.

Test each signals.

Matlab software is used for programming

Troubleshoot programme using mat lab software

Compare the output signals from mat lab

software with the manual calculation

Writing a report and present it to the lecturer

Question 1

5

Page 6: MatLAB

General equation :

v (t )=ao+∑n=1

(an cosn ωot +bnsin n ωot )

ao=1T ∫

0

T

f (t )dt

an=2T ∫

0

T

f (t ) cosnωo t dt

bn=2T ∫

0

T

f ( t ) sin n ωot dt

Application Question 1 to Matlab

6

Page 7: MatLAB

Graph plotted :

Discussion

7

syms t n;T=2; %periodw0=pi; %angular frequency%2*pi/Ta0 = (2/T)*(int(0.02,t,0,1))+...(2/T)*(int(-0.02,t,1,2));Z = 0.02; %amplitudean = (2/T)*(Z*int(cos(n*w0*t),t,0,1))+...(2/T)*(-Z*int(cos(n*w0*t),t,1,2));

bn = (2/T)*(Z*int(sin(n*w0*t),t,0,1))+...(2/T)*(-Z*int(sin(n*w0*t),t,1,2)) ;

t=-4:0.01:4; %time scale

vt=(a0/2)+symsum(an*cos(n*w0*t)+bn*sin(n*w0*t),n,1,5); %FS of vt up to 5th%harmonic

plot(t,vt); %plot graph vt versus tgrid on; %grid onylabel ( 'v(t)' ); %y-axis labelxlabel( 't(s)' ); %x-axis labeltitle('The trigonometric Fourier Series'); %graph title

Page 8: MatLAB

As the theory of fourier series the graph show an an odd signal this is because of th value of is an=0. As practically, after design at a software matlab it also the same graph. Meaning that, theory of fourier series and symmetry properties of FSis acceptable. The result shown the ouput signal is not exactly same because there no filter is applied in the design, so the result is not smoothly.

8

Page 9: MatLAB

Question 2

General equation :

v (t )=ao+∑n=1

(an cosn ωot +bnsin n ωot )

ao=1T ∫

0

T

f (t )dt

an=2T ∫

0

T

f (t ) cosnωo t dt

bn=2T ∫

0

T

f ( t ) sin n ωot dt

Application Question 2 to Matlab

9

Page 10: MatLAB

Graph plotted :

10

syms t n;T=2;w0=pi; a0 = (2/T)*(int(0.04,t,0,1)); Z = 0.04;an = (2/T)*(Z*int(cos(n*w0*t),t,0,1)); bn = (2/T)*(Z*int(sin(n*w0*t),t,0,1)); t=-4:0.01:4;vt=(a0/2)+symsum(an*cos(n*w0*t)+bn*sin(n*w0*t),n,1,5); plot(t,vt);grid on;ylabel ( 'v(t)[mv]' );xlabel( 't[s]' );title('The trigonometric Fourier Series');

Page 11: MatLAB

Question 3

General equation :

v (t )=ao+∑n=1

(an cosn ωot +bnsin n ωot )

ao=1T ∫

0

T

f (t )dt

an=2T ∫

0

T

f (t ) cosnωo t dt

bn=2T ∫

0

T

f ( t ) sin n ωot dt

11

Page 12: MatLAB

Application Question 3 to Matlab

Graph plotted :

12

syms t n;T=4;w0=1.5707; %2*pi/TZ = 0.02;a0 = (2/T)*(int(Z,t,0,1))+... (2/T)*(int(-Z,t,2,3)); an = (2/T)*(Z*int(cos(n*w0*t),t,0,1))+... (2/T)*(-Z*int(cos(n*w0*t),t,2,3)); bn = (2/T)*(Z*int(sin(n*w0*t),t,0,1))+... (2/T)*(-Z*int(sin(n*w0*t),t,2,3)) ; t=-4:0.02:4;vt=(a0/2)+symsum(an*cos(n*w0*t)+bn*sin(n*w0*t),n,1,5); plot(t,vt);grid on;ylabel ( 'v(t)[v]' );xlabel( 't[s]' );title('The trigonometric Fourier Series');

Page 13: MatLAB

Question 4

General equation :

v (t )=ao+∑n=1

(an cosn ωot +bnsin n ωot )

ao=1T ∫

0

T

f (t )dt

an=2T ∫

0

T

f (t ) cosnωo t dt

bn=2T ∫

0

T

f ( t ) sin n ωot dt

13

Page 14: MatLAB

Application Question 4 to Matlab

Graph plotted :

14

syms t n;T=2;w0=pi; %2*pi/TZ = 0.02;a0 = (2/T)*(int(Z,t,-0.5,0.5))+... (2/T)*(int(-Z,t,0.5,1.5)); an = (2/T)*(Z*int(cos(n*w0*t),t,-0.5,0.5))+... (2/T)*(-Z*int(cos(n*w0*t),t,0.5,1.5)); bn = (2/T)*(Z*int(sin(n*w0*t),t,-0.5,0.5))+... (2/T)*(-Z*int(sin(n*w0*t),t,0.5,1.5)) ; t=-4:0.02:4;vt=(a0/2)+symsum(an*cos(n*w0*t)+bn*sin(n*w0*t),n,1,5); plot(t,vt);grid on;ylabel ( 'v(t)[v]' );xlabel( 't[s]' );title('The trigonometric Fourier Series');

Page 15: MatLAB

ConclusionAs we all learnt in Signal and System class.We are capable of involve in a little part of application of the subject. Using Matlab, we are once step further of applying our knowledge in real world. Fourier Series is basic of representing basic periodic signal which it is important for us to understand thoroughly.

Matlab is essential for signal analysis if we were ever involve in communication system analysis. By being knowledgeable of basic Matlab and Signal and System should help us to apprehend the knowledge for next semester subjects which is Electromagnetic Magnetic Theory.

15