Главная » Просмотр файлов » Thompson - Computing for Scientists and Engineers

Thompson - Computing for Scientists and Engineers (523188), страница 62

Файл №523188 Thompson - Computing for Scientists and Engineers (Thompson - Computing for Scientists and Engineers) 62 страницаThompson - Computing for Scientists and Engineers (523188) страница 622013-09-15СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 62)

Given the above expansion formulas for the range 0 tohow should they be modified to account for this different range? The answer tothis question is to map the range x- to x+ by(9.46)which ranges over 0 toas x ranges over x- to x+. also note that9.5SOME PRACTICAL FOURIER SERIES337(9.47)We may now use the Fourier expansion formulas (9.41) and (9.42) in terms of thex' variable to get the Fourier series for the arbitrary interval. With a relabeling of x'by x, the expansion formulas for the complex-exponential series are(9.48)in which the coefficients are given by(9.49)Exercise 9.16Work through the steps from the change of variables (9.46) through formulas(9.41) and (9.42) to verify the expansions (9.48) and (9.49) for the complexFourier series for arbitrary intervals.

nWe have now accomplished a considerable amount of analysis for Fourier series. Let us work out some applications to practical and interesting examples.9.5 SOME PRACTICAL FOURIER SERIESTo illustrate the delicate superposition of high and low harmonics that is often required to achieve a good Fourier series representation of a function, we now consider periodic functions with rapid variation near some values of x and much slowervariation near others. The examples of functions that we consider are the squarepulse, the wedge, the window and the sawtooth. Because of the discontinuities ofthese functions, they cannot be described by the Taylor-expansion methods coveredin Chapter 3.

Recall from Chapter 6.2 that we are making least-squares fits tothese unconventional but useful functions, since the trigonometric functions or complex exponentials form orthogonal functions for the appropriate expansions.The functions that we consider are real-valued; it is therefore most convenient touse the cosine and sine series expansions (9.44) and (9.45) for their Fourier seriesrather than the complex-exponential expansion (9.42). Further, various reflectionand translation symmetries of the functions (which we will derive) will result in onlycosine or only sine terms appearing in the expansions. The x interval on which wedefine each example function is 0 < x <This is done primarily for convenience and to obtain simple results.

If you wish to use a different interval, you mayuse the results at the end of Section 9.4 to make the conversion.338DISCRETE FOURIER TRANSFORMS AND FOURIER SERIESBy sneaking a look ahead, you may have noticed that we use examples of functions that have discontinuous values, and sometimes discontinuous derivatives.Justification for this is provided in Section 9.6 in the diversion on the WilbrahamGibbs overshoot phenomenon.The square-pulse functionA square pulse may be used, for example, to describe voltage pulses as a function oftime, if y = V, the voltage (suitably scaled), and x = t, the time (in suitable units).This square pulse function is described by(9.50)We can quite directly find the Fourier series coefficients ak and bk by substitutinginto formulas (9.44) and (9.45) and performing the indicated integrals.

The resultsfor the coefficients of the cosines are(9.51)and for the coefficients of the sines we have(9.52)The nonzero Fourier series coefficients, the sine coefficients of the odd harmonics,k = 1,3,..., are displayed in Figure 9.8. Note that their envelope is a rectangularhyperbola because of their inverse proportionality to k.FIGURE 9.8 Fourier series coefficients, bk, for the square wave as a function of k.9.5SOME PRACTICAL FOURIER SERIES339Why do most of the Fourier coefficients vanish? If we consider the square pulsedefined by (9.50), we see that it is antisymmetric about x =It must therefore berepresented by cosine or sine functions with the same symmetry. But the cosine hasreflection symmetry about x = so the cosines cannot appear, thus their coefficients, the ak, must all be zero, as (9.51) claims.

