1mlib_SignalDownSample_S16_Sm1e6d(i3aMLLiIbB)LibrarymFluinbc_tSiiognnsalDownSample_S16_S16(3MLIB)
2
3
4
6 mlib_SignalDownSample_S16_S16, mlib_SignalDownSample_S16S_S16S,
7 mlib_SignalDownSample_F32_F32, mlib_SignalDownSample_F32S_F32S - signal
8 downsampling
9
11 cc [ flag... ] file... -lmlib [ library... ]
12 #include <mlib.h>
13
14 mlib_status mlib_SignalDownSample_S16_S16(mlib_s16 *dst,
15 const mlib_s16 *src, mlib_s32 factor, mlib_s32 phase,
16 mlib_s32 n);
17
18
19 mlib_status mlib_SignalDownSample_S16S_S16S(mlib_s16 *dst,
20 const mlib_s16 *src, mlib_s32 factor, mlib_s32 phase,
21 mlib_s32 n);
22
23
24 mlib_status mlib_SignalDownSample_F32_F32(mlib_f32 *dst,
25 const mlib_f32 *src, mlib_s32 factor, mlib_s32 phase,
26 mlib_s32 n);
27
28
29 mlib_status mlib_SignalDownSample_F32S_F32S(mlib_f32 *dst,
30 const mlib_f32 *src, mlib_s32 factor, mlib_s32 phase,
31 mlib_s32 n);
32
33
35 Each of these functions performs downsampling.
36
37
38 For monaural signals, the following equation is used:
39
40 dst[i] = src[i*factor + phase]
41
42
43
44 where i = 0, 1, ..., (n - 1 - phase)/factor.
45
46
47 For stereo signals, the following equation is used:
48
49 dst[2*i] = src[2*(i*factor + phase)]
50 dst[2*i + 1] = src[2*(i*factor + phase) + 1]
51
52
53
54 where i = 0, 1, ..., (n - 1 - phase)/factor.
55
57 Each of the functions takes the following arguments:
58
59 dst Output signal array.
60
61
62 src Input signal array.
63
64
65 factor Factor by which to downsample. factor ≥ 1.
66
67
68 phase Parameter that determines relative position of an output
69 value, within the input signal. 0 ≤ phase < factor.
70
71
72 n Number of samples in the input signal array.
73
74
76 Each of the functions returns MLIB_SUCCESS if successful. Otherwise it
77 returns MLIB_FAILURE.
78
80 See attributes(5) for descriptions of the following attributes:
81
82
83
84
85 ┌─────────────────────────────┬─────────────────────────────┐
86 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
87 ├─────────────────────────────┼─────────────────────────────┤
88 │Interface Stability │Committed │
89 ├─────────────────────────────┼─────────────────────────────┤
90 │MT-Level │MT-Safe │
91 └─────────────────────────────┴─────────────────────────────┘
92
94 mlib_SignalUpSample_S16_S16(3MLIB), attributes(5)
95
96
97
98SunOS 5.11 2 Mar 200m7lib_SignalDownSample_S16_S16(3MLIB)