Mercurial > libavcodec.hg
comparison acelp_filters.h @ 7643:cb997823ead5 libavcodec
Cleanup comment for ff_acelp_interp_filter.
author | michael |
---|---|
date | Thu, 21 Aug 2008 21:52:56 +0000 |
parents | 1fbf9b2060ce |
children | 3d5972069016 |
comparison
equal
deleted
inserted
replaced
7642:1fbf9b2060ce | 7643:cb997823ead5 |
---|---|
24 #define FFMPEG_ACELP_FILTERS_H | 24 #define FFMPEG_ACELP_FILTERS_H |
25 | 25 |
26 #include <stdint.h> | 26 #include <stdint.h> |
27 | 27 |
28 /** | 28 /** |
29 * low-pass FIR (Finite Impulse Response) filter coefficients | 29 * low-pass Finite Impulse Response filter coefficients. |
30 * | 30 * |
31 * A similar filter is named b30 in G.729. | 31 * Hamming windowed sinc filter with cutoff freq 3/40 of the sampling freq. |
32 * | 32 * This array only contains the right half of the filter. |
33 * G.729 specification says: | 33 * This filter is likely identical to the one used in G.729, though this |
34 * b30 is based on Hamming windowed sinc functions, truncated at +/-29 and | 34 * could not be determined from the original comments with certainity. |
35 * padded with zeros at +/-30 b30[30]=0. | |
36 * The filter has a cut-off frequency (-3 dB) at 3600 Hz in the oversampled | |
37 * domain. | |
38 * | |
39 * After some analysis, I found this approximation: | |
40 * | |
41 * PI * x | |
42 * Hamm(x,N) = 0.53836-0.46164*cos(--------) | |
43 * N-1 | |
44 * --- | |
45 * 2 | |
46 * | |
47 * PI * x | |
48 * Hamm'(x,k) = Hamm(x - k, 2*k+1) = 0.53836 + 0.46164*cos(--------) | |
49 * k | |
50 * | |
51 * sin(PI * x) | |
52 * Sinc(x) = ----------- (normalized sinc function) | |
53 * PI * x | |
54 * | |
55 * h(t,B) = 2 * B * Sinc(2 * B * t) (impulse response of sinc low-pass filter) | |
56 * | |
57 * b(k,B, n) = Hamm'(n, k) * h(n, B) | |
58 * | |
59 * | |
60 * 3600 | |
61 * B = ---- | |
62 * 8000 | |
63 * | |
64 * 3600 - cut-off frequency | |
65 * 8000 - sampling rate | |
66 * k - filter order | |
67 * | |
68 * ff_acelp_interp_filter[6*i+j] = b(10, 3600/8000, i+j/6) | |
69 * | |
70 * The filter assumes the following order of fractions (X - integer delay): | |
71 * | |
72 * 1/3 precision: X 1/3 2/3 X 1/3 2/3 X | |
73 * 1/6 precision: X 1/6 2/6 3/6 4/6 5/6 X 1/6 2/6 3/6 4/6 5/6 X | |
74 * | |
75 * The filter can be used for 1/3 precision, too, by | |
76 * passing 2*pitch_delay_frac as third parameter to the interpolation routine. | |
77 * | |
78 */ | 35 */ |
79 extern const int16_t ff_acelp_interp_filter[61]; | 36 extern const int16_t ff_acelp_interp_filter[61]; |
80 | 37 |
81 /** | 38 /** |
82 * Generic interpolation routine. | 39 * Generic interpolation routine. |