Why do the sine coefficients vanish for k even? Notice that the square pulse changes sign under translation of x byThe function sin (kx) has this property only when k is odd, just as we see for theb k in (9.52).We conclude that reflection symmetries and translation symmetries determine toa large degree which Fourier series coefficients will be nonzero. If such symmetryconditions are invoked before the coefficients are evaluated, much of the effort ofintegration can usually be avoided.With the expansion coefficients given by (9.51) and (9.52), the approximateFourier series reconstruction of the square pulse becomes(9.53)where the sum up to M (taken as odd, for simplicity of expression) is(9.54)Note that this is the best that one can make the fit, using the least-squares criterion,for a given value of M.The sine series expansion (9.54) converges as a function of M as indicated inFigure 9.9.

From M = 3 to M = 31 the contribution of the last term should decrease by a factor of more than 10, and the approach to a square pulse shape appearsto proceeding smoothly, even if rather slowly.FIGURE 9.9 Fourier series approximation to the square-pulse function up to the Mth harmonic,shown for M = 3 and M = 31.DISCRETE FOURIER TRANSFORMS AND FOURIER SERIES340Exercise 9.17(a) Carry out all the integrations for the square-pulse Fourier-series expansioncoefficients in order to verify formulas (9.51) and (9.52).(b) Check the symmetry conditions discussed above for the square pulse, andverify in detail the claimed reflection and translational symmetry properties of thesquare pulse and the nonzero sine terms.(c) Verify the algebraic correctness of the expansion (9.54).

nConvergence of Fourier series is of practical importance, both for computationalsoftware (the time involved and the accuracy of the result) and for practical devices,such as pulse generators based on AC oscillations and their harmonics. Therefore, itis interesting to have programs available for computing the series.Program for Fourier seriesFor studying the convergence of Fourier series expansions of interesting functions,it is helpful to have a program. Here is a simple program, Fourier Series, thatcomputes for given M the series expansion (9.54) for x = 0 to x =Four cases of function--square, wedge, window, and sawtooth --are included in Fourier Series. Other cases can easily be included by increasing therange of values that choice takes on, and by writing a simple program function foreach case.

The programming for producing an output file for use by a graphics application is not included, since the programming depends quite strongly on the computer system used. However, you won’t find a list of numerical printout very enlightening, so you should add some code for your own graphics output.PROGRAM 9.2 Fourier series for square. wedge, window, and sawtooth functions.#include#include<stdio.h><math.h>main()/* Fourier Seriesfor real functions; data for plots */double pi,dx,x,y;int M,nx,choice;void FSsquare(),FSwedge(),FSwindow(),FSsawtooth();pi = 4*atan(1.0);printf("Fourier Series: Input M: ");scanf ("%i",&M) ;nx = 2*M+1; /* Number of x steps in 0 - 2pi */dx = 0.5*pi/M;9.5SOME PRACTICAL FOURIER SERIESprintf("\nChoose function:\n""1 square, 2 wedge, 3 window, 4 sawtooth: ");scanf("%i",&choice) ;for ( x = 0; x <= 2*pi; x = x+dx ){switch (choice)case 1: FSsquare(pi,x,M,&y); break;case 2: FSwedge(pi,x,M,&y); break;case 3: FSwindow(pi,x,M,&y); break;case 4: FSsawtooth(pi,x,M,&y); break;default:printf("\n !! No such choice\n\n");printf("\nEnd Fourier Series"); exit(l);}}printf("\n%f%f",x,y);printf("\nEnd Fourier Series");exit(O);void FSsquare(pi,x,M,y)double pi,x,*y; /* Square wave series */int M;double sum; int k;sum= 0;for(k=l;k<=M;k=k+2)sum = sum+sin(k*x)/k;}*y = 4*sum/pi;void FSwedge(pi,x,M,y)double pi,x,*y; /* Wedge series */int M;double sum; int k;sum = 0;for(k=l;k<=M;k=k+2)sum = sum+cos(k*x)/(k*k);341342DISCRETE FOURIER TRANSFORMS AND FOURIER SERIES*y = 0.5-4*sum/(pi*pi);}void FSwindow(pi,x,M,y)double pi,x,*y; /* Window series */int M;{double sum; int k,phase;sum = 0;for(k=l;k<=M;k=k+2)phase = (k-1)/2;if ( phase-2* (phase/2 > 0 )sum = sum-cos(k*x)/k;elsesum = sum+cos(k*x)/k;*y = 0.5-2*sum/pi;void FSsawtooth(pi,x,M,y)double pi,x,*y; /* Sawtooth series */int M;double sum; int k,phase;sum= 0;for(k=l;k<=M;k=k+l)phase=k-1;if ( phase-2*(phase/2) > 0 )sum = sum-sin(k*x)/k;elsesum = sum+sin(k*x)/k;*y = 2*sum/pi;Based on the program, there are several interesting aspects of these series thatyou may explore.Exercise 9.18(a) Code the program Fourier Series for your computer system and check itfor correctness as follows.

