| Motore di ricerca datesheet componenti elettronici |
|
RM0020 Scheda tecnica(PDF) 56 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
RM0020 Scheda tecnica(HTML) 56 Page - STMicroelectronics |
|
56 / 69 page ![]() Function API RM0020 56/69 Description: Computes the second-order IIR filter on frac16 data. The input samples are stored in the array x, output samples are written to the array y. The filter coefficients are stored in the array c divided by 2. There is used the arithmetic with saturation so the output will never overflow. Algorithm: Equation 51 for each n from 0 to N-1 Note: The routine requires these conditions are met: -1 =< b1/2-a1*b0/2 < 1 -1 =< b2/2-a1*b1/2 < 1 -1 =< -a1*b2/2 < 1 -1 =< a2/2-a1*a1/2 < 1 -1 =< -a1*a2/2 < 1 Performance: See Section 7 and Table 61. Example 30. iir_frac16_2nd_hc #include "libdsp2.h" /* #pragma and ALIGN macros used to align to 4 bytes */ #ifdef __ghs__ #pragma alignvar (4) #endif ALIGN_DCC(4) short x[256] ALIGN_MWERKS(4); #ifdef __ghs__ #pragma alignvar (4) #endif ALIGN_DCC(4) short y[256] ALIGN_MWERKS(4); Table 30. iir_frac16_2nd_hc arguments(1) 1. The x,y,c,s data are in fractional 16-bit format in range -1 to 1. The arrays x,y,s must be word aligned, the array c must be half-word aligned (implicit alignment of short data). There must be 4 bytes of readable memory behind the array x. There are returned new values of x(-2), x(-1), y(-2), y(-1) in the array s to be ready for next function call. Nin number of input and output samples (N must be multiple of 4, N must be >= 8) x in array of input samples of length N, x(0) x(1) ... x(N-1) y out array of output samples of length N, y(0) y(1) ... y(N-1) cin array of filter coefficients divided by 2, c[5] = {b(0)/2, b(1)/2, b(2)/2, a(1)/2, a(2)/2} s in/out array of previous input and output values (state vector), s[4] = {x(-2), x(-1), y(-2), y(-1)} yn 2 b0 2 -----------xn b1 2 -----------xn 1 – b2 2 -----------xn 2 – a1 2 -----------yn 1 – – a2 2 -----------yn 2 – – ++ = |
|
Link URL |
| Lei ha avuto il aiuto da alldatasheet? [ DONATE ] |
Di alldatasheet | Richest di pubblicita | contatti | Privacy Policy | Collegamento alla scheda tecnica | scambio Link | Ricerca produttore All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |