c13-6 (Numerical Recipes in C), страница 3

PDF-файл c13-6 (Numerical Recipes in C), страница 3 Цифровая обработка сигналов (ЦОС) (15346): Книга - 8 семестрc13-6 (Numerical Recipes in C) - PDF, страница 3 (15346) - СтудИзба2017-12-27СтудИзба

Описание файла

Файл "c13-6" внутри архива находится в папке "Numerical Recipes in C". PDF-файл из архива "Numerical Recipes in C", который расположен в категории "". Всё это находится в предмете "цифровая обработка сигналов (цос)" из 8 семестр, которые можно найти в файловом архиве МГТУ им. Н.Э.Баумана. Не смотря на прямую связь этого архива с МГТУ им. Н.Э.Баумана, его также можно найти и в других разделах. Архив можно найти в разделе "книги и методические указания", в предмете "цифровая обработка сигналов" в общих файлах.

Просмотр PDF-файла онлайн

Текст 3 страницы из PDF

See text.sum=discrp;for (k=1;k<=m;k++) sum += d[k]*reg[k];for (k=m;k>=2;k--) reg[k]=reg[k-1];[If you want to implement circularfuture[j]=reg[1]=sum;arrays, you can avoid this shift}ing of coefficients.]free_vector(reg,1,m);}Removing the Bias in Linear PredictionYou might expect that the sum of the dj ’s in equation (13.6.11) (or, moregenerally, in equation 13.6.2) should be 1, so that (e.g.) adding a constant to all thedata points yi yields a prediction that is increased by the same constant. However,the dj ’s do not sum to 1 but, in general, to a value slightly less than one. This factreveals a subtle point, that the estimator of classical linear prediction is not unbiased,even though it does minimize the mean square discrepancy.

At any place where themeasured autocorrelation does not imply a better estimate, the equations of linearprediction tend to predict a value that tends towards zero.Sometimes, that is just what you want. If the process that generates the yi ’sin fact has zero mean, then zero is the best guess absent other information. Atother times, however, this behavior is unwarranted. If you have data that showonly small variations around a positive value, you don’t want linear predictionsthat droop towards zero.Often it is a workable approximation to subtract the mean off your data set,perform the linear prediction, and then add the mean back.

This procedure containsthe germ of the correct solution; but the simple arithmetic mean is not quite thecorrect constant to subtract. In fact, an unbiased estimator is obtained by subtractingfrom every data point an autocorrelation-weighted mean defined by [3,4]y≡Xβ[φµν +−1ηµν ]αβyβX−1[φµν + ηµν ]αβ(13.6.18)αβWith this subtraction, the sum of the LP coefficients should be unity, up to roundoffand differences in how the φk ’s are estimated.Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.

Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).void predic(float data[], int ndata, float d[], int m, float future[],int nfut)Given data[1..ndata], and given the data’s LP coefficients d[1..m], this routine applies equation (13.6.11) to predict the next nfut data points, which it returns in the arrayfuture[1..nfut]. Note that the routine references only the last m values of data, as initialvalues for the prediction.{int k,j;float sum,discrp,*reg;13.6 Linear Prediction and Linear Predictive Coding571Linear Predictive Coding (LPC)Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.

Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).A different, though related, method to which the formalism above can beapplied is the “compression” of a sampled signal so that it can be stored morecompactly. The original form should be exactly recoverable from the compressedversion. Obviously, compression can be accomplished only if there is redundancyin the signal.

Equation (13.6.11) describes one kind of redundancy: It says thatthe signal, except for a small discrepancy, is predictable from its previous valuesand from a small number of LP coefficients. Compression of a signal by the use of(13.6.11) is thus called linear predictive coding, or LPC.The basic idea of LPC (in its simplest form) is to record as a compressed file (i)the number of LP coefficients M , (ii) their M values, e.g., as obtained by memcof,(iii) the first M data points, and then (iv) for each subsequent data point only itsresidual discrepancy xi (equation 13.6.1). When you are creating the compressedfile, you find the residual by applying (13.6.1) to the previous M points, subtractingthe sum from the actual value of the current point.

