You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+19-12Lines changed: 19 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Overview
6
6
7
7
The XMOS Sample Rate Conversion (SRC) library provides both synchronous and asynchronous audio sample rate conversion functions for use on xCORE multicore micro-controllers.
8
8
9
-
In systems where the rate change is exactly equal to the ratio of nominal rates, synchronous sample rate conversion (SSRC) provides efficient and high performance rate conversion. Where the input and output rates are not locked by a common clock or clocked by an exact rational frequency ratio, the Asynchronous Sample Rate Converter (ASRC) provides a way of streaming high quality audio between the two different clock domains, at the cost of higher processing resource usage. ASRC can ease interfacing in cases where the are multiple digital audio inputs or allow cost saving by removing the need for physical clock recovery using a PLL.
9
+
In systems where the rate change is exactly equal to the ratio of nominal rates, synchronous sample rate conversion (SSRC) provides efficient and high performance rate conversion. Where the input and output rates are not locked by a common clock or clocked by an exact rational frequency ratio, the Asynchronous Sample Rate Converter (ASRC) provides a way of streaming high quality audio between the two different clock domains, at the cost of higher processing resource usage. ASRC can ease interfacing in cases where there are multiple digital audio inputs or allow cost saving by removing the need for physical clock recovery using a PLL.
10
10
11
11
Features
12
12
........
@@ -16,7 +16,7 @@ Multi-rate Hi-Fi functionality:
16
16
* Conversion between 44.1, 48, 88.2, 96, 176.4 and 192 KHz input and output sample rates.
17
17
* 32 bit PCM input and output data in Q1.31 signed format.
18
18
* Optional output dithering to 24 bit using Triangular Probability Density Function (TPDF).
19
-
* Optimized for xCORE-200 instruction set with dual-issue.
19
+
* Optimized for xCORE-200 instruction set with dual-issue and compatible with XCORE-AI.
20
20
* Block based processing - Minimum 4 samples input per call, must be power of 2.
21
21
* Up to 10000 ppm sample rate ratio deviation from nominal rate (ASRC only).
22
22
* Very high quality - SNR greater than 135 dB (ASRC) or 140 dB (SSRC), with THD of less than 0.0001% (reference 1KHz).
* Synchronous fixed factor of 3 downsample and oversample functions supporting either HiFi quality or reduced resource requirements for voice applications.
30
-
* Synchronous fixed factor of 3 and 3/2 downsample and oversample functions for voice applications optimised for the XS3 Vector Processing Unit.
30
+
* Synchronous fixed factor of 3 and 3/2 downsample and oversample functions for voice applications optimized for the XS3 Vector Processing Unit.
31
+
32
+
Building
33
+
........
34
+
35
+
The library can be built under `cmake` or `xcommon` via `xmake` offering backwards compatibility for legacy applications.
36
+
It is recommended to use `cmake` where the library name `lib_src` is included in the cmake files. See `Related application notes`_ for example usage.
37
+
The library has no dependencies when building under `cmake` although does require `lib_logging` and `lib_xassert` when using `xcommon`.
31
38
32
39
Components
33
40
..........
@@ -38,23 +45,23 @@ Components
38
45
* Synchronous factor of 3 downsample function (ds3)
39
46
* Synchronous factor of 3 oversample function (os3)
40
47
41
-
* Synchronous factor of 3 downsample function optimised for use with voice (src_ds3_voice)
48
+
* Synchronous factor of 3 downsample function optimized for use with voice (src_ds3_voice)
42
49
* Synchronous factor of 3 oversample function optimised for use with voice (src_us3_voice)
43
50
44
-
* Synchronous factor of 3 downsample function optimised for use with voice optimised for XS3 (src_ff3_96t_ds)
45
-
* Synchronous factor of 3 oversample function optimised for use with voice optimised for XS3 (src_ff3_96t_us)
51
+
* Synchronous factor of 3 downsample function for use with voice optimized for XS3 (ff3_96t_ds)
52
+
* Synchronous factor of 3 oversample function for use with voice optimized for XS3 (ff3_96t_us)
46
53
47
-
* Synchronous factor of 3/2 downsample function optimised for use with voice optimised for XS3 (src_rat_2_3_96t_ds)
48
-
* Synchronous factor of 3/2 oversample function optimised for use with voice optimised for XS3 (src_rat_3_2_96t_us)
54
+
* Synchronous factor of 3/2 downsample function for use with voice optimized for XS3 (rat_2_3_96t_ds)
55
+
* Synchronous factor of 3/2 oversample function for use with voice optimized for XS3 (rat_3_2_96t_us)
49
56
50
57
There are three different component options that support fixed factor of 3 up/downsampling. To help choose which one to use follow these steps:
51
58
52
-
#. If you require HiFi quality (130 dB SNR) up/downsampling, use src_ds3_voice or src_us3_voice.
53
-
#. If you require voice quality (65 dB SNR) and are using xCORE-200, use src_ds3_voice or src_us3_voice.
54
-
#. If you require voice quality (75 dB SNR) and are using xCORE-AI, use src_ff3_96t_ds or src_ff3_96t_us.
59
+
#. If HiFi quality (130 dB SNR) up/downsampling is required, use ds3 or os3.
60
+
#. If voice quality (65 dB SNR) is required running on xCORE-200, use ds3_voice or us3_voice.
61
+
#. If voice quality (75 dB SNR) is required running xcore-ai, use ff3_96t_ds or ff3_96t_us.
55
62
56
63
57
-
Related application notes
64
+
Related Application Notes
58
65
.........................
59
66
60
67
An adaptive USB Audio ASRC example can be found in https://github.com/xmos/sln_voice/tree/develop/examples.
Copy file name to clipboardExpand all lines: doc/rst/programming_guide/fixed_ratio_src.rst
+48-36Lines changed: 48 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,21 @@
1
-
Fixed factor of 3 functions
2
-
===========================
1
+
Fixed factor of 3 HiFi functions
2
+
================================
3
3
4
-
The SRC library also includes synchronous sample rate conversion functions to downsample (decimate) and oversample (upsample or interpolate) by a fixed factor of three.
4
+
Overview
5
+
--------
6
+
7
+
The SRC library includes synchronous sample rate conversion functions to downsample (decimate) and oversample (upsample or interpolate) by a fixed factor of 3.
5
8
6
9
These components offer a high quality conversion with an SNR of 130 dB.
7
10
8
-
In each case, the processing is carried out each time a single output sample is required. In the case of the decimator, three input samples passed to filter with a resulting one sample output on calling the processing function. The interpolator produces an output sample each time the processing function is called but will require a single sample to be pushed into the filter every third cycle. All samples use Q31 format (left justified signed 32b integer).
11
+
In each case, the processing is carried out each time a single output sample is required. In the case of the decimator, three input samples are passed to the filter with a resulting one sample output on calling the processing function. The interpolator produces an output sample each time the processing function is called but will require a single sample to be pushed into the filter every third cycle. All samples use Q1.31 format (left justified signed 32b integer).
9
12
10
13
Both sample rate converters are based on a 144 tap FIR filter with two sets of coefficients available, depending on application requirements:
11
14
12
-
* firos3_b_144.dat / firds3_b_144.dat - These filters have 20dB of attenuation at the nyquist frequency and a higher cutoff frequency
13
-
* firos3_144.dat / firds3_144.dat - These filters have 60dB of attenuation at the nyquist frequency but trade this off with a lower cutoff frequency
15
+
* firos3_b_144.dat / firds3_b_144.dat - These filters have 20 dB of attenuation at the Nyquist frequency and a higher cutoff frequency
16
+
* firos3_144.dat / firds3_144.dat - These filters have 60 dB of attenuation at the Nyquist frequency but trade this off with a lower cutoff frequency
14
17
15
-
The default setting is to use the 60dB of attenuation at the nyquist frequency coefficients.
18
+
The default setting is to use the coefficients that provide 60 dB of attenuation at the Nyquist frequency.
16
19
17
20
The filter coefficients may be selected by adjusting the line::
18
21
@@ -24,18 +27,18 @@ and::
24
27
25
28
in the files ``src_ff3_os3.h`` (API for oversampling) and ``src_ff3_ds3.h`` (API for downsampling) respectively.
26
29
27
-
The OS3 processing takes up to 153 core cycles to compute a sample which translates to 1.53us at 100MHz or 2.448us at 62.5MHz core speed. This permits up to 8 channels of 16 kHz -> 48 kHz sample rate conversion in a single 62.5MHz core.
30
+
The OS3 processing takes up to 153 core cycles to compute a sample which translates to 1.53 :math:`{\mu}s` at 100 MHz or 2.448 :math:`{\mu}s` at 62.5 MHz core speed. This permits up to 8 channels of 16 kHz -> 48 kHz sample rate conversion in a single 62.5MHz core.
28
31
29
-
The DS3 processing takes up to 389 core cycles to compute a sample which translates to 3.89us at 100MHz or 6.224us at 62.5MHz core speed. This permits up to 9 channels of 48 kHz -> 16 kHz sample rate conversion in a single 62.5MHz core.
32
+
The DS3 processing takes up to 389 core cycles to compute a sample which translates to 3.89 :math:`{\mu}s` at 100 MHz or 6.224 :math:`{\mu}s` at 62.5 MHz core speed. This permits up to 9 channels of 48 kHz -> 16 kHz sample rate conversion in a single 62.5MHz core.
30
33
31
-
Both downsample and oversample functions return ``ERROR`` or ``NOERROR`` status codes as defined in return codes enums listed below. The only way these functions can error is if the passed `delay_base` structure member has been uninitialised and is NULL.
34
+
Both downsample and oversample functions return ``ERROR`` or ``NO_ERROR`` status codes as defined in the return code enums listed below. The only way these functions can error is if the passed `delay_base` structure member is uninitialized (NULL).
32
35
33
-
The down sampling functions return the following error codes ::
36
+
The downsampling functions return the following error codes ::
34
37
35
38
FIRDS3_NO_ERROR
36
39
FIRDS3_ERROR
37
40
38
-
The up sampling functions return the following error codes ::
41
+
The upsampling functions return the following error codes ::
39
42
40
43
FIROS3_NO_ERROR
41
44
FIROS3_ERROR
@@ -70,15 +73,17 @@ OS3 API
70
73
.. doxygenfunction:: src_os3_proc
71
74
72
75
73
-
Fixed factor of 3 functions optimised for use with voice
76
+
Fixed factor of 3 functions optimized for use with voice
A pair of SRC components supporting up and down coversion by a factor of 3 are provided that are suitable for voice applications. They provide voice quality SNR (around 60 dB),
77
-
use a 72 tap Remez FIR filter and are optimised for the XS2 instruction set.
79
+
Overview
80
+
--------
81
+
82
+
A pair of SRC components supporting upconversion and downconversion by a factor of 3 are provided that are suitable for voice applications. They provide voice quality SNR (around 60 dB) and use a 72 tap Remez FIR filter and are optimized for the XS2 instruction set.
78
83
79
84
80
85
.. warning::
81
-
These SRC components have been deprecated. For new designs using xCORE-AI, please use the XS3 optimised components which provide both much better performance and use approximately half of the MIPS.
86
+
These SRC components have been deprecated. For new designs using XCORE-AI, please use the XS3 optimized components which provide both much better performance and use approximately half of the MIPS. See `ff3_voice_vpu_hdr`_
A set of SRC components are provided which are optimised for the Vector Processing Unit (VPU) and are suitable for voice applications.
115
+
A set of SRC components are provided which are optimized for the Vector Processing Unit (VPU) and are suitable for voice applications.
108
116
The fixed factor of 3 SRC components are designed for conversion between 48 kHz to 16 kHz and the fixed factor of 3/2 are designed for conversion between 48 kHz and 32 kHz.
109
117
110
-
They have been designed for voice applications and, in particular, conformance to the MS Teams specification.
118
+
They have been designed for voice applications and, in particular, conformance to the MS Teams v5 specification.
111
119
112
120
113
121
.. note::
114
-
These filters will only run on xCORE-AI due to the inner dot product calculation employing the XS3 VPU.
115
-
122
+
These filters will only run on XCORE-AI due to the inner dot product calculation employing the XS3 VPU.
116
123
124
+
.. _ff3_voice_vpu_hdr:
117
125
Fixed factor of 3 VPU
118
126
---------------------
119
127
120
128
The filters use less than half of the cycles of the previous fixed factor of 3 functions but at the same time offer a much improved
121
129
filter response thanks to an increased filter length of 96 taps (compared with 72 taps) and use of a Kaiser window with a beta of 4.0.
130
+
The filter specification is shown in :numref:`src_ff3_vpu_filter`.
122
131
123
-
132
+
.. _src_ff3_vpu_filter:
124
133
.. list-table:: Fixed Factor of 3 Voice VPU SRC characteristics
125
-
:header-rows: 1
134
+
:header-rows: 1
126
135
127
136
* - Filter
128
137
- CPU cycles
@@ -136,25 +145,26 @@ filter response thanks to an increased filter length of 96 taps (compared with 7
136
145
- 0.475
137
146
- 0.525
138
147
- 0.01 dB
139
-
- 70 dB
148
+
- 70 dB min
140
149
- 96
141
150
* - src_ff3_96t_us
142
151
- 85
143
152
- 0.475
144
153
- 0.525
145
154
- 0.01 dB
146
-
- 70 dB
155
+
- 70 dB min
147
156
- 96
148
157
149
-
The fixed factor of three components produce three samples for each call passing one sample in the case of upsampling and produce a single sample for each call passing three samples in the case of downsampling.
150
-
All input and output samples are signed 32 bit integers.
151
-
158
+
The fixed factor of 3 components produce three samples for each call passing one sample in the case of upsampling and produce a single sample for each call passing three samples in the case of downsampling.
159
+
All input and output samples are signed 32 bit integers. The filter characteristics are shown in :numref:`src_ff3_vpu` and :numref:`src_ff3_vpu_pb`.
152
160
161
+
.. _src_ff3_vpu:
153
162
.. figure:: images/src_ff3_vpu.png
154
163
:width:80%
155
164
156
165
Fixed Factor of 3 Voice VPU SRC filter response
157
166
167
+
.. _src_ff3_vpu_pb:
158
168
.. figure:: images/src_ff3_vpu_pb.png
159
169
:width:80%
160
170
@@ -177,11 +187,11 @@ Voice US3 API
177
187
Fixed factor of 3/2 VPU
178
188
-----------------------
179
189
180
-
The fixed factor of 3/2 VPU sample rate converts use a rational factor polyphase architecture to achieve the non-integer rate ratio. Downsampling takes two phases while upsampling takes three. The filters have been designed with a Kaiser window with a beta of 3.2.
181
-
190
+
The fixed factor of 3/2 VPU sample rate converts use a rational factor polyphase architecture to achieve the non-integer rate ratio. Downsampling takes two phases while upsampling takes three. The filters have been designed with a Kaiser window with a beta of 3.2. The filter specification is shown in :numref:`src_ff3_2_vpu_filter`.
182
191
192
+
.. _src_ff3_2_vpu_filter:
183
193
.. list-table:: Fixed Factor of 3/2 Voice VPU SRC characteristics
184
-
:header-rows: 1
194
+
:header-rows: 1
185
195
186
196
* - Filter
187
197
- CPU cycles
@@ -205,29 +215,31 @@ The fixed factor of 3/2 VPU sample rate converts use a rational factor polyphase
205
215
- 70 dB
206
216
- 96
207
217
208
-
The fixed factor of 3/2 components produce three samples for each call passing two samples in the case of upsampling and produce a two samples for each call passing three samples in the case of downsampling.
209
-
All input and output samples are signed 32 bit integers.
218
+
The fixed factor of 3/2 components produce three samples for each call passing two samples in the case of upsampling and produce two samples for each call passing three samples in the case of downsampling.
219
+
All input and output samples are signed 32 bit integers. The filter characteristics are shown in :numref:`src_ff3_2_vpu` and :numref:`src_ff3_2_vpu_pb`.
0 commit comments