Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help in matlab code. Write a MATLAB program (script) which creates an animation showing how the Fourier series evolves as more terms are added

Need help in matlab code. image text in transcribed
image text in transcribed
Write a MATLAB program (script) which creates an animation showing how the Fourier series evolves as more terms are added to the sum. The user will input an equation for the Fourier series coefficients, Gn and the maximum number of terms, Nmax to process. The sequence of plots will show the signal g(t). Notes 1. Use the exponential Fourier series. For each plot in the animation use symmetric limits in the summation, e.g. n 5 to +5, so the result is real-valued (assuming the Fourier series coefficients have the appropriate symmetry). 2The user will input the equation, Gn, as text, for example Equations with special cases can be input by including logical expressions, for example 3. Use good programming style. Include comments. 2.5*sinc(n/2) 2.5*sinc(n/2) + (n--0)*3 Hints 1. The signal g() may have a very small imaginary component because of finite-precision arithmetic. Th the real part, but to avoid masking problems in the program it is good to check that the imaginar part is very small. is will cause a warning message when plotting. To avoid this error message plot 2. An equation can be input as a character vector and then converted to a function using "vectorize" and "str2func". Hint: for initial testing it might be convenient to instead use an anonymous function or assign the character vector to some predefined value and comment out the input statement. 3. Test the program using known signals such as examples from the text. Certain programming errors will not affect symmetric signals so be sure that testing includes a signal which is not symmetric. 4. You may prompt the user to enter To or you may normalize the time axis to be t/To Write a MATLAB program (script) which creates an animation showing how the Fourier series evolves as more terms are added to the sum. The user will input an equation for the Fourier series coefficients, Gn and the maximum number of terms, Nmax to process. The sequence of plots will show the signal g(t). Notes 1. Use the exponential Fourier series. For each plot in the animation use symmetric limits in the summation, e.g. n 5 to +5, so the result is real-valued (assuming the Fourier series coefficients have the appropriate symmetry). 2The user will input the equation, Gn, as text, for example Equations with special cases can be input by including logical expressions, for example 3. Use good programming style. Include comments. 2.5*sinc(n/2) 2.5*sinc(n/2) + (n--0)*3 Hints 1. The signal g() may have a very small imaginary component because of finite-precision arithmetic. Th the real part, but to avoid masking problems in the program it is good to check that the imaginar part is very small. is will cause a warning message when plotting. To avoid this error message plot 2. An equation can be input as a character vector and then converted to a function using "vectorize" and "str2func". Hint: for initial testing it might be convenient to instead use an anonymous function or assign the character vector to some predefined value and comment out the input statement. 3. Test the program using known signals such as examples from the text. Certain programming errors will not affect symmetric signals so be sure that testing includes a signal which is not symmetric. 4. You may prompt the user to enter To or you may normalize the time axis to be t/To

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions

Question

1. What are the marketing implications of this situation?

Answered: 1 week ago