[an error occurred while processing this directive]
Про реализацию на с6000 - это Вы не у меня спрашивайте, я под Аналоги пишу. Краткое описание того, как это сделано у меня, могу прислать. Уж не знаю, найдете Вы для себя здесь что-нибудь новое... Не знаю, как текст отобразится - может, криво. (+)
(«Телесистемы»: Конференция «Цифровые сигнальные процессоры (DSP) и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено homekvn 06 февраля 2006 г. 11:49
В ответ на: Ответ на один вопросик... отправлено <font color=gray>dmyl</font> 04 февраля 2006 г. 11:39

/******************************************************************************
* *
* This is asm-realization of cascaded_biquad function using SIMD-optimized *
* code. For C-implementation see the cascade_biquad.c file *
* *
* By Victor Kalinichenko, ASK Industries GmbH, June. 2005 *
* *
* Date Modified: 05/22/00 GJO *
* 05/25/00 GJO Code verified on rev 0.1 Silicon *
* 09/19/04 JDT Ported to VDSP++ 3.5. replace .SEGMENT syntax *
* 06/??/05 VK: 1)c-interface is provided 2) block processing is added *
* *
* *
* D E S C R I P T I O N *
* *
* 1. GENERAL *
* *
* Function cascaded_biquad(...) perform passing stereo interleaved channel *
* through multicascaded biquad filter. Each cascade can be described by the *
* transfer function Wi(z): *
* *
* b0i' + b1i'*z^(-1) + b2i'*z^(-2) *
* Wi(z)= --------------------------------- = (1) *
* a0i' + a1i'*z^(-1) + a2i'*z^(-2) *
* *
* *
* b0i' 1 + b1i*z^(-1) + b2i*z^(-2) *
* = --- x ----------------------------- = (2) *
* a0i' 1 + a1i"*z^(-1) + a2i"*z^(-2) *
* *
* *
* 1 + b1i*z^(-1) + b2i*z^(-2) *
* = ki* -----------------------------, (3) *
* 1 + a1i"*z^(-1)+ a2i"*z^(-2) *
* *
* where *
* ki = b0i'/a0i'. (4) *
* *
* Let X(z) and Y(z) be z-images of input and output signals x[n] and y[n] *
* of the i-th cascade respectively. Then the following expressions are *
* true: *
* *
* Y(z) Bi(z) *
* ---- = -----, (5) *
* X(z) Ai(z) *
* *
* where *
* *
* Bi(z) = ki*[1 + b1i*z^(-1) + b2i*z^(-2)], (6) *
* *
* Ai(z) = 1 + a1i"*z^(-1)+ a2i"*z^(-2). (7) *
* *
* *
* Basing on (5) let us write:
* *
* Y(z)*[1 + a1i"*z^(-1) + a2i"*z^(-2)] = *
* *
* = X(z)*ki*[1 + b1i*z^(-1) + b2i*z^(-2)]. (8) *
* *
* Time-domain representation corresponding to (8) is: *
* *
* y[n] + a1i"*y[n-1] + a2i"*y[n-2] = *
* *
* = ki*(x[n] + b1i*x[n-1] + b2i*x[n-2]). (9) *
* *
* Transfering the second and the third item from the left part of (9) to *
* the right part we obtain: *
* *
* y[n] = -a1i"*y[n-1]-a2i"*y[n-2] + ki*(x[n]+ b1i*x[n-1]+ b2i*x[n-2]). (10) *
* *
* Or, in other form: *
* *
* y[n] = a1i*y[n-1] + a2i*y[n-2] + ki*(x[n] + b1i*x[n-1] + b2i*x[n-2]), *
* *
* where *
* *
* a1i = -a1i" = -a1i'/a0i', a2i = -a2i" = -a2i'/a0i', *
* b1i = b1i'/b0i', b2i = b2i'/b0i'. (11) *
* *
* Coefficients aKi and bKi in (11), where K = 1, 2 are called *
* n o r m a l i z e d c o e f f i c i e n t s of the multicascaded *
* biquad filter. *
* *
* Total amplification gain of each filter is equal to *
* *
* k = k1 * k2 *...* kN, *
* *
* where N - the number of cascades. k is called o v e r a l l g a i n *
* of multicascaded biquad filter. *
* *
* *
* 2. FUNCTION INTERFACE AND DESCRIPTION OF PARAMETERS *
* *
* void cascaded_biquad(const float dm *input, float dm *output, *
* float dm *states, float pm *coefs, *
* int stages, int length, float kL, float kR) *
* *
* For ADSP-21xxx (i.e. when __ADSP21000__ macro is defined) the following *
* type definitions are made in cascade_biquad_simd.h: *
* *
* typedef float dm *float_DM_ptr; *
* typedef float pm *float_PM_ptr; *
* *
* In case other DSP type definitions are the following: *
* *
* typedef float *float_DM_ptr; *
* typedef float *float_PM_ptr; *
* *
* Notes! (for ASM-optimized code in ADSP-21xxx) *
* For the pointers marked with "(dm)" data must be placed namely in *
* Data Memory; for the pointers marked with "(pm)" data must be *
* placed namely in Program Memory. *
* *
* All buffers: input, output, states and coefs must start with the *
* even address. Thus, all data related to "left" channels will *
* be placed on even addresses; "right" channel data will be placed *
* on odd addresses. *
* *
* Some restrictions are introduced in order to provide fast *
* realization of this function in assembler by means of use of SIMD-mode *
* and parallelism. C-realization also obeys these requirements to provide *
* the same interface and thus to be able to be replaced if necessary. *
* *
* input - (dm) pointer to the interleaved stereo input buffer *
* *
* output - (dm) pointer to the interleaved stereo output buffer *
* *
* states - (dm) pointer to the states (delay line) of all filters. The *
* size of this buffer must be equal to 4*N, where N is the *
* *
* coefs - (pm) pointer to the normalized coefficients of all filters *
* *
* The order is the follwing: *
* a21L, a21R, a11L, a11R, b21L, b21R, b11L, b11R, a22L, a22R,...*
* *
* Here aKiL, bKiL - normalized coefficients of *
* the multicascaded biquad filter for the "left" channel; *
* K=1,2; i=1,2,3,... - number of current cascade; *
* *
* aKiR, bKiR - normalized coefficients of *
* the multicascaded biquad filter for the "right" channel; *
* *
* stages - number of stages (cascades); *
* *
* length - length of the input buffer; *
* *
* kL - overall gain for "left" channel of the multicascaded biquad *
* filter; *
* *
* kR - overall gain for "right" channel of the multicascaded biquad *
* filter. *
* *
* *
* 3. SOME DETAILS OF REALIZATION *
* *
* In order to reduce the memory size required for delay line needed to *
* store values to be used in the next step and to decrease the calculation *
* cost another representation of biquad filter is used. To obtain this *
* form rewrite (5) in the following form: *
* *
* Bi(z) *
* Y(z) = ----- * X(z). (12) *
* Ai(z) *
* Denote *
* *
* Di(z) = X(z)/Ai(z). (13) *
* *
* Then *
* *
* Y(z) = Bi(z)*Di(z). (14) *
* *
* Let's rewrite (13) in the following way: *
* *
* Di(z)*Ai(z) = X(z). (15) *
* *
* Time-domain representation of (15) is: *
* *
* di[n] + a1i"*di[n-1] + a2i"*di[n-2] = x[n], (16) *
* *
* or in other terms, taking into account (11): *
* *
* di[n] = x[n] + a1i*di[n-1] + a2i*di[n-2]. (17) *
* *
* The appearance of time-domain representation of (14) is the following: *
* *
* y[n] = di[n] + b1i*di[n-1] + b2i*di[n-2]. (18) *
* *
* By use of (17) and (18) it is possible to allocate only two words per *
* channel per cascade for the delay line. Furthermore, it is very helpful *
* for assembler implementation because having calculated di[n] according *
* (17) and thus having loaded into registers di[n], di[n-1] and di[n-2] it *
* is not necessary to load the same values into registers for calculation *
* y[n] in (18). *
* *
******************************************************************************/


Составить ответ  |||  Конференция  |||  Архив

Ответы


Отправка ответа

Имя (обязательно): 
Пароль: 
E-mail: 
NoIX ключ Запомнить

Тема (обязательно):
Сообщение:

Ссылка на URL: 
Название ссылки: 

URL изображения: 


Rambler's Top100 Рейтинг@Mail.ru
Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание

E-mail: info@telesys.ru