When it executes without runtime errors (so that it’ssatisfying the programming rules), verify the reflection and translation symmetries discussed in the preceding subsection. Then spot check some of the values9.5SOME PRACTICAL FOURIER SERIES343for the square pulse (choice = 1) for reasonableness against the graphical display in Figure 9.9.(b) Run the program for increasingly larger (odd) values of M. Sketch out bothhow the overall approximation to the square pulse improves, then how the details of the fit near the discontinuity of the square pulse at x = do not improveas increases. This “Wilbraham-Gibbs phenomenon” is discussed in detail inSection 9.6. nNow that we have a program to do the busywork of numerics, it is interesting to trythe Fourier series for other functions.The wedge functionThe wedge (isosceles triangle) function is of special interest for its application to image enhancement, in which x (or its extension to two dimensions) is spatial positionand y (x) becomes image intensity as a function of position.

Pratt’s text has an extensive discussion of this use of the wedge function.The wedge function with unity maximum height is defined by(9.55)As for the square pulse in the preceding subsection, we can just plug this y (x) intoeach of the integrals for the Fourier coefficients, (9.44) and (9.45).Exercise 9.19(a) Carry out all the integrations for the wedge-function Fourier-series coefficients in order to obtain(9.56)(9.57)(b) Use the reflection symmetry of this function about x =plain why sine terms are missing from this expansion.(c) Use the translation property of the wedge functionin order to ex-(9.58)to explain why only odd values of k contribute to the expansion. nThe Fourier coefficients in k space is shown in Figure 9.10. They are verysimilar to those for the seemingly quite different square pulse shown in Figure 9.8.344DISCRETE FOURIER TRANSFORMS AND FOURIER SERIESFIGURE 9.10 Fourier series coefficients, ak, for the wedge function (9.55) as a function of k.The wedge function may be approximately reconstructed by using the sum of theseries up to M terms, namely(9.59)where the sum up to M (odd, for simplicity) is(9.60)This series converges very rapidly to the wedge function as M increases, as shownin Figure 9.11, where for M = 3 we have as close a representation of the wedge asfor M = 31 for the square pulse shown in Figure 9.9.FIGURE 9.11 Fourier series approximation of the wedge function up to the M th harmonic forM = 1 (dotted line) and for M = 3 (dashed line).9.5SOME PRACTICAL FOURIER SERIES345By running Fourier Series with choice = 2 for the wedge function, youmay explore the rate of convergence of the series as a function of M.

Характеристики

Тип файла
PDF-файл
Размер
4,66 Mb
Тип материала
Учебное заведение
Неизвестно

Список файлов книги

Свежие статьи
Популярно сейчас
Как Вы думаете, сколько людей до Вас делали точно такое же задание? 99% студентов выполняют точно такие же задания, как и их предшественники год назад. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6455
Авторов
на СтудИзбе
305
Средний доход
с одного платного файла
Обучение Подробнее