0 views

Uploaded by Christopher Cheuvront

University of Arizona ECE 340

save

- trig syllabus
- Mathematics - I (2)
- Comlpex Fourier Series
- ComplexNumbers, Functions, Factoring
- 3wi1m14v326uhk
- Precalc Survival Sheet
- 64 Trigonometri Equations Part 1 of 1
- 4037_s03_qp_1
- websolutions11_0.pdf
- m3 Vtu Notes
- Continuous Function
- pSet10
- Microsoft Word - Calculus 2 Formula Cheat Sheet
- 4MA0_4H_que_20110610
- 3BMAS 2012 Resource Rich Test 4 and Form Sht
- Free Review - Mathematics
- lec2.pdf
- Trig
- Music & Algebra
- Trigonometry
- XII Math Ch2 Inverse Trigonometric Functions Chapter Notes August
- 4E A Maths P1 Prelim 1 2009 (final)
- JEE Mains 2013 Mathematics Question Paper
- school work
- 8[1].4 Trigonometric Integrals
- mct4c course outline
- supp07.pdf
- 2hweek33may12017
- M3eSolns10
- 14mesmet
- Ece340 MATLAB Soln1 s13
- Ece340 MATLAB Soln6 s13
- Ece340 MATLAB Soln10 s13
- Ece340 MATLAB Soln9 s13
- Ece340 MATLAB Soln7 s13
- ece340_soln1_s13
- Ece340 MATLAB Soln2 s13
- Ece340 MATLAB Soln5 s13
- ECE 340 - Final Exam - Notes

You are on page 1of 6

M-file used to generate the Fourier Series Coefficients. % MP8p1.m % Matlab Problem Set 8 % Number 1. % M-script to execute the commands to generate trigonometric coefficients % for Problem 6.1-1 (a). % T=4; % Define the fundamental period for x(t). n=input('Enter the harmonic number >') syms t; % Define 't' to be a symbolic variable. an1=int((2/T)*cos(0.5*pi*n*t),t,-1,1); % Create the 1st half of the coef. an2=int((-2/T)*cos(0.5*pi*n*t),t,1,3); % Second half of coefficient. an=an1+an2, % Display the coefficient for the n-th harmonic. digits(5); % Reduce the number of significant figures in the displayed ans. an_number=vpa(an) % Use the variable precision arithmetic to diplay value. % % % Execute the M-script file MP8p1.m for several harmonics. % These commands will compute the coefficients for the Fourier Series % expansion. MP8p1 Enter the harmonic number >1 n = 1

an = 4/pi

an_number = 1.2732 MP8p1, % Run the script and use n=2. Enter the harmonic number >2 n = 2

an = 0

an_number = 0.0 MP8p1, % Run the script with n=3. Enter the harmonic number >3 n = 3

an = -4/(3*pi)

an_number = -0.42441 MP8p1, % Run the script with n=4. Enter the harmonic number >4 n = 4

an = 0

an_number = 0.0 MP8p1, % Run the script with n=5. Enter the harmonic number >5 n = 5

an = 4/(5*pi)

an_number = 0.25465 MP8p1, % Run the script with n=6. Enter the harmonic number >6 n = 6

an = 0

an_number = 0.0 MP8p1, % Run the script with n=7. Enter the harmonic number >7 n = 7

an = -4/(7*pi)

an_number = -0.18189 % These expressions and numerical values are consistent with the Trigonometric % Fourier Series coefficients derived by hand in Problem 6.1-1. diary off

