C1. Digital Signal Processors 1 There a numerous websites for speech/audio signal processing and recognition on the internet. Here we have a list of some of the commonly used websites, which can be linked for tutorials, discussions, papers, example code etc. http://www.phys.unsw.edu.au/~jw/dB.html Introduction to the definition of Decibels for measuring energy/volume of speech/audio signals. http://www.phys.unsw.edu.au/~jw/hearing.html Introduction (including interactive demos) to curves of equal loudness. http://www.phys.unsw.edu.au/music/ Homepage for "Music Acoustics". http://www.phys.unsw.edu.au/~jw/musFAQ.html FAQ for "Music Acoustics". http://www.wotsit.org File formats for various kinds, including audio and music. http://www.speech.cs.cmu.edu/comp.speech/index.html FAQ for the newsgroup "Comp.Speech". http://www.bdti.com/faq/dsp_faq.htm FAQ for the news group "Comp.DSP". http://www.harmony-central.com/Effects/effects-explained.html Introduction to audio effects, including many examples. http://www.slideshare.net/fcharlot/digital-signal-processor-evolution-over-the-last-30-years 2 Introduction • • • • • • • • Why process signals digitally? Definition of a real-time application. Why use Digital Signal processing processors? What are the typical DSp algorithms? Parameters to consider when choosing a DSP processor. Main Architectural Features of DSPs DSP market Texas Instruments’ TMS320 family. 3 Why use digital signal processing? •Analog signal processing is achieved by using analogue components such as: ✓Resistors. ✓ Capacitors. ✓ Inductors. •The inherent tolerances associated with these components, temperature, voltage changes, components aging and mechanical vibrations can dramatically affect the effectiveness of the analog circuit. 4 Why use digital signal processing? With DSP it is easy to: • Change applications • Correct applications • Update applications DSP reduces: • Noise susceptibility • Chips number • Development time • Cost • Power consumption 5 Why NOT use digital signal processing? •High frequency signals cannot be processed digitally because of two reasons: ✓Analog to Digital Converters, ADC cannot work fast enough ✓The application can be too complex to be performed in real-time 6 Real-time processing • DSP processors have to perform tasks in real-time, so how do we define real-time? • The definition of real-time depends on the application • Example: a 100-tap FIR filter is performed in real-time if the DSP can perform and complete the following operation between two samples read: 7 Real-time processing •We can say that we have a real-time application if: Waiting Time ≥ 0 8 What are the typical DSP algorithms? 9 •The Sum of Products (SOP) is the key element in most DSP algorithms !!! Hardware vs. Microcode multiplication • DSP processors are optimized to perform multiplication and addition operations. • Multiplication and addition are done in hardware in one cycle. • Example: 4-bit multiply (unsigned). 10 What is special for DSP? • DSP = A class of microprocessors optimized for DSprocessing • DSP have advantage in speed, cost and energy efficiency • DSPs tend to be used for 1 program, not many programs. – Hence OSes are much simpler, there is no virtual memory or protection,.. • DSPs sometimes run hard real-time apps (computational intensive) – You must account for anything that could happen in a time slot – All possible interrupts or exceptions must be accounted for and their collective time be subtracted from the time interval (Interrupt handling: the interrupts or exceptions reduce the time for computation) – Therefore, exceptions are BAD! • DSPs have an infinite continuous data stream to process in time slots from the environment 11 (e.g. audio processing with 48 KHz sampling rate) What is special for DSP? • The “MIPS/MFLOPS” of DSPs is speed of Multiply-Accumulate (MAC) – DSP are judged by whether they can keep the multipliers busy 100% of the time. • The "SPEC" of DSPs are 4 algorithms: – – – – Inifinite Impulse Response (IIR) filters Finite Impulse Response (FIR) filters FFT, and convolvers • In DSPs, algorithms are king! – Binary compatibility not an issue • Software is not (yet) king in DSPs. – People still write in assembly language for a product to minimize the die area for ROM in the DSP chip. 12 What is special for DSP? ➢DSP architectures are molded by DSP algorithms ➢Fast Multipliers ➢Multiple Execution Units ➢Efficient Memory Access ➢Data Format ➢Efficient Zero-Overhead Looping ➢Streamlined I/O ➢Specialized Instruction Sets 13 ➢ Fast Multipliers: Main operations: multiply & add -Multiplication is one of the most common operations in signal processing (convolution, FIR/IIR filtering, FFTransforms...) -Need fast multipy-accumulate operations shift, multiply and add in a loop. Each require one or more cycle. -Need to develope special hardware for multiplication 1982- Texas Instruments(TMS32010) (in a single clock cycle) -All modern DSP processors include at least one or more “dedicated, single-cycle multiplier” or combined multiplyaccumulate unit (MAC). 14 ➢ Multiple Execution Units • Need to perform high computational tasks: - In real time - e.g. Filtering signals in 10-100KHz sampling rate in real time • Several independent execution units required - Should operate in parallel - e.g. Arithmetic Logic Unit (ALU) and a shifter in parallel to MAC units 15 ➢ Efficient Memory Access Executing a MAC in a single cycle means: → Fetching the MAC instruction in a single cycle → Fetching a data sample in a single cycle → Fetching a filter coefficient in a single cycle So, good performance requires high memory bandwidth! Commonly used approach: - Use two or more separate memory banks: -Each have its own bus -Each could be read or written during every cycle 16 ➢ Efficient Memory Access More optimized DSP processors General purpose processors SISD (von Neumann) Bus OR HARVARD Early DSP processors HARVARD modified 17 ➢ High memory bandwidth requirement ❑ Support via dedicated hardware for calculating memory addresses: → Address Generation Units ❑ In DSP algorithms memory access is very predictable • E.g: FIR filter: coefficients accessed sequentially ❑ Use: 1. Register indirect addressing with post increment ➢ Increment address pointer where repetitive computations are performed on a series of data. 2. Circular Addressing ➢ Allows processor to access data sequentially and then automatically wrap around to the beginning address 18 ➢ Data Format ✓ DSP algorithms generally use floating point formats ✓ Fixed point processors: ➢ Cheaper and less power consuming ✓ Floating point formats require more complex hardware ✓ Use shortest data word width that will provide adequate accuracy ➢ Consider the cost & energy consumption 19 ➢ Data Format: • Most fixed point DSP processors use 16 bit data words. – Sufficient for many applications • Some use 20, 24 or 32 bit data word for better accuracy • Most DSP processors include one or more accumulator regs • Accumulator Registers: – wider than other registers – Provide extra guard bits to avoid overflow 20 ➢ Efficient Zero Overhead Looping • DSP algorithms have many loops: – Use efficient looping • Special loop: Zero Overhead Looping – No loop counter – No branching back to the top of the loop 21 ➢ Streamlined I/O: • Specialized serial or parallel I/O interfaces • Streamlined I/O handling mechanisms • E.g.: - Low overhead interrupts - Direct memory access, DMA. – Synchronous serial ports – Parallel ports – Timers – On-chip A/D, D/A – converters – Host ports – Bit I/O ports – On-chip DMA controller – Clock generators – On-chip peripherals often designed for – “background” operation, even when core is powered down. 22 ➢ Specialized Instruction Sets • Two goals in instruction sets: 1. Make maximum use of hardware, increase efficiency • Programmer can specify parallel operations in single inst.s 2. Minimize memory space required to store DSP programs. (Memory is a cost!) • Keep inst.s short. → Use mode bits rather than encoding → Restrict operations to specific registers → Restrict operation combinations in the inst. • This makes DSP instructions complicated!! 23 ➢ Specialized Instruction Sets: • • • DSPs aren’t usually programmed in HLL: C,C++..etc Program optimization is essential – Programmer should optimize code in assembly level More easier inst. set, more desirable it is for programmer. 24 Applications Development 25 Choosing a DSP Processor • The right DSP depends on the application; a good choice for one application might be a poor choice for another. • Some useful criteria for choosing a DSP are: - arithmetic format - data width - speed - memory organization - ease of development - multiprocessor support - power consumption - cost 26 Main Architectural Features of DSPs - Data path configured for DSP • Fixed-point arithmetic • MAC- Multiply-accumulate - Multiple memory banks and buses • Harvard Architecture • Multiple data memories blocks - Specialized addressing modes • Bit-reversed addressing • Circular buffers - Specialized instruction set and execution control • Zero-overhead loops • Support for MAC - Specialized peripherals for DSP 27 28 29 30 Compound Annual Growth Rate = CAGR 31 Different Needs? Multiple Families! ’C6000 (’C62x, ’C67x) ’C5000 ‘C3x ‘C4x ‘C8x (’C54x) ‘C5x ’C2000 (’C20x,’C24x) ‘C1x ‘C2x • Comm Infrastructure Best MIPS per: Watt / Dollar/ Size • Wireless Telephones Lowest Cost Control Systems •Storage Maximum Performance Multi-Channel / Function • xDSL • Imaging, Video • Modems / Telephony • VoIP •Motor Control 33 34 35 36 • Architectures for developing DSp applications – – – – – ASIC (Application Specific IC) FPGA (Field Programmable Gate Array ) ASSP (Application-specific standard products ) GPP (General purpose processors) DSP 37 DSP Application – Mobile Phone 38 39