User login
Business Codes
DUNS: 16-498-2238
Cage Code: 5YVN2
NAICS Codes: 541330, 541511, 541512, 541519, 611420
Search
What is a DSP Library?
What is a DSP Library?
A Digital Signal Processing (DSP) Library is a collection of mathematical functions targeted towards digital signal processing applications. This differs from a math and scientific libraries in the following ways:
- Performance: Math and scientific libraries emphasize accuracy over performance. A real-time DSP library emphasizes performance (GFLOPS) over accuracy. The result is often a several-fold improvement in performance.
- Accuracy: Math and scientific libraries often compute doubleprecision results. With most DSP applications, the input data is the result of a physical measurement process that typically provides between 12 and 16 bits of accuracy. Single-precision floating point provides 24 bits of mantissa, which is more than adequate for most DSP applications. The increased dynamic range of floating point over fixed point provides extended dynamic range and simplifies many DSP algorithms.
- Function Selection: Many functions are common between DSP and scientific libraries: sqrt, cos, atan2, for example. However, DSP libraries contain additional functions: Fast Fourier and other transforms, filter algorithms, convolution and correlation functions, etc. DSP functions often operate on complex data as well as real data.
- Vector Orientation: Signal processing algorithms often operate on a stream of data represented a time sequence of discrete samples. Therefore, most DSP functions operate on vectors or arrays rather than scalar functions.
- Error Handling: Overflow or underflow within a scientific library may generate an exception, allowing the application designer to report and possibly correct data values. Overflow or underflow within DSP libraries generally results in saturation values and not exceptions:
processing continues in real-time.
A DSP library designed for real-time embedded systems is designed to provide high-speed computation, allowing it to keep up with real-time input data streams. The library provides this performance by taking advantage of the best performance features of the target processor. VectorZ provides high performance by taking advantage of the target processor’s SIMD (single instruction, multiple data) instruction set. The ability for the library to operate within an application and require little or no operating system interaction allows the library functions to be embedded within target applications.
Do I need a DSP Library?
Your application may not need a high-performance DSP library. These questions may arise when considering a DSP library:
Can the same level of performance be achieved using careful coding, a good compiler, and optimization flags?
The VectorZ are typically 8 to 20 times faster than the equivalent C code, even when C code is fully optimized. This performance is achieved through using the best set of SIMD instructions to compute results to single-precision accuracy. See the performance data at the end of this document.
Since the target machine has SIMD instructions, why can’t a compiler generate code using SIMD instructions?
Most SIMD instructions often have very peculiar alignment and length restrictions. For the PowerPC SIMD instructions, memory objects must be aligned to 16-byte boundaries, and have a length that is a multiple of 16 bytes. If these conditions are not met, additional instructions are needed to load, store, and possibly shift the data into place. A simple loop to add two floating-point vectors must handle arbitrary operand alignment and length since applications cannot always guarantee “SIMD-aligned” data. Because the detection of alignment and lengths cannot always be done at compile time, these details are best handled in a library, rather than having the compiler generate code to handle all possible alignments for all loops.
Since internally the target machine does everything in double-precision anyway, are single-precision DSP functions really any faster than double precision functions?
If the VectorZ functions relied solely on standard math library functions, the library would offer little or no performance improvement over applications that loop over array data. But VectorZ functions are tuned to provide single-precision results using the best combination of instructions. The result is a significant increase in performance.
Can’t we accomplish the same thing as a DSP library by using the Clanguage SIMD extensions?
This is a viable option, but it is not for everyone. Development using these extensions takes additional development time and some expertise. Source code becomes non-portable and machine-specific. Compiler optimization of SIMD extensions may not be as effective as hand-coded assembly used within the library functions.
Purchasing a high performance library, rather than developing it inhouse, may be the best option. Through use of a vector library, applications enjoy the best performance offered by the processor, while application source code remains portable.
Won’t ever-increasing processor speeds eliminate the need for DSP libraries?
There has always been a need for more processing performance. Processor speeds continue to increase, but so do A/D and D/A sample rates, resulting in a corresponding need for greater processor performance.
Recent processor speed improvements have also introduced greater pipeline latencies.2 As a result, a simple loop that adds two vectors may require more execution time on a “faster” processor because of additional pipeline stages in the faster processor. VectorZ overcomes this through loop unrolling, interleaving, and careful instruction scheduling.
If the processor can’t use SIMD instructions unless the data is aligned, and my application has unaligned data, does the library still offer an advantage?
A good library will “abstract away” the architectural dependencies imposed by the SIMD instruction sets. VectorZ uses several methods to apply SIMD instructions to unaligned data. These require a very small percentage of additional execution time when the vector operands are not ideally aligned.
VectorZ Design Goals
VectorZ is designed with the following objectives:
1. Superior Single-Precision Performance: VectorZ offers extremely fast single-precision computation. See the performance data at the end of this document for comparisons.
2. Ease of Use: Some libraries provide different functions for different data types. With VectorZ, the vAdd function adds two vectors or matrices, whether they are real, complex, or a combination of real and complex. This approach results in fewer coding rules, fewer functions to remember, less need to search the manual for the right form of the function you need, and more readable code. This in turn translates into reduced development time and fewer opportunities for coding errors.
3. Function Set Tailored to DSP Applications: Standard math libraries rarely contain vector functions. Scientific libraries often emphasize a wide set of functions, but may be weak in areas such as data conversion, filters, and other DSP-specific functions. VectorZ is designed by DSP engineers for embedded DSP applications.
4. Complete Set of Data Conversion Functions. Whether the I/O data is fixed or float, real or complex, interleaved or separate I&Q, big endian or little endian, VectorZ can process it. VectorZ can even accept and generate companded data.
5. OS Independence: VectorZ is not tied to a specific board or operating system. Thinking about switching vendors? Need to support a variety of boards and processors? VectorZ is the solution.
6. Reasonable Run-Time Error Checking: Array-based functions cannot detect when the resulting vector overruns the bounds of the result array. VectorZ detects this and prevents it from occurring with almost no additional overhead. Applications have control over all error
handling and reporting actions.
7. Abstraction of SIMD Alignment and Length Restrictions. Applications are not aware of any length or alignment restrictions. Vector and matrix data is are automatically allocated and aligned to the proper boundaries. Even when data is unaligned, vector functions properly
operate on the data using SIMD instructions. VectorZ provides the performance afforded by SIMD instructions while hiding the restrictions imposed by SIMD instructions.