Matlab Commands for checking the answers for Problem 6.1-1(c). M-file used to compute the Trigonometric Fourier Series Coefficients. % MP8p2.m % Matlab Problem Set 8 % Number 2. % M-script to execute the commands to generate trigonometric coefficients % for Problem 6.1-1 (c). % % Only the non-DC terms will be computed with this M-file. % T=2*pi; % Define the fundamental period for x(t). n=input('Enter the harmonic number >') syms t; % Define 't' to be a symbolic variable. bn=int((2/T)*(1/(2*pi))*t*sin(n*t),t,0,2*pi); % Create the sine coefficient. % Will only worry about displaying the numerical value of the coefficient. digits(5); % Reduce the number of significant figures in the displayed ans. bn_number=vpa(bn) % Use the variable precision arithmetic to diplay value. % % % The above M-file does not compute the average value of the periodic % waveform. % % I will execute some Matlab commands to compute the average value of x(t) % prior to running the M-file MP8p2.m to compute the F.S. coefficients. % % Execute the commands to find the Trigonometric Fourier Series coefficients. % These commands are meant for Problem 6.1-1(c). % The M-file MP8p2.m will be used to compute most of the coefficients. % % First, I will compute the average value of the periodic waveform. % This computation is not a part of the M-file. % I am assuming that ‘t’ has already been defined as a symbolic variable. T=2*pi; % Enter the period of the waveform. ao=(1/T)*int((1/(2*pi))*t,t,0,2*pi), % Average value of x(t) in part (c). ao = (32880603970571302491146779030281*pi^2)/649037107316853453566312041152512 digits(5); % Set the display digits to 5 significant figures. vpa(ao), % Display a more reasonable value for the average value of x(t). ans = 0.5 % Begin using the M-file script to compute the "b" coefficients. MP8p2, % Run the script with n=1. Enter the harmonic number >1 n = 1

bn_number = -0.31831 MP8p2, % Run the script with n=2. Enter the harmonic number >2 n = 2

bn_number = -0.15915 MP8p2, % Run the script with n=3. Enter the harmonic number >3 n = 3

bn_number = -0.1061 MP8p2, % Run the script with n=4. Enter the harmonic number >4 n = 4

bn_number = -0.079577 MP8p2, % Run the script with n=5. Enter the harmonic number >5 n = 5

bn_number =

-0.063662 MP8p2, % Run the script with n=6. Enter the harmonic number >6 n = 6

bn_number = -0.053052 % The above numerical values for the "b" coefficients are consistent % with the hand-calculated values. diary off

- trig syllabusUploaded byapi-369848447
- Mathematics - I (2)Uploaded bySrimanthula Srikanth
- Comlpex Fourier SeriesUploaded byFaiza Rasul
- ComplexNumbers, Functions, FactoringUploaded byabusulava
- 3wi1m14v326uhkUploaded byChris Lg
- Precalc Survival SheetUploaded byKrešimir Ivanović
- 64 Trigonometri Equations Part 1 of 1Uploaded byGovind Sai
- 4037_s03_qp_1Uploaded bymstudy123456
- websolutions11_0.pdfUploaded bykhey
- m3 Vtu NotesUploaded byNiranjan Jb
- Continuous FunctionUploaded byNur Amanina
- pSet10Uploaded bytheyperch
- Microsoft Word - Calculus 2 Formula Cheat SheetUploaded byHunterKing1993
- 4MA0_4H_que_20110610Uploaded bycamicami2
- 3BMAS 2012 Resource Rich Test 4 and Form ShtUploaded byAli Al-Asadi
- Free Review - MathematicsUploaded byShang Divina Ebrada
- lec2.pdfUploaded bydecioh
- TrigUploaded byNgro Quinapaxi Gonzalez
- Music & AlgebraUploaded byYban Ryko
- TrigonometryUploaded bySachin Chauhan
- XII Math Ch2 Inverse Trigonometric Functions Chapter Notes AugustUploaded bySaurabh Dutt
- 4E A Maths P1 Prelim 1 2009 (final)Uploaded byrunwaymemories
- JEE Mains 2013 Mathematics Question PaperUploaded bymohit24031986
- school workUploaded byrachna357
- 8[1].4 Trigonometric IntegralsUploaded byHermanManru
- mct4c course outlineUploaded byapi-423501795
- supp07.pdfUploaded byshimo1992
- 2hweek33may12017Uploaded byapi-336254119
- M3eSolns10Uploaded byAhmed M T
- 14mesmetUploaded bychrischov

- Ece340 MATLAB Soln1 s13Uploaded byChristopher Cheuvront
- Ece340 MATLAB Soln6 s13Uploaded byChristopher Cheuvront
- Ece340 MATLAB Soln10 s13Uploaded byChristopher Cheuvront
- Ece340 MATLAB Soln9 s13Uploaded byChristopher Cheuvront
- Ece340 MATLAB Soln7 s13Uploaded byChristopher Cheuvront
- ece340_soln1_s13Uploaded byChristopher Cheuvront
- Ece340 MATLAB Soln2 s13Uploaded byChristopher Cheuvront
- Ece340 MATLAB Soln5 s13Uploaded byChristopher Cheuvront
- ECE 340 - Final Exam - NotesUploaded byChristopher Cheuvront