When you are reconstructing theoriginal file, you add the residual back in, at the point indicated in the routine predic.It may not be obvious why there is any compression at all in this scheme. Afterall, we are storing one value of residual per data point! Why not just store the originaldata point? The answer depends on the relative sizes of the numbers involved.

Theresidual is obtained by subtracting two very nearly equal numbers (the data and thelinear prediction). Therefore, the discrepancy typically has only a very small numberof nonzero bits. These can be stored in a compressed file. How do you do it in ahigh-level language? Here is one way: Scale your data to have integer values, saybetween +1000000 and −1000000 (supposing that you need six significant figures).Modify equation (13.6.1) by enclosing the sum term in an “integer part of” operator.The discrepancy will now, by definition, be an integer. Experiment with differentvalues of M , to find LP coefficients that make the range of the discrepancy as smallas you can.

If you can get to within a range of ±127 (and in our experience this is notat all difficult) then you can write it to a file as a single byte. This is a compressionfactor of 4, compared to 4-byte integer or floating formats.Notice that the LP coefficients are computed using the quantized data, and thatthe discrepancy is also quantized, i.e., quantization is done both outside and insidethe LPC loop. If you are careful in following this prescription, then, apart from theinitial quantization of the data, you will not introduce even a single bit of roundofferror into the compression-reconstruction process: While the evaluation of the sumin (13.6.11) may have roundoff errors, the residual that you store is the value which,when added back to the sum, gives exactly the original (quantized) data value.

Noticealso that you do not need to massage the LP coefficients for stability; by adding theresidual back in to each point, you never depart from the original data, so instabilitiescannot grow. There is therefore no need for fixrts, above.Look at §20.4 to learn about Huffman coding, which will further compress theresiduals by taking advantage of the fact that smaller values of discrepancy will occurmore often than larger values.

A very primitive version of Huffman coding wouldbe this: If most of the discrepancies are in the range ±127, but an occasional one isoutside, then reserve the value 127 to mean “out of range,” and then record on the file(immediately following the 127) a full-word value of the out-of-range discrepancy.§20.4 explains how to do much better.572Chapter 13.Fourier and Spectral ApplicationsCITED REFERENCES AND FURTHER READING:Childers, D.G. (ed.) 1978, Modern Spectrum Analysis (New York: IEEE Press), especially thepaper by J. Makhoul (reprinted from Proceedings of the IEEE, vol. 63, p. 561, 1975).Burg, J.P.

1968, reprinted in Childers, 1978. [1]Anderson, N. 1974, reprinted in Childers, 1978. [2]Cressie, N. 1991, in Spatial Statistics and Digital Image Analysis (Washington: National AcademyPress). [3]Press, W.H., and Rybicki, G.B. 1992, Astrophysical Journal, vol. 398, pp. 169–176. [4]13.7 Power Spectrum Estimation by theMaximum Entropy (All Poles) MethodThe FFT is not the only way to estimate the power spectrum of a process, nor is itnecessarily the best way for all purposes.

To see how one might devise another method,let us enlarge our view for a moment, so that it includes not only real frequencies in theNyquist interval −fc < f < fc , but also the entire complex frequency plane. From thatvantage point, let us transform the complex f -plane to a new plane, called the z-transformplane or z-plane, by the relationz ≡ e2πif ∆(13.7.1)where ∆ is, as usual, the sampling interval in the time domain. Notice that the Nyquist intervalon the real axis of the f -plane maps one-to-one onto the unit circle in the complex z-plane.Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.

Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).There are many variant procedures that all fall under the rubric of LPC.• If the spectral character of the data is time-variable, then it is best notto use a single set of LP coefficients for the whole data set, but ratherto partition the data into segments, computing and storing different LPcoefficients for each segment.• If the data are really well characterized by their LP coefficients, and youcan tolerate some small amount of error, then don’t bother storing all of theresiduals.

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