Pyramic array An FPGA based platform for many-channel audio acquisition Juan Azcarreta Ortiz Presented the 24 August 2016 at Laboratory of Processors Architecture (LAP) and Laboratory of Audiovisual Communications (LCAV) École Polytechnique Fédérale de Lausanne to obtain the Master’s degree in Electronics Engineering by Juan Azcarreta Ortiz suppervised by: Prof René Beuchat, supervisor LAP Robin Scheibler, supervisor LCAV Prof Ramon Bragos, supervisor UPC Lausanne, EPFL, 2016
"Microphones are to audio, what colors are to painting." — Stanley R. Alten To my family...
Acknowledgements First of all, I want to thank my supervisors, René Beuchat, expert professor at LAP and Robin Scheibler, PHD student at LCAV. Thanks for all your patiente and support, merci René for all the patiente and your help during the design, testing and building of the project. Thanks Robin for your great support and availability. I appreciate the interesting conversations sharing ideas we had during the project, arigatou. Special mention to my college, Sahand, who reviewed my project and helped a lot during design considerations. Without you this project would have not been the same, I am sure you will have a great success developing embeddeded systems. Thanks to Eric Bezzam and Balási Szabolcs, which collaborated in the project adding advanced knowledge and great times to it. Thanks to all of you. I would like to thank UPC for giving me the chance to spend one year abroad at EPFL. Specially thanks to my supervisor, Ramón Bragos. Thanks to them, I was able to achieve my goal of performing my Master Thesis at EPFL. I am greateful to my friends and colleagues I met during my Master and Bachelors at EPFL, UPC, University of Navarra and Cal Poly. Thanks to all the international friends I made during this period. I hope to see you again soon. Last but not least, I want to thank my family, specially to my parents. They have always supported me, especially in the difficult times, thanks for your unconditional love and support. i
Abstract Microphone arrays techniques present compelling applications for robotic applications. Those techniques can allow robots to listen to their environment and infer clues from it. Such features might enable capabilities such as natural interaction with humans, interpreting spoken commands or the localization of victims during search and rescue tasks. However, under noisy conditions robotic implementations of microphone arrays might degrade their precision when localizing sound sources. For practical applications, human hearing still leaves behind microphone arrays. Daniel Kisch is an example of how humans are able to efficiently perform echo-localization to recognize their environment, even in noisy and reverberant environments. For ubiquitous computing, another limitation of acoustic localization algorithms is within their capabilities of performing real-time Digital Signal Processing (DSP) operations. To tackle those problems, tradeoffs between size, weight, cost and power consumption compromise the design of acoustic sensors for practical applications. This works presents the design and operation of a large microphone array for DSP applications in realistic environments. To address those problems this project introduces the Pyramic sound capture system designed at LAP in EPFL. Pyramic is a custom hardware which possesses 48 microphones distributed in the edges of a tetrahedron. The microphone arrays interact with a Terasic DE1-SoC board from Altera Cyclone V family devices, which combines a Hard Processor System (HPS) and a Field Programmable Gate Array (FPGA) in the same die. The HPS part integrates a dualcore ARM-based Cortex-A9 processor, which combined with the power of FPGA design suitable for processing multichannel microphone signals. This thesis explains the implementation of the Pyramic array. Moreover, FPGA-based hardware accelerators have been designed to implement a Master SPI communication with the array and a parallel 48 channels FIR filters cascade of the audio data for delay-and-sum beamforming applications. Additionally, the configuration of the HPS part allows the Pyramic array to be controlled through a Linux based OS. The main purpose of the project is to develop a flexible platform in which real-time echo-location algorithms can be implemented. The effectiveness of the Pyramic array design is illustrated by testing the recorded data with offline direction of arrival algorithms developed at LCAV in EPFL. Key words : FPGA, HPS, microphone arrays, Altera Cyclone V, DE1-SoC, real-time DSP, beamforming, FIR filters. iii
Contents Abstract (English/Français/Deutsch) iii List of figures ix List of tables xi 1 Introduction 1 1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.3 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.4 Structure of the thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2 Microphone arrays sound capturing systems 5 2.1 Acoustic Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.1 Noise Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.2 Speech Signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.2 Microphone arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2.1 Types of microphone arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.3 Sound Capture model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.3.1 Coordinate system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.3.2 Far-field Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.3.3 Spatial Aliasing and Ambiguity . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3 Pyramic Microphone array 13 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2 Digital Signal Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.3 Pyramic Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.3.2 Pyramic array layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.3.3 INMP504 microphone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.3.4 Signal conditioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.3.5 AD7606 Analog to Digital Converter . . . . . . . . . . . . . . . . . . . . . . 17 3.3.6 Timing requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 v
1Introduction 1.1 Motivation Nowadays, listening and localizing sound sources is crucial in applications where the direction to the desired sound source is unknown. Apart of the number of available microphones to capture the audio signals, the precision of localization can be affected by the ambient noise and reverberation conditions. This work presents the design, test, and operation of the Pyramic array, a large microphone array for real-time acoustic DSP applications. The proposed design is based on a new generation of digital microelectromechanical (MEMS) microphones. An Altera field-programmable gate array (FPGA) interfaces up to 48 such microphones to obtain samples representing the sound pressure and processes them using a cascade of FIR filters. Moreover, the data is stored and sent through the network to local storage, which can be used to perform offline beamforming algorithms. Thanks to recent MEMS microphones in conjunction with reconfigurable logic, Pyramic array is a modular system which tackles ubiquitous computing for multi-channel audio applications. The system optimizes the trade-off between weight, size, power consumption and cost constraints of robotic systems for real-time audio applications. 1.2 Objective The aim of the project is to build a novel 48 microphones modular array architecture called the Pyramic array. The system acquires multi-channel audio samples through a parallel SPI master to a host Altera Cyclone V device, which combines a Field Programmable Gate Array (FPGA) and an ARM-9 Hardcore Processor (HPS). The data is processed in real time by hardware accelerators FIR filters which implement a delay-and-sum beamformer. The ARM-9 processor runs on a Ubuntu Core 14.04.4 operating system. The board has internet access thanks to an Ethernet port connection. Moreover, direction of arrival algorithms are tested offline in order 1
Chapter 1. Introduction to evaluate the reliability of the acquired audio data. 1.3 Contributions In order to achieve our goals, we implemented the following solutions: • A modular system with 6 linear arrays of 8 microphones each, which composes a total of 48 microphones distributed in the edges of a tetrahedron. Each array samples 8 audio channels in parallel through an ADC at 48 kHz and 16 bits resolution. • A parallel SPI communication between the microphones arrays and an FPGA platform from Altera’s Cyclone V family. • An interface between the FPGA and a 925 MHz ARM-9 processor located in the Hard Processor System (HPS) of the Altera DE1-SoC board. The system runs on a Linux based operating system. • A parallel bank of hardware accelerators FIR filters which allows real time processing of the microphones data for real-time beamforming applications. • An Ethernet communication between the DE1-SoC host device and the Pyramic array, which allows internet sharing and control of the system through a WebServer. • A test of the acquired data by applying offline processing algorithms using the direction of arrival algorithms developed at LCAV. 1.4 Structure of the thesis The first main part of the thesis is composed by Chapters 2 and 3. Chapter 2 presents the main challenges of processing audio with microphone arrays. For those purposes, different array configurations are introcuded. Chapter 3 explains the hardware used to build the Pyramic microphones array, which is a custom hardware of 48 microphone array placed on the sides of a tetrahedron. The second part of the project is focused on embedded systems design for real-time applications and it is formed by Chapters 4, 5 and 6. Chapter 4 introduces FPGA technologies and explains Altera’s Cyclone V family DE1-SoC system, which has been chosen as a processing unit for this project. Chapter 5 details the SPI communication and FIR filters Programmable Interfaces(PI) designed in the FPGA part of the DE1-SoC. Chapter 6 describes the HPS part of the DE1-SoC device and how it communicates with the FPGA side to receive the data from the Pyramic array. Moreover, we will explain how the recorded data is stored and how the user can interface with the microphone array through 2
1.4. Structure of the thesis a WebServer, ssh and scp communication. Chapter 6 displays the results of different tests performed with the Pyramic system. Finally, offline beamforming algorithms developed at LCAV have been tested to analyze the reliability of the recorded data. To conclude, the last part of the thesis summarizes the realized work and anticipates the future directions in which the project can be continued. 3
2Microphone arrays sound capturing systems In this chapter we will review the basis of sound capture and processing systems, emphasizing into microphone arrays applications. First, we will describe some areas in which speech enhancement algorithms might be critical. For those purposes, it is crucial to understand the behavior of noise. Then, the main approaches and geometries behind microphone arrays implementations will be explained [21]. 2.1 Acoustic Noise Captured sound is a mixture of wanted and unwanted signals. The speech we want to capture is the wanted signal, while unwanted signals include other speech signals, reverberation, and what in general we call noise. Noise sources usually degrade the desired signal, and might be correlated or uncorrelated to it. Consequently, prior to designing algorithms to combat the "enemy", we need to understand its properties and nature, the nature of noise. 2.1.1 Noise Sources Wherever we go we are surrounded by noise. Listening to the environment is an exercise of realizing the way in which background noise affects our daily lives. For instance, cars passing by, PC fans noise, engine noise and people talking in nearby tables are some examples of common noise sources. Fortunately, the human brain is able to compensate this noise and even infer clues about the environment from it. However, this occurs below a certain noise level threshold, which depends on the environmental conditions and above which the perceived noise becomes annoying. An objective metric to benchmark audio intelligibility is the Signal-to-Noise-Ratio (SNR), which is defined as the ratio of the desired signal and noise energies and is usually measured in the logarithmic scale of Decibel (Db) [16]. In order to understand this double-edged nature of noise, it is important to recover its spectral and temporal characteristics and understand how it can affect the desired signal. Noise can be stationary, i.e., remains unchanged over time, such as the fan noise coming 5
Chapter 2. Microphone arrays sound capturing systems Figure 2.1 – Top panel shows noise from a car, and the bottom panel shows its long-term average spectrum. [16, p. 3]. from PCs, or nonstationary, such as restaurant noise, i.e., multiple people speaking in the background. Figure 2.1 and 2.2 display time waveform examples of a car engine and restaurant noise respectively, along with its corresponding long-term average spectra. The difference between stationary (car engine noise) and non-stationary (restaurant noise) is clearer in the frequency domain than in the time domain representation. While for the car noise most of the energy is concentrated in the low frequencies, restaurant noise is more broadband as it occupies a wider frequency range. Sound Pressure Level (SPL) is presented as a common metric to measure the relative sound pressure in reference to 20 µ Pa, which corresponds to the barely audible pressure level for an average listener. Thanks to SPL, a compreshensive analysis and measurement of speech and noise levels in real-world evironments can be done. In the same manner as the SNR, it is expressed in decibels(dB): ASPL =20log10 µP Pre f ¶.(2.1) 6
2.1. Acoustic Noise Figure 2.2 – Top pannel shows noise from a restaurant, and the bottom panel shows its longterm average spectrum. [16, p. 4]. 2.1.2 Speech Signal In this section, we will describe the wanted part of the mixture of sounds captured from the microphone, i.e., a signal. In the context of this project by signal, we will mean human speech. Despite the fact that in the signal processing domain human speech is a complex signal, it can be characterized in the following segments [21]: • Voiced segments are characterized by their fundamental frequency, called "pitch" and its harmonics. For instance, for male voices, the pitch frequencies vary from 50 to 250 Hz, while for female voices it ranges between 120 to 500 Hz. • Unvoiced segments might take place simultaneously with voiced segment. However, those segments are noise-like, usually characterized by the shape of their spectral envelope. • Silence segments are used to separate words and phonemes and are an integral part of human speech. 7
Chapter 2. Microphone arrays sound capturing systems 2.2 Microphone arrays Microphone arrays take advantage of multipath propagation, in which multipath components are added coherently in order to increase the effective signal-to-noise (SNR) ratio. This concept is inspired in antenna arrays for directional radio transmission and receiving applications, which have been developed since World War I. Initially, sensor arrays were extensively developed as a tool for radar-based tracking of objects [19]. Therefore, the initial steps were based on established working algorithms from antenna arrays. However, with those first attempts, non-negligible differences between antenna and microphone arrays became visible. Comparing with electromagnetic waves, sound is an extremely wideband signal, ranging from 20 Hz to 20 kHz. In addition, construction constraints limit the size of the microphone array - for instance, the length of the upper bezel of the laptop screen where we want to integrate the microphone array. Moreover, the performance of microphone arrays can be limited by microphone’s self-noise described in Section 2.1.1. The microphone parameters manufacturing variations are higher than the ones of a passive antenna. Computing power is another limiting factor for microphones array, which constrains the amount of microphones that can be placed on the array, especially for real-time applications. In despite of all the challenges, microphone arrays have been extensively developed for applications such as room shape recognition [ 14 ] and direction of arrival (DoA) [ 15 ] detection. Moreover, microphone array architectures can be a suitable solution for speech enhancement and noise suppression applications. Till the moment, the largest planar array developed is the LOUD array at MIT [ 10 ] composed of 1024 microphone transducers. However, we believe placing fewer numbers of microphones in a 3D arrangement can be more efficient localizing sound sources. [ 12 ] starts combining microphone arrays with FPGA architectures, showing promising results for real-time application. 2.2.1 Types of microphone arrays Linear microphone Arrays In this configuration microphones are positioned in one line, therefore the work area of these arrays is a half plane. It cannot be distinguished sound waves arriving under the same body angle to the microphone array axis, which forms what is known as the "cone of uncertainty". This occurs due to the fact that under these circumstances the sound wave reaches the microphones in the same order and with the same delay. The work area is usually in the range of ± 45 º from the line perpendicular to the microphone array axis. These arrays can change the listening direction to capture the voices of several people, or to track the movements of one of them. The number of microphones varies from one to eight, but it is typically two or four. 8
2.2. Microphone arrays Figure 2.3 – LOUD 1020-microphone array developed at MIT [10] Figure 2.4 – Linear microphone array [21, p. 171] Circular microphone arrays The microphones are positioned in a circle and they work mainly in one plane. They can change listening direction slightly above the plane of the circle. For those reasons, they are typically placed in the center of conference room tables. Planar microphone arrays Those microphones are positioned in one plane. The desired sound sources are usually towards the direction perpendicular to the microphone array plane. Those arrays can be mounted on the wall or on the ceiling of a conference room and can capture sound sources in a half sphere. [10] enters in this category of microphone arrays. 9
Chapter 3. Pyramic Microphone array Figure 3.3 – 3-D representation of a single array PCB, bearing eight microphone channels. components of the array. The microphones distribution in each board is displayed in Figure 3.4. The distance between microphones has been calculated in order to attain the highest frequency resolution and avoid spatial aliasing (Section 2.3.3). On the one hand, the shortest distance between two microphones is 8 mm, according with Equation 2.6 the f max recorded without spatial ambiguity is equal to 42,5 KHz. On the other hand, the maximum distance is 200 mm, corresponding to a f max of 1,7 KHz. Therefore, with this logarithmic microphone distribution the system is able to span a wide frequency range while maintaining a reasonable size for the microphone array design. Figure 3.4 – Eight mics placement in one Pyramic PCB array, where distances are in mm 3.3.3 INMP504 microphone The transducer chosen for sensing the acoustic analog inputs is the INMP540 microphone. A transducer transforms one form of energy to another. In our implementation, we are transforming mechanical energy (a longitudinal wave which modifies air pressure) into electrical 16
3.3. Pyramic Array energy (a voltage value). Those microphones belong to a new category of low-power, miniature MEMS microphones, which reduced size allows integrating them massively in a small area, suitable for many channel audio processing applications. Its omnidirectional behavior ensures uniform frequency response in all directions. Figure 3.5 displays the frequency response of the INMP504 transducer, which possesses characteristics of a high-pass filter with a cut-off frequency around 100 Hz. Note that the microphone bears a non-homogeneous frequency response between 2 kHz and 11 kHz. This high-frequency peak can be compensated in further post-processing. For an extensive information about the INMP5404 characteristics refer to its Datasheet [13]. Figure 3.5 – INMP5404 frequency response [13] 3.3.4 Signal conditioning The anti-aliasing filter mentioned in Section 3.2 is in charge of preparing the acquired electrical signal for the ADC at the next stage. It is composed of the following elements: a coupling capacitor to remove DC offset from the input, a non-inverting operational amplifier (OPA170) circuit to adapt the signal to the resolution of the ADC and a ferrite bead to reduce Power Supply Rejection Ratio (PSRR) from the microphone supply of 3,3 V. The circuit schematic and the calculations of its main parameters can be found in Appendix A.1. 3.3.5 AD7606 Analog to Digital Converter Usually DSP algorithms are limited to handle a finite amount of data, otherwise, a computing system able to perform an infinite number of calculations would be necessary. Unfortunately, nowadays even most advanced computers need numerical representation of continuous values in order to perform meaningful operations. To address those problems, an Analog-to- 17
Chapter 3. Pyramic Microphone array Table 3.1 – Oversample bit decoding [4]. OS[2..0] SNR 10 V Range (dB) 3 dB BW 10 V Range (kHz) Maximum Throughput CONVST Frequency (kHz) 000 90 22 200 001 91.292 22 100 010 93.6 18.5 50 011 95 11.9 25 100 96 6 12.5 101 96.7 3 6.25 110 97 1.5 3.125 111 Invalid Digital Converter (ADC) is presented as a device capable of converting an analog representation of a signal into a discrete value. It samples an analog input, holds its value for a specific amount of time (called the sampling period T s ) and generates a digital representation of the data. This value can be sent to a digital system such as a processor, a memory device or an FPGA. ADCs are core components in any digital application. For our implementation AD7606 device from Analog Devices was chosen. AD7606 is a 16-bit, Successive Approximation ADC component which can receive up to eight multiplexed channel inputs and allows either parallel or serial mode output reading. This allows to convert up to eight microphone signals from each array in parallel. Moreover, an intermediate digital filter allows to vary f s from 3,125 kHz to 200 kHz. Figure 3.6 presents the block diagram of the system and presents the pin connections of the ADC. For instance, depending on the values of OS[0..2] pins the maximum sampling frequency and SNR can be controlled as represented in Table 3.1. In our design OS[2..0] = 010 was chosen, which corresponds to a maximum throughput of 20 µ s (f s = 50 kHz) and SNR of 93,6 dB. For a broader description of the characteristics of the AD7606 refer to the Datasheet provided by Analog Devices [ 4 ]. Furthermore, Appendix A.2 summarizes the connections diagram designed for the AD7606 in the Pyramic system. For this application, the ADC was configured with the following characteristics: • 8 analog parallel input channels. • Serial reading through Dout A. • 16 bits resolution. • 48 kHz sampling frequency (fs). •±10 V bipolar output (LSB = 305µm). • Signal to Noise Ratio (SNR) of 93,6 dB. 18
3.3. Pyramic Array Figure 3.6 – AD7606 Block Diagram by Analog Devices [4]. Signed-Magnitude (SM) The output data from the ADC is 16-bits mono signed-magnitude audio data representation. Signed-Magnitude (SM) represents an integer as a N-bit signal where the sign and the magnitude are represented separately. The first bit x N-1 (i.e., the MSB) represents the sign and the remaining N-1 bits the magnitude. The representation becomes: X= N−2 X n=0 xn2nxN−1≥0 − N−2 X n=0 xn2nxN−1<0 The range of SM numbers is [-(2 N−1 -1),2 N−1 -1]. The advantages of this representation is a simplified prevention of overflows, but the disadvantage is that addition must be split depending on which operand is larger. 3.3.6 Timing requirements Once the audio data is sampled and quantized it is necessary to stablish a reliable and fast communication protocol between the ADC and a processing system. In our application, the 19
Chapter 3. Pyramic Microphone array ADC should indicate to the receiver that every 20,8 ms a new sample of 16-bits will be sent. For those purposes, the ADC provides control signals and timing requirements which allow the different systems to acknowledge digital data transmission from the ADC. Figure 3.7 boils down the general timing requirements during a conversion cycle of the ADC. First, the system is initialized by sending a RESET high pulse. Then, a low pulse of CONVST must be applied to start the conversion. Note that since the data can be read from two output lines, D out A and D outB , two conversion lines are available, CONVST A and CONVST B . In our design, we are just reading data from one line, D out A , so we can apply the same signal to CONVST A and CONVST B . After a CONVST low pulse has been sent, the ADC will assert the BUSY signal, which falling edge will mark the end of the conversion process. The time BUSY remains high is called the conversion time (t conv ), while the cycle time ( tcycle = Ts ) is the time between rising edges of two consecutive CONVST low pulses. When a conversion is finished, the sampled data is available in the ADC output and can be can read through the D out lines in parallel or serial mode when CS n is low. Serial implementation was chosen in our design. As it can be seen in Figure 3.7, it is possible to read the previous samples during a new conversion (i.e., while BUSY is high), which is useful to adjust the f s and reduce throughput if necessary. To sum up, after BUSY signal is deasserted and while CS n is low the acquisition platform can read the data through Dout A in serial mode. Figure 3.7 – AD7606 conversion time diagram [4] While CS n is low, the ADC sends a new bit of information every falling edge of SCLK. Figure 3.8 displays the process, where the transmission starts from the MSB (the sign) of the first ADC input channel V1. Note that our design uses just D out A , which will transmit the eight channels from V1 to V8. From this information, the minimum low pulse width of CS n can be calculated as follows: tread =channels ∗resolution fsclk =8∗16 fsclk , (3.2) where f sclk is SCLK frequency, channels the number of analog input channels for one ADC and resolution the number of bits of an audio sample. F sclk determines the reading speed and is provided by the transmission system. However, timing requirements regarding the 20
3.4. Summary AD7606 Datasheet [ 4 ] must be fulfilled. For instance, [ 4 ] requests t reset high pulse width from Figure 3.7 to last more than 50 ns in order to be a valid signal. Regarding f sclk , [ 4 ] displays a maximum serial reading frequency of 15 MHz when V dr i ve = 3,3V. According with Equation 3.2, if f sclkM AX = 15 MHz the minimum t read necessary for reading one conversion will be equal to 9µs. This value represents the minimum width of a CSnlow pulse. Figure 3.8 – AD7606 conversion tiime diagram [4] 3.4 Summary In this chapter, we presented an overview of the Pyramic array, its different components and the design considerations behind this new technology. The first steps of the DSP chain presented in Figure 3.1 have been introduced. Particularly, we explained the characteristics of the microphone transducers and the ADC converters implemented in the array. Nexct chapter will present the FPGA based processing system chosen for this platform. 21
4FPGA Technologies: Terasic DE1-SoC Board 4.1 Introduction FPGAs design still a rapidly evolving field, each year main developers such as Altera and Xilinx are building faster and more powerful chips containing reconfigurable hardware. Those achievements motivate the use of FPGA for Digital Signal Processing (DSP) applications and to substitute traditional processors in DSP systems as the one presented in Figure 3.1. As a consequence, in order to understand why FPGAs are preferred over more traditional solutions, this chapter will introduce FPGAs technologies and will present the device upon this project was built on: the DE1-SoC Board. 4.2 FPGA Technology 4.2.1 FPGA Benchmark Field Programmable Gate Arrays (FPGAs) are a member of a class of devices called fieldprogrammable logic (FPL). FPLS are defined as programmable devices containing repeated fields of arrays of small logic blocks and elements. FPGAs, similarly to ASIC (Application Specific Integrated Circuit), allow application specific design. However, building a programmable gate array solution allows full control over the design implementation without the lag and need for any physical IC fabrication facility. Several advantages offered by FPGAs over ASIC technologies are [17]: • Die size and weight reduction. • Parallelization leads to higher throughput. • Better security against unauthorized copies. • Reduced device and inventory cost. • Reduced board test costs. On the other hand, in the field of DSP programmable digital signal processors (PDSPs) 23
Chapter 4. FPGA Technologies: Terasic DE1-SoC Board have enjoyed tremendous success during the last decades. Their architecture is based on a reduced instruction set computer (RISC) paradigm that allows performing fast multiply- and-accumulate (MAC) operations, which are the basic block of signal processing algorithms. By using a multistate pipeline architecture, PDSPs can achieve MAC rates limited only by the speed of the array multiplier. However, compared with FPGAs, which allow hardware parallelization, FPGAs can perform more efficient for high-bandwidth signal processing applications such as multimedia information like audio [17]. Summarizing, FPGAs can still be comparable to ASICs in terms of performance while they do not require additional semiconductor manufacturing steps. The fact FPGAs allow reprogrammable hardware designs offers a lot of flexibility to the implementation. On the other hand, the main drawback regarding FPGAs design is that power consumption usually is higher than for traditional systems, especially at higher frequencies. In the end, it is expected FPGAs will dominate most front-end (sensor) applications like FIR filters or FFTs, while PDSP will dominate applications that require complex algorithms. This will lead to complex mixed implementations where the designer needs to bear specific knowledge about software and hardware design in order to build powerful real-time embedded systems. 4.2.2 Intelectual Property (IP) Cores design Although FPGAs are known for their capability to support rapid prototyping, the rapidly increasing complexity of FPGAs are forcing a methodology shift towards the use of intellectual property (IP) macrocells or mega-core cells. Those cells provide the designer with specific functions, such as FIFOs, UARTs, oscillators, SPI or FIR filters. Therefore, the designer only needs to specify certain attributes of the system in order to match the design requirements and the synthesizer will generate a hardware description code or schematic for the resulting solution. Therefore, the design cycle is reduced while providing a good utilization of the device resources. The main type of IP cores can be divided into three categories: 1. Soft Core : It is a behavioral description of a component that needs to be synthesized with FPGA vendor tools such as Quartus Prime Programmer. Modifications in the hardware description language (HDL) file provided in VHDL or Verilog can be made. Altera Cyclone V family devices implement a Nios II softcore processor, which is a processor implemented with Logic Elements (i.e., Look Up Tables and D-type Flip Flops) in an FPGA. 2. Parameterized Core : It is a structural description of a component. While the parameters of the design can be changed before synthesis, the HDL is usually not available. Altera provides most of the cores in this format, which allows certain flexibility but are not compatible with other FPGA vendors. For instance, the FIR filters designed in Section 5.3.4 are based on those type of IP blocks. 3. Hard Core : A fixed netlist core is a physical description of the IP system. When real-time constraints are required, the cores are optimized for a specific device family (such as 24
4.3. Terasic DE1-SoC Board Cyclone V). Those cores have fixed parameters but allow integration and simulation in larger projects. Altera’s Cyclone V provides a hardcore processor (HPS) along with an FPGA in the same die, merging simultaneous software and hardware design, which will be discussed in Chapter 6. In the end, when building an FPGA design it is necessary to choose between design flexibility (soft core) or fast results and reliability of data (hardcore). While soft cores are more flexible and parameterized, the debug time can be longer. While hard cores are verified in silicon, can reduce development, test, and debug time but no VHDL code is available to look at. Finally, parameterized cores are a compromise between flexibility and reliability of the generated code. 4.2.3 FPGA Design When building an FPGA system based project, first the designer needs to organize the objectives of the project as we did in Chapter 1. Later on, it is necessary to understand the timing requirements of the system as we introduced in Section 3.3.6. After that, the design is completed by drawing block diagrams as the ones that will be introduced in Section 5.2.3. Once the design is completed we can start building and simulating the sytem. For programming FPGAs two main HDL languages are available: VHDL and Verilog. Nowadays, there exist new tools which perform automatic translation from C to HDL. However, through this project, VHDL has been used in Altera-supplied software. However, Quartus Programmer generates some IP cores and files in Verilog format. Quartus Programmer software is a fully integrated system with VHDL and Verilog editor, synthesizer, simulator, and bitstream generator. For simulation, Modelsim has been used, which also supports Verilog and VHDL test files. On the other hand, Saleae Logic Analyzer for time testing and timing verification has been employed. For more details about the required software refer to Appendix B. 4.3 Terasic DE1-SoC Board Terasic DE1-SoC board [ 22 ](Figure 4.1), from the Altera Cyclone V family, has been implemented as the processing system for the Pyramic array project. An overview of the system is made in the following sections. 4.3.1 Specifications The main features of the DE1-SoC board implemented for the design of the PyraMic system are listed below. For a complete overview of all the available modules refer to [23]. FPGA Device • Cyclone V SoC 5CSEMA5F31C6 Device 25
Chapter 4. FPGA Technologies: Terasic DE1-SoC Board 2. The slave immediately asserts textitwaitrequest, indicating it is not ready to proceed with the transfer. The Master has to wait before starting the transfer. 3. When waitrequest is low the slave captures addr1,burstcount, and the first unit of writedata. On subsequent cycles of the transfer, address and burstcount are ignored. 4. The slave captures the second unit of data at the rising edge of clk. 5. The burst is paused while write deasserted. 6. The slave captures the third unit of data at the rising edge of clk. 7. The slave asserts waitrequest. Consequently, all outputs are held constant through another clock cycle. 8. The slave captures the last unit of data on this rising edge of clk. The slave write burst ends. The beginbursttransfer signal is asserted for the first clock cycle of a burst and is deasserted on the next clock cycle. However, this signal has not been implemented in our FPGA design. Figure 4.4 – Slave write burst of length 4 [2]. 4.5.2 Avalon Streaming Interfaces Avalon Streaming (Avalon-ST) interface drives unidirectional data with high bandwidth and low latency. For DSP applications, this interface allows to directly stream data between different modules in an FPGA design with a lot of flexibility. The interface supports from a single stream of data without knowledge of channels or packet boundaries till more complex protocol capable of burst and packet transfer with packets interleaved across multiple channels. Figure 4.5.2 represents each signal direction, while the function of each signal is described below: • startofpacket: Marks the active cycle containing the start of the packet. It is only interpreted when valid is asserted. • endofpacket: Marks the active cycle containing the end of the packet. It is only interpreted when valid is asserted. 32
4.5. FPGA interconnections: Avalon Interface • ready: On interfaces supporting backpressure, the sink asserts ready to mark the cycles where transfers may take place, i.e, if ready is asserted on cycle <n>, next cycle is considered a ready cycle. 1. • valid: This signal qualifies data on any cycle where data is being transferred from the source to the sink. On each valid cycle the data • data: Carries the bulk of the information being transferred from the source to the sink. The data consists of one or more symbols being transferred on every clock cycle. The dataBitsPerSymbol parameter defines how the data signal is divided into symbols. • channels: It is driven by the source to indicate the channel to which the data belongs. In each active cycle, all of the data transferred belongs to the same channel, while the source may change to a different channel on successive active cycles. Additionally, the maxChannel parameter indicates the maximum channel number. If the number of channels an interface supports changes dynamically, maxChannel is the maximum number the interface can support. Figure 4.5 shows a 32-bit example where dataBitsPerSymbol=8. Data transfers occurs on cycles 1,2,4,5, and 6, when both ready and valid are asserted. Since during cycle 1, startofpacket is asserted the first 4 bytes of packet are transferred. During cycle 6, endofpacket is asserted and valid is high as well, which indicates that this cycle is the end of the packet data transfer. empty has a value of 3, which indicates that at the end of the packet 3 of 4 symbols are empty, however this signal is not implemented in our design, neither error signal. 4.5.3 Avalon Conduit Interfaces Avalon Conduit interfaces group an arbitrary collection of signals, which direction can be seen as input, output or bidirectional by the FPGA device. Conduits can be used to interconnect different modules inside a Qsys system or to drive off-chip device signals, such as memory controllers or data and control signals for devices such as the Pyramic array. An important 1 Inded, in a more general case if ready is asserted on cycle <n>, <n + readyLatency> should be considered as ready cycle. However, in our Pyramic implementation readyLatency = 0 by default 33
Chapter 4. FPGA Technologies: Terasic DE1-SoC Board Figure 4.5 – 32 bits single channel Avalon Streaming Interface with packet transfer. constraint of Conduit signals is that when connecting them the roles and widths must match and the directions must be opposite. 4.6 Summary This chapter introduced FPGA technologies and compared its performance with ASIC and PDSP implementations. The IP core design philosophy is presented, while some FPGA design methodologies are described. Next, Terasic DE1-SoC from Altera Cyclone V family is presented, along with its main modules and a complete overview of the Pyramic array architecture implemented in the DE1-SoC board. Finally, the most important Avalon interfaces are explained in order to understand better the FPGA designs which will be explained in the following chapter. 34
5FPGA Design 5.1 Introduction In order to communicate with the Pyramic array, a parallel Master SPI interface has been designed in the FPGA part of the DE1-SoC board. The interface conveys the output samples from the AD7606 to an FPGA platform. A custom programmable interface (PI) in VHDL is designed for those purposes. Additionally, real-time FIR filters designed for delay-and-sum beamformer algorithms are presented as well. The output of the beamformer is converted send to an audio line out DAC located in the DE1-SoC board. Through this chapter we will present a top-bottom approach, i.e., from an overall architecture of the system to a detailed explanation of each block design and performance. 5.2 SPI Communication Design 5.2.1 SPI review A Serial Peripheral Interface (SPI) is a synchronous communication standard developed by Motorola, mainly used for short distances communications such as in embedded systems. It is a full-duplex interface, in which a Master unit starts a transmission/reception of information to/from a selected slaves. The main signals which compose a basic SPI interface are listed below, while Figure 5.1 represents a generic block diagram of an SPI system. • SCLK Serial clock provided by the Master unit. Usually the data in transmitted/received in the falling edge of SCLK to/from the selected Slave. •MOSI, Master out Slave in, data sent by the Master unit to the selected slave. •MISO, Master in Slave out, data sent to the Master unit by the selected slave. • SS, Selected Slave, indicates which slave have access to the Master. There is one by slave and usually, it is active low. 35
Chapter 5. FPGA Design Figure 5.1 – Generic SPI communication block diagram. 5.2.2 SPI communication design The Pyramic array communicates with the DE1-SoC device from Altera following an SPI communication protocol. The ADC sends the sampled data to the FPGA device, which receives the data and sends it to memory and to other FPGA modules for further processing. Those are the main design considerations of the developed SPI_System module: • The communication should be single-master multi-slave, where the FPGA is the Master and the ADC modules connected in daisy-chain by pairs are the Slaves. • The data transmission should be unidirectional from Slave to Master, i.e., only the MISO signal is transmitted. • The microphones data should be available as Avalon Streaming Interface and Avalon MM. • The memory distribution will be as in Figure 5.2. The data will be written in 32-bits memory addresses, each of them containing two microphone signals of 16-bits each. • The system should allow a burst transfer to memory with a burstcount of 4, meaning that each burst transfer will convey eight channels from the Pyramic array. • CS n corresponds to Slave-Select signal, SCLK to the SCLK from the AD7606, while MISO will correspond to the serial output Dout A. • All the ADC slave modules should send the information at the same time. Therefore, several MISO lines will be implemented to perform serial transfers in parallel. • The data transmission should be circular when a Start signal is high as indicated in Figure 5.3. Moreover, two flag signals, Buffer1 and Buffer2, will mark the beginning, half 36
5.2. SPI Communication Design and end of each circular period. Figure 5.2 – Pyramic samples memory distribution Figure 5.3 – Circular buffering of samples with Buffer1 and Buffer2 flags 5.2.3 SPI System block diagram SPI _ System is the FPGA HDL module developed through this project which interfaces a parallel SPI master communication. The module receives conduit signals from the Pyramic ADCs and sends the audio data through a DMA unit to memory. Moreover, the data is sent to a streaming interface. All the process is controlled by a slave module. Figure 5.4 displays the full block diagram of the SPI_System, the main components are described below: 37
Chapter 5. FPGA Design • SPI _ Controller: The SPI controller module is in charge of interacting directly with the AD7606 unit through conduit signals. It implements the SPI communication in order to receive the microphones data from the ADC in parallel from all the microphone arrays. Moreover, the data is stored in registers which can be read in real-time by a Direct Memory Access (DMA) unit and it is controlled by a SPI_Slave slave module. • SPI _ DMA: This module is a Direct Memory Access (DMA), which is able to write directly in the different memories of the DE1-SoC board. It receives the data from the SPI _ Controller module and sends it to an Avalon MM SDRAM Controller located in the HPS part. It is controlled by the SPI_Slave module. • SPI _ Slave: This Programmable Interface (PI) can be accessed by the main program to control the SPI communication. It is possible to change its register values to send instructions or receive information from the system. Its main functionalities are to set the length of the acquisition, the base address and start and stop the acquisition. • SPI _ Streaming: It receives the data from the DMA unit as Avalon ST interface. This way, the audio data can be sent to other modules for further processing in the FPGA. In our implementation the data is driven to an FIR filters bank. Figure 5.4 – SPI System Block Diagram. 38
5.2. SPI Communication Design SPI Controller module The SPI Controller module communicates directly the FPGA with the ADCs of the Pyramic array. Figure 5.5 details the inner architecture of the system. The signals SCLK,RESET and CS n are sent to the three ADCs according with the timing requirements of Figure 3.7 and [ 4 ]. SCLK frequency is 12,5 MHz, which is generated by dividing the system clock clk of 50 MHz by four. A Dtype Flip-Flop synchronizes the BUSY OR input signal with the system clock in order avoid metastability. The FPGA is the Master, which receives data from six slaves (the ADCs) in parallel, connected by pairs with daisy-chain connection and each of them sending a different MISO signal. Figure 5.6 displays the waveform outputs recorded with the Saleae Logic Analyzer. Although just MISO _ 00 signal is displayed for simplicity purposes, note that MISO _ 01,MISO _ 10,MISO _ 11, MISO _ 20 and MISO _ 21 are recorded in parallel and present the same behavior as MISO _ 00. There are as many MISO signals as the number of arrays we are using, by default we use six arrays, each of which bears eight microphone channels. When CS n is low, every SCLK falling edge a bit is sampled for each microphone, starting from the MSB. An internal counter counts 16 falling edges of SCLK. Then, another counter increments the channel number and the Serial to Parallel register stores the sample from the current channel of the six arrays. The next sample of 16 bits from the next channel is recorded in the same way till the eight microphone channels of each board are stored. Once in the register, the data can be read in parallel and stored in an array of 48 FIFOs called FIFO_MIC module. FIFO (First In First Out) modules are very recurrent in data buffering for streaming applications and interfaces design. In this project Altera SCFIFO (Single Clock FIFO) IP Core [9] has been used. The main signals of the FIFO are as follows: • clock: Connected to the system frequency of 50 MHz. It sets the writing and reading speed. •data: 16-bits input data in the writing side. •q: 16-bits output data in the reading side. •rdreq: When asserted a new output value each clock cycle is read. •wrreq: When asserted a new output value each clock cycle is written. • usedw: Number of words (samples of 16-bits) written in the FIFO. Maximum capacity is of three words per FIFO. When the Parallel to Serial register samples all the 48 microphone channels it sends a wrreq signal to the 48 FIFOs module and it loads a sample in each FIFO. When there are two or more words written in every FIFO (i.e., usedw ≥ 2 ∀ FIFO), Data Available will send a positive pulse. Then, the DMA unit will send a wrreq signal through DataRd signal. The samples will be stored in an output register and sent through a multiplexer to the DMA unit in pairs through Data[31..0] signal. The array _ vector[2..0] and sel[2..0] signals control the array and channel number to be transmitted. 39
Chapter 5. FPGA Design Figure 5.5 – Block diagram of the SPI Controller module Regarding the timing of the system, SCLK bears a frequency of 12,5 MHz. Therefore, according to Equation 3.2, the time needed to complete an acquisition of one sample will be equal to 10 µ s, which matches with the results in Figure 5.6. If f s is equal to 48 kHz (21 µ s), since it is possible to read during conversion (i.e., while BUSY is high) we can perform real-time processing of the audio samples during the 11 µ s available between samples. Once the data has been acquired, some clock cycles will be spent sending the data to memory through a DMA unit. SPI DMA module A Direct Memory Access (DMA) module is a Master unit that can transfer data directly to memory controllers. It is a programmable interface that must be programmed by the processor before it is operational. When the access bus is busy, the DMA performs arbitration and waits until the bus is available to send the next sample. Moreover, the DMA can perform burst 40
5.2. SPI Communication Design Figure 5.6 – SPI communication waveforms from Saleae Logic Analyzer. transfers as the one explained in Section 4.5.1, reducing the transfer latency. The 32-bits Length and Address signals are given by the slave module and indicate the length of the acquisition and the base address where the data will be written in the physical memory. Note that length it is not the number of samples per channel, although it represents the total number of samples of all the channels of the array. The 16-bits microphone signals are stored in pairs in the 32-bits address space as indicated in Figure 5.2. Figure 5.7 – SPI DMA module timing simulation in Modelsim. The DMA unit will have access to the SDRAM memory controllers to write the audio data into a 1 GB DDR3 memory included in the DE1-SoC device. In our design, only 500 MB are available to store the audio data . Therefore, if we record the 48 microphone channels at f s = 48 kHz using all the available physical memory the maximum acquisition is equal to: tacq =500MB resolution ∗channels ∗fs =500MB 16bi ts ∗48channel s ∗48kHz =108.5s(5.1) In order to overcome this limit, the DMA can write the data in a circular buffer. A circular buffer starts writing new data in the base address when the buffer overflows. Address indicates the base address where to start writing the data each period, while Length indicates the period duration (i.e., the size of the buffer). To exit from circular buffer mode the Start needs to be is low. In that case, the system transfers the data till the current period finishes. Additionally, 41
Chapter 5. FPGA Design where f[k] are the filter’s L coefficients. They also correspond to the FIR’s impulse response. For LTI systems it is sometimes more convenient to express 5.2 in the z-domain with Y(z)=F(z)X(z), (5.4) where F(z) is the FIR’s transfer function defined in the z-domain by F(z)= L−1 X k=0 f[k]z−k, (5.5) In practice, the Lth-order LTI FIR filter can be graphically intepreted in Figure 5.11. It can be seen to consist of a collection of a "tapped delay line", adders and multipliers. One of the operands presented to each multiplier is an FIR coefficient, often referred to as a "tap weight". The roots of F(z) define the zeros of the filter. 5.3.3 Filter-and-Sum Beamformer Consider an array of Mmicrophones and a far-field sound source at direction φ . Each of the microphones captures the same signal slightly delayed owing to the different times the sound needs to reach the corresponding microphone. The sound is captured from a far-field source according to Equation 2.3. The most intuitive approach to estimate the source signal is to delay each of the microphone signals in a way that the sound from the source signal are in phase, and to sum them. Then, we will take the source signal (the same in all channels after the delay) to have an amplitue Mtimes bigger than in each of the channels. This is usually compensated by dividiing the sum by the number of channels [21]. Y(f)=1 M M−1 X m=0 ej2πfkpmkcos((pm)−φ0) νXm(f), (5.6) where φ0 is the listening direction. Under the assumption of omnidirectional microphones ( Um ( f ) ≡ 1) and perfect conditioning circuit and ADC system ( Am ( f ) ≡ 1) for the band of interest, combining equations 2.2, 2.4 and 5.6 we obtain Y(f)=S0(f)+1 M M−1 X m=0 ej2πfkpmkcos((pm)−φ0) νNm(f). (5.7) If we assume the captured noise is not correlated accross the microphones and is modeled as a zero-mean Gaussian process Nm(f)=N(0,λ(f)), then the output signal becomes Y(f)=S0(f)∗N(0, λ(f) M). (5.8) Since the multiplicand after S(f) value will be smaller or equal to 1, in most cases the magnitude of a sound source coming from a direction different from the listening direction will be supressed to a certain degree. 48
5.3. FPGA implementation of Delay-and-Sum beamformer Figure 5.12 – Parallel delay-and-sum beamformer block diagram. Therefore, Equation 5.7 can be easily generalized in matrix form to Y(f)=W(f)X(f). (5.9) The spectrum of each input audio frame X is an MxK complex matrix, where Mis the number of microphones and Kis the frame size, i.e., the number of frequency bins. X(f) is a Mx1 complex vector. The frame indices are omitted for simplicity. The equations above are known as a "filter-and-sum beamformer" because the weights matrix W(m) acts as a filter for each channel. That is, first we filter each of the 48 channels separately and then we sum them. The filter-and-sum beamformer has more degrees of freedom and allows to perform flexible microphone arrays processing [21]. 5.3.4 FIR filters design in FPGA In Section 5.3.3 a general delay-and-sum beamformer using FIR filters was presented. This technique has been designed for the Pyramic array system, for which a real-time 48 parallel FIR filter cascade has been designed in an FPGA platform. The generated beam is output through the Audio Codec of the DE1-SoC. We will explain the design in the following section. Overall Design Figure 5.12 summarizes the overall architecture of the implemented custom delay-and-sum beamformer FIR filters bank. The FIR filters have been built using IP cores offered by Altera, which can generate FIR filters [ 3 ]. The data recorded through the SPI communication serves as input to the 48 filters bank. The filters bank filters the data, which is added in the next stage, a Beamformer _ Adder custom component. The resulting audio beam is sent to the Audio Codec, which sends the data to the audio out line of the DE1-SoC board. 49
Chapter 5. FPGA Design Figure 5.13 – Basic FIR Filter with Weighted Tapped Delay Line [3]. IP Core FIR Filter design The Altera FIR II IP core provides a fully-integrated finite impulse response (FIR) filter function optimized for use with Altera FPGA devices. The FIR II IP core has an interactive parameter editor that allows creating easily custom FIR filters. For instance, the filter type can be defined as single rate, decimation, interpolation, and fractional rate. The core is easy to integrate using Avalon Streaming (Avalon-ST) interfaces. Moreover, it supports run-time coefficient reloading capability and multiple coefficient banks. Figure 5.13 shows the internal architecture of the filter, where the number of tapped delay lines represent the filter order Land the coefficient multipliers allow multiple coefficient banks multiplexing. The main parameters applied in our implementation are as follows: •Filter Specifications: –Fractional Rate –Interpolation factor: 2 –Decimation Factor: 3 –Maximum number of channels: 48 –Input clock: 50 MHz –Clock Slack: 0 –Input sample rate: 48 kHz –No coefficient reload –No back pressure support •Coefficient Settings: –Symmetry: Non Symmetry –L-th Band Filter: All taps –Coefficients Scaling: Auto 50
5.3. FPGA implementation of Delay-and-Sum beamformer Figure 5.14 – FIR filter frequency response from Altera FIR IP Core [3] –Coefficients Data Type: Signed Fractional Binary –Coefficients Width: 15 bits –Coefficients Fractional Width: 15 bits •Input/Output Options: –Input Type: Signed binary –Input Width: 16 bits –Output Type: Signed binary –Truncate 7 LSB to remove from the output –Output Width: 32 bits • Implementation Options: Default parameters. • No reconfigurable carrier mode. The filter coefficients can be loaded from a .txt file. We tested the filter banks with the coefficients array of Appendix D, which frequency response is shown in Figure 5.14. The cutoff frequency is 8 kHz, suitable for speech processing applications. Note that since the filter performs Fractional Rate the fsis different at the input and output of the module: fsout =fsin ∗Inter polation Decimation =48kHz ∗2 3=32kHz (5.10) 5.3.5 System Timing One of the reasons why the Altera FIR IP core was chosen is that it allows Time-Division Multiplexing (TDM) to optimize hardware utilization. The TDM factor is the ratio of the clock 51
Chapter 5. FPGA Design rate to the sample rate. For example, implementing a filter with a TDM factor of 2 can halve the required hardware. To achieve TDM, the IP core requires a serializer and deserializer before and after the reused hardware to control the timing. The ratio of system clock frequency to sample rate determines the amount of resource saving except for a small amount of additional logic for the serializer and deserializer. T DM =fclk fs =50MHz 48kHz =1041 (5.11) With this TDM is possible to have 48 FIR filters in parallel just by using one physical FIR filter, which reduces a lot the hardware resources of the system. The input data is streamed just using one wire to the FIR II IP core. Since there are 1041 clock cycles between samples, the IP core can process all the 48 channels by using just one FIR filter. The data is sent to the Beamformer _ Adder module as Streaming ST interface. Note that the bits per packet (dataBitsperSymbol) in the FIR IP core is equal to the data width, while usually in most of the IP cores the bits per packet is equal to 8. For instance, the dataBitsPerSymbol of Figure 4.5 is equal to 8, thus we need four wires to send a 32 bits data. If we would like to connect those wires to the input of the FIR core, since we are using a single wire we should change the dataBitsPerSymbol parameter to 32 bits and send all the data through the same wire. If channel signal is available it should be concatenated to the data signal and its length should be added to the dataBitsPerSymbol parameter. This way all the information (the channel number and the data) can be sent through the same wire. Beamformer Adder The Beamformer _ Adder module receives filtered data from the FIR filters bank, adds it and sends the output to an Audio line out in the DE1-SoC board. It receives the filtered FIR _ data from the FIR filter and the FIR _ channel number in two different wires. The FIR filter asserts FIR _ Valid to indicate the data is ready to be sent. When FIR _ sop is high the first channel is sent, while when FIR _ eop is high indicates the last channel is transmitted. During this time, the module saves the 48 channels data in the FIR _ Output register. When the last channel is sent (i.e., FIR _ eop = ’1’), the module adds all the filtered channel values and divides this addition by M, which is the number of microphones. The FIR _ Valid indicates when the register is available to receive more data. The process is described in Figure 5.15. Audio Codec The output an the Beamformer _ Adder module can be listened through the Audio Codec DAC output line. The DE1-SoC device possesses a Wolfson-WM8731 audio CODEC which can 52
5.3. FPGA implementation of Delay-and-Sum beamformer Figure 5.15 – Beamformer adding the output of the FIR filters module be controlled thanks to the Audio and Video Config and audio _ controller IP cores [ 1 ]. The connection diagram between those modules and the design is displayed in Figure 5.12. The Audio and Video Config module controls the Wolfson codec through an I2C interface. At the same time, the Audio and Video Config module is controlled as an Avalon MM slave by a processor Master unit (the HPS in our system). The audio _ controller sends the data to the output, input or microphone input lines through the WM8731 audio codec, as displayed in Figure 5.16. The parameters chosen for this project are the followings: • Left justified data • Line out • 32 bits data width • 32 kHz output frequency • Streaming interface The input to the audio _ controller is a simple Avalon ST interface where the data is sent when the audio codec is ready to accept data (i.e., Streaming _ Ready high as well). To indicate the reliability of the transmitted data Streaming _ Data, the Streaming _ Valid signal is asserted every cycle a new sample is sent. A PLL module has been added to the design in order to generate AUD _XCK signal, which value is 12,288 MHz to match the specifications of defined in [ 26 ]. Moreover, [ 26 ] provides a more detailed information about the different signals to interface the audio ADCs and DACs 53
Chapter 5. FPGA Design Table 5.3 – Hardware resources Logic Utilization (in ALMs) 2,195/32,070 ( 7 % ) Total registers 3831 Total pins 201 / 457 (44%) Total block memory bits 511,700 / 4,065,280 (13%) Total PLLs 1/6 (17%) Total DLLs 1/4 (25%) with the FPGA. Figure 5.16 – Connections between the FPGA and audio CODEC [23]. 5.4 Conclusions Through this Chapter we described the SPI module and the FIR filters bank developed for delay-and-add beamforming applications. In the end, the SPI communication has been tested and verified its correct performance, while the FIR filters have some problems to perform real-time processing yet. Even if the described design is correct and the audio signal from the beamformer can be listened at the Audio Codec line out, there is some saturation in the value of the data. We believe the problem is with the coefficients values and widths, which parameters can be change in order to address this problem. Moreover, it would be interesting to use the coefficient reloading option of the FIR IP core to be able to change the look-up direction in real-time. However, the VHDL designs work properly while the hardware resources spent on processing such big amount of data are not very big. Table 5.3 summarizes the FPGA resources for the Pyramic array FPGA project after compiling the SPI communication interface along with the 48 FIR filters bank with 143 coefficients per filter. Regarding timing, the time it takes to write through the SPI communication in memory a sample from all the microphone channels is equal to 0,64 µ s. With a sampling frequency of 48 kHz there is a free time of 21.09 µs where the FPGA can perform further processing. 54
6HPS design and implementation 6.1 Introduction Even if a programmable DSP system offers many advantages, usually it is convenient to communicate the FPGA with a processing unit embedded as a Hard Processor System (HPS). As explained in Section 4.2.2, HPS are not synthesized on FPGA fabric, rather they are real processors. The Cyclone V family allows mixed designs where a single chip contains both an HPS and an FPGA device. The HPS consists of an ARM-A9 MPCore, which is a general-purpose application processor. The HPS-FPGA combination delivers the flexibility of programmable logic with the power and cost savings of hard IP cores, while the board size is reduced since we reduce the cost of adding a discretely embedded processor. In addition, this type of embedded systems allows differentiating the end product between the hardware and software design. Therefore, the system development supports virtually any interface standard. Through this chapter, we will introduce the main characteristics of the Cyclone V HPS. Based on this architecture, we will explain the implementation followed for the Pyramic array design, which involves the communication between the FPGA and the HPS unit, data storage in a DDR3 memory and the installation of a Linux OS in order to control the system through a WebServer. This allows storing the data in an SD card plugged into the DE-1 and to send it through the network to a local computer. 6.2 Cyclone V Hard Processor System [18] The DE1-SoC HPS contains a microprocessor unit (MPU) subsystem with dual ARM Cortex-A9 MPCore processors, flash memory controllers, SDRAM L3 interconnect, on-chip memories, support peripherals, interface peripherals, debug capabilities, and phase-locked loops (PLLs). The dual-processor HPS supports symmetric (SMP) and asymmetric (AMP) multiprocessing (Figure 4.1). The HPS and FPGA portions of the device are distinctly different, while the HPS can boot 55
Chapter 6. HPS design and implementation from • the FPGA fabric, •an external flash or • JTAG the FPGA must be configured either through •the HPS, or • an externally supported device such as the Quartus Prime programmer. The HPS and FPGA parts of the device each have their own pins. However, pins are not freely shared between the HPS and FPGA fabric. The FPGA I/O pins are configured by an FPGA configuration image through the HPS or any external source supported by the device. Moreover, the HPS and FPGA portions have distinct power supplies and power on independently. Meaning that the HPS can be powered without turning on the FPGA portion of the device. Nonetheless, to switch on the FPGA portion the HPS must be already powered on at the same time as the FPGA. Figure 6.1 – HPS block diagram [7]. 56
6.2. Cyclone V Hard Processor System [18] 6.2.1 HPS features Figure 6.1 shows the architecture of the HPS system, which consists of a dual-core 925 MHz ARM Cortex-A9 MPCore processor, a rich set of peripherals, and a share multiport SDRAM memory controller [ 7 ]. The following modules were implemented in the design of the Pyramic array: •Masters: –MPU subsystem featuring dual ARM Cortex-A9 MPCore processors. –One Ethernet media access controller (EMAC1): *EMAC1 pin: HPS I/O Set 0 pin *EMAC1 mode: RGMII –ARM CoreSight debug components –One SD/MMC controller: *SDIO pin: HPS I/O Set 0 *SDIO mode: 4-bit Data •Slaves: –64 KB on-chip RAM –64 kB on-chip boot ROM –UART0 Controller: *UART0 pin: HPS I/O Set 0 *UART0 mode: No flow control –Reset manager –Clock manager –Scan manager –System manager –FPGA manager The Ethernet MAC, USB OTG, NAND flash controller, and SD/MMC controller modules have an integrated DMA controller. An integrated DMA controller module provides up to eight channels of high-bandwidth data transfers. Note that peripherals that communicate off-chip are multiplexed with other peripherals at the HPS pin level, which allows choosing which peripherals to interface with other devices on the PCB. The MPU subsystem has an interrupt controller, one-general-purpose timer and one watchdog timer per processor and one memory management unit (MMU) per processor. Besides that, the HPS masters the L3 interconnect and the SDRAM controller subsystem. 6.2.2 HPS-FPGA Bridges The FPGA can exchange information with the HPS part thanks to the HPS–FPGA bridges, which support the Advanced Microcontroller Bus Architecture (AMBA ® ) Advanced eXtensible Interface (AXI™) specifications, consist of the following bridges: 57
Chapter 6. HPS design and implementation For instance, those files were used to generate Figure 5.9. • "quartus" stores The "Pyramic _ array" project developed in Quartus Prime project. Besides that, it contains all the compilation files. Moreover, the Pins assignments .xsl file for the DE1-SoC connections is stored in this folder. • "hdl" contains the custom VHDL components developed through this project. The DE1 _ SoC _ top _ level entity with all the system interconnections is stored in this folder as well. 6.6.2 Software design files All the software-related files written for initializing and programming the HPS processor are saved in "sw". In our design, we are just using the HPS processor. However, if Nios2 based applications were developed the "nios" folder can be used to store the programming files. The main subfolders of the "hps" directory are described below: • "preloader" stores the preloader which boots the HPS as explained in Section 6.4. • "u-boot" stores the U-boot preloader capable of loading the Linux kernel into the system. • "linux" It stores the latest Linux sources. The "rootfs" contains all the configuration of the Linux kernel running on the system. The username and password can be configured in this file. • "application" contains the software project developed in Eclipse DS-5 platform to program the ARM processor. To control the Pyramic array system, the "Mic _ Array _ HPS" project has been created. Figure 6.6 shows the flow chart of the developed application. The red squares are mandatory steps in any software application for this design. The main steps are described below: 1. Load the ’duration’ and ’audio _ folder’ arguments to the main function. Otherwise, default values are used. 2. Open physical memory devices from the 1GB DDR3 memory. 3. Physical to virtual memory mapping for the OS Kernel. 4. SPI System control. Data can be written and read from software to the SPI _ System module to control its slave registers. 5. Read data from DDR3 memory to a buffer. 6. Save the microphones data in .wav format after the full acquisition is completed. 7. scp microphones data. 8. Virtual to physical memory mapping for the OS Kernel. 9. Close physical memory devices. The "sdcard" directory contains all the final targets needed to create a valid SD card from which the DE1-SoC can boot. The SD Card is composed of a fat32 and a2 of 512 MB and 24 GB respectively. The fat32 contains all the necessary FPGA and system images to configure the HPS system when powering on the board. The a2 contains the Linux root directory folders. 64
6.6. Project Structure project name sw hw quartus hdlmodelsim nios application hps preloader u-boot application linux source rootfs sdcard fat32 a2 Figure 6.5 – Pyramic project structure Figure 6.6 – Mic_Array_HPS application flow chart 65
Chapter 6. HPS design and implementation 6.7 Conclusions Through this Chapter we explained the main features of the HPS part of the Cyclone V family devices. Combining HPS and FPGA system allows designing more reliable embedded system architectures. The Pyramic array is controlled by the HPS hardcore module. The HPS allows fast communication between the FPGA and HPS sides, as well as a fast data transaction through SDRAM controllers. Moreover, the HPS can be programmed as a normal microcontroller and it can obtain internet thanks to sharing the connection with the host computer. Next Chapter will explain some results obtained from implementing the Pyramic array. 66
7Results and algorithms implementation 7.1 Experiment conditions The Pyramic array was tested in the Laboratory of Audiovisual Communications (LCAV) at EPFL, in the INR019 Audio room. The test consisted of several recordings where audio files are played from different speakers distributed as in Figure 7.1. The Pyramic array was positioned in the position (0,0). The microphones are: •MISO_00: from Microphone 0 to Microphone 7. Connected to J4 in Figure A.7. •MISO_01: from Microphone 8 to Microphone 15. Connected to J4 in Figure A.7. •MISO_10: from Microphone 16 to Microphone 23. Connected to J3 in Figure A.7. •MISO_11: from Microphone 24 to Microphone 31. Connected to J3 in Figure A.7. •MISO_20: from Microphone 32 to Microphone 39. Connected to J2 in Figure A.7. •MISO_21: from Microphone 40 to Microphone 47. Connected to J2 in Figure A.7. First, a frequency sweep generated by a Python script was played from the speakers. The excitation was an exponential sweep of 6 seconds with a 0,1 seconds margin from 100 Hz to 7000 kHz. The rest of the recordings were speech signals of 5 seconds duration each. Moreover, noise was recorded at the end. Appendix B explains where the audio recordings can be found in the DVD attached to this project. The room conditions were 25.4 C and 57.4% humidity. The direction of arrival algorithms were implemented in Python 2.7.12. The positions of the microphones is presented in Appendix D. 7.2 Microphone Signals Figure 7.3 displays the microphone outputs from the speech signal coming out from the fourth speaker. Only the signals from the 16 first microphones are displayed, i.e, the first two microphone arrays. The data is successfully recorded by each microphone and we can appreciate the delay and attenuation between microphones due to the different positions of 67
Chapter 7. Results and algorithms implementation Figure 7.1 – Speakers set up and order Figure 7.2 – Pyramic set up the microphone transducers within the array. Moreover, Figure 7.4 shows the spectrogram of a frequency sweep coming from Speaker 2 to Microphone 0. The microphone shows a homogeneous frequency response along all the frequency range. 7.3 SRP algorithm results Finally, offlin direction of arrival algorithms developed at LCAV by Eric Bezzam and Robin Scheibler have been tested using the Pyramic data. A beamforming algorithm based on the Steered-Response-Power (SRP) method explained in Section 6.2 of [ 21 ] was chosen. For the results presented in this report, the algorithm was tested with a single speech signal coming 68
7.3. SRP algorithm results 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −300 −200 −100 0 100 200 300 Magnitude Mic 0 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −300 −200 −100 0 100 200 300 Magnitude Mic 1 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −300 −200 −100 0 100 200 300 Magnitude Mic 2 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −150 −100 −50 0 50 100 150 200 250 300 Magnitude Mic 3 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −200 −100 0 100 200 300 400 Magnitude Mic 4 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −200 −150 −100 −50 0 50 100 Magnitude Mic 5 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −250 −200 −150 −100 −50 0 50 100 150 200 Magnitude Mic 6 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −300 −200 −100 0 100 200 300 Magnitude Mic 7 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −300 −200 −100 0 100 200 300 Magnitude Mic 8 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −300 −200 −100 0 100 200 300 Magnitude Mic 9 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −250 −200 −150 −100 −50 0 50 100 150 200 Magnitude Mic 10 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −300 −200 −100 0 100 200 300 Magnitude Mic 11 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −250 −200 −150 −100 −50 0 50 100 150 Magnitude Mic 12 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −300 −200 −100 0 100 200 300 Magnitude Mic 13 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −250 −200 −150 −100 −50 0 50 100 150 Magnitude Mic 14 7.95 7.96 7.97 7.98 7.99 8.00 time (s) −300 −200 −100 0 100 200 300 Magnitude Mic 15 Figure 7.3 – Time waveforms of 50 ms for the first 16 microphones of the Pyramic array 01234567 Time [sec] 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 Frequency [Hz] Spectrogram 2 4 6 8 10 12 14 Figure 7.4 – Frequency sweep captured by Microphone 0. 69
Chapter 7. Results and algorithms implementation from Speaker 2. Figure 7.5 shows the spectrogram and the time waveform of the speech signal. Moreover, the time waveform allows to identify when the algorithms should proceed, i.e., when there are voiced segments in the record. For this test, a 2-D SRP direction of arrival implementation has been made. The xy plane is marked by the Pyramic array. The parameters of the algorithms are set as: • Frequency range: 100 Hz to 7kHz • Hop size: 1024 • FFT length: 1024 • Number of Snapshots: 25 • Starting time: 1,2 sec • Far-field model Finally, the results are displayed in Figures 7.6 and 7.7 in which a magnitude plot and polar coordinates of the direction of arrival response are displayed respectively. We can appreciate how the Pyramic array is able to detect the look-up direction φ which in this case corresponds to 0 ◦ (since Speaker 2 is located a that angle from the Pyramic array look-up direction). The length of the processed signal was 530 ms, while the processing time for SRP for 48 microphones and the parameters mentioned above is 2,798 seconds. 70
7.3. SRP algorithm results (a) Time waveform of speech signal captured by Microphone 0. 0 1 2 3 4 5 Time [sec] 0 1000 2000 3000 4000 5000 6000 7000 Frequency [Hz] Spectrogram 0.6 1.2 1.8 2.4 3.0 3.6 4.2 4.8 5.4 (b) Spectogram of speech signal captured by Microphone 0. Figure 7.5 – In the top panel, the time representation of a speech signal. In the bottom panel, a spectogram representation of the same signal. 71
Chapter 7. Results and algorithms implementation −150 −100 −50 0 50 100 150 Azimuth [degrees] 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 Magnitude Steering Response Power Spectrum Figure 7.6 – Magnitude plot of SRP algorithms results for single source location. 0° 45° 90° 135° 180° 225° 270° 315° 0.2 0.4 0.6 0.8 1.0 Steering Response Power Spectrum (azimuth) Figure 7.7 – Polar plot result of SRP implementation. The sound source is detected at φ= 0◦. 72
8Conclusions and further directions for research 8.1 Conclusions Using a revolutionary technology, the Pyramic microphone array, for capturing multi-channel audio signals, is able to acquire massive amount of acoustic information while implements real-time DSP hardware accelerators. The main goals of the project have been achieved and a functional and reliable system has been implemented. In order to achieve our goal, we built the Pyramic array, a custom hardware component connected to a DE1-SoC board from Altera Cyclone V family. DE1-SoC device combines a Field Programmable Gate Array (FPGA) and a Hard Processor System (HPS), which allows building reliable embedded systems. Pyramic delivers a flexible platform for implementing practical real-time DSP algorithms such as beamforming, speech-enhancement, and room shape recognition. The user can change the number of microphones used by the device and test the Pyramic array under different geometries more suitable for the desired application. Moreover, the design is compatible with other Alteras Cyclone V devices that support HPS and FPGA development. However, depending on the chosen platform, some peripherals might not be available, such as the Audio Codec in the DE0-nano device. Thanks to the fact that the project directory structure separates the hw and sw folders, the designer can develop independent hardware or software applications. For instance, in the current state of the design, the DE1-SoC acquires the data from the Pyramic array and saves it in a DDR3 memory, which can be accessed by software applications. This means that the designer can start further advanced software applications in Eclipse DS5 for the Pyramic array without overlapping the design with the hardware system. On the other hand, for programming the FPGA part of the device the designer should have knowledge of hardware programming. 73
Appendix A. Appendix: Schematics Figure A.7 – Pyramic array base power supply 80
BAppendix: Development Tools For hardware development, you can configure the HPS and connect your soft logic in the FPGA fabric to the HPS interfaces using the Qsys system integration tool in the Quartus Prime software. For software development, the ARM-based SoC devices inherit the rich software development ecosystem available for the ARM Cortex-A9 MPCore processor. The software development process for Altera SoCs follows the same steps as those for other SoC devices from other manufacturers. B.1 Hardware The project was developed upon Terasic DE1-SoC board, nevertheless it is compatible with other Cyclone V SoC device which gathers the characteristics described in Section 4.3.1. B.2 Software The following programs were installed and the operating system used to develop the design was UBUNTU 16.04.1: •Quartus Prime 16.0 Lite Edition •ModelSim-Altera Starter Edition 10.4d •SoC Embedded Design Suite (SoC EDS): Eclipse for DS-5 v5.23.1 B.3 Attached multimedia files The attached DVD is composed of the following sections: • Audio: It contains the audio recordings for the results of Chapter 7. • Project: It contains all the design files compressed as described in Section 6.6. • Logic Analyzer: Salae logic simulation of the SPI System. 81
Appendix B. Appendix: Development Tools • Schematics: It contains pdf files of the system schematics. 82
CAppendix: FIR Filters coefficients 143 coefficients for one FIR filter. In the same file, copy the coefficients as many times as the number of banks you want to implement (usually 48). A comma represents a separation between coefficients, while a space is a separation between filter banks. 1# banks : 48 2# coeffs : 143 3-1.92836858E-10, 2.7661817E-9, 1.56636394E-9 , -6.68390369E-9, -7.40206242E -9, 1.99785879E -8, 2.64397032E -8, -5.82629366 E-8, -7.94253102E-8, 1.56116056E-7 , 2.11062408E-7, -3.84096067E -7 , -5.10505862 E-7 , 8.76751151 E -7, 1.14446625E-6, -1.87627082 E-6 , -2.40792169 E-6 , 3.79720804 E -6, 4.79813881 E-6, -7.31812953E-6, -9.11797671 E-6 , 1.35058995 E -5, 1.66140745E -5, -2.39773828 E-5 , -2.91543402E-5, 4.11015628 E -5, 4.94471105E-5 , -6.82424538E-5, -8.13015536E-5 , 1.10040013 E-4 , 1.29925719 E -4, -1.72723075E -4, -2.02255751 E-4 , 2.64446021 E-4 , 3.07308265 E -4, -3.95640742E-4 , -4.56549135E-4, 5.79379167 E -4, 6.64278091E-4 , -8.31751644E-4 , -9.48042281 E -4, 0.00117228603 , 0.00132911754 , -0.00162446675 , -0.00183314038 , 0.00221647127 , 0.00249104855 , -0.00298233982 , -0.00334061758 , 0.00396396701 , 0.00442911344 , -0.00521462334 , -0.00581802684 , 0.00680534563 , 0.0075917674 , -0.00883688062 , -0.0098742217 , 0.0114629847 , 0.0128620038 , -0.0149388678 , -0.0168965785 , 0.0197316777 , 0.022639064 , -0.0268084979 , -0.031568432 , 0.0385531058 , 0.0478084522 , -0.0628254567 , -0.088722802 , 0.149493423 , 0.44977945 , 0.44977945 , 0.149493423 , -0.088722802 , -0.0628254567 , 0.0478084522 , 0.0385531058 , -0.031568432 , -0.0268084979 , 0.022639064 , 0.0197316777 , -0.0168965785 , -0.0149388678 , 0.0128620038 , 0.0114629847 , -0.0098742217 , -0.00883688062 , 0.0075917674 , 0.00680534563 , -0.00581802684 , -0.00521462334 , 0.00442911344 , 0.00396396701 , -0.00334061758 , -0.00298233982 , 0.00249104855 , 0.00221647127 , -0.00183314038 , -0.00162446675 , 0.00132911754 , 0.00117228603 , -9.48042281 E -4, -8.31751644E-4, 6.64278091 E-4 , 5.79379167 E -4, -4.56549135 E-4 , -3.95640742E-4, 3.07308265 E -4, 2.64446021E-4 , -2.02255751E-4, -1.72723075E-4 , 1.29925719 E-4 , 1.10040013 E -4, -8.13015536E -5, -6.82424538 E-5 , 4.94471105 E-5 , 4.11015628 E -5, -2.91543402E-5 , -2.39773828E-5, 1.66140745 E -5, 1.35058995E-5 , -9.11797671E-6 , -7.31812953 E -6, 4.79813881E-6, 3.79720804 E-6 , -2.40792169 E-6 , -1.87627082 E-6 , 1.14446625 E-6, 8.76751151 E -7, -5.10505862E-7 , -3.84096067E-7, 2.11062408 E -7, 1.56116056E-7, -7.94253102 E-8 , -5.82629366 E-8 , 2.64397032 E -8, 1.99785879 E-8, -7.40206242E-9, -6.68390369 E-9 , 1.56636394 E-9, 2.7661817 E -9 , -1.92836858 E -10 , -9.9644808 E -10 83
DAppendix: Pyramic Microphones positions 1# Microphones positions ( in cm ) for Pyramic array for compilation in Python . 2import numpy as np 3 4pos 0 = [3.51 , 0, 1.13] 5pos 1 = [5.83 , 0, 4.39] 6pos 2 = [8.15 , 0, 7.65] 7pos 3 = [9.08 , 0, 8.95] 8pos 4 = [9.55 , 0, 9.6] 9pos 5 = [10.48 , 0, 10.9] 10 pos 6 = [12.8 , 0, 13.5] 11 pos 7 = [15.12 , 0, 17.42] 12 13 pos 8 = [13.7 , -2.5 , 21.3] 14 pos 9 = [10.23 , -4.5, 21.3] 15 pos 10 = [6.77 , -6.5 , 21.3] 16 pos 11 = [5.38 , -7.3 , 21.3] 17 pos 12 = [4.69 , -7.7 , 21.3] 18 pos 13 = [3.3 , -8.5 , 21.3] 19 pos 14 = [ -0.15 , -10.5 , 21.3] 20 pos 15 = [ -3.6 , -12.5 , 21.3] 21 22 pos 16 = [ -1.75 , 3.04 , 1.13] 23 pos 17 = [ -2.91 , 5.05 , 4.39] 24 pos 18 = [ -4.07 , 7.06 , 7.65] 25 pos 19 = [ -4.54 , 7.87 , 8.95] 26 pos 20 = [ -4.77 , 8.27 , 9.6] 27 pos 21 = [ -5.24 , 9.07 , 10.9] 28 pos 22 = [ -6.4 , 11.08 , 14.16] 29 pos 23 = [ -7.56 , 13.1 , 17.42] 30 31 pos 24 = [ -3.6 , 12.5 , 21.3] 32 pos 25 = [ -0.5 , 10.5 , 21.3] 33 pos 26 = [3.3 , 8.5 , 21.3] 34 pos 27 = [4.69 , 7.7 , 21.3] 35 pos 28 = [5.38 , 7.3 , 21.3] 36 pos 29 = [6.77 , 6.5 , 21.3] 37 pos 30 = [10.23 , 4.5 , 21.3] 38 pos 31 = [13.7 , 2.5 , 21.3] 39 40 pos 32 = [ -1.75 , -3.04 , 1.13] 41 pos 33 = [ -2.91 , -5.05 , 4.39] 42 pos 34 = [ -4.07 , -7.06 , 7.65] 43 pos 35 = [ -4.54 , -7.87 , 8.95] 44 pos 36 = [ -4.77 , -8.27 , 9.6] 85
Appendix D. Appendix: Pyramic Microphones positions 45 pos 37 = [ -5.24 , -9.07 , 10.9] 46 pos 38 = [ -6.4 , -11.08 , 14.16] 47 pos 39 = [ -7.56 , -13.1 , 17.42] 48 49 pos 40 = [-9 , -10, 21.3] 50 pos 41 = [-9 , -6, 21.3] 51 pos 42 = [-9 , -2, 21.3] 52 pos 43 = [ -9 , -0.04 , 21.3] 53 pos 44 = [-9 , 0.04 , 21.3] 54 pos 45 = [ -9, 2, 21.3] 55 pos 46 = [ -9, 6, 21.3] 56 pos 47 = [-9 , 10 , 21.3] 57 58 # Create Rotation matrix 59 alpha = 120.0* np.pi /180; # Alpha : Angle to rotate 60 R = np . array ([[ np . cos ( alpha ) ,- np . sin ( alpha ) ,0] ,[ np . sin ( alpha ) ,np . cos ( alpha ) ,0] ,[0 ,0 ,1]]); 61 62 # construct mic array 63 L = np . array ([ pos 0, pos1, pos 2, pos 3, pos 4, pos 5, pos6, pos 7, pos 8, pos9, pos 10, pos 11, pos 12 , pos 13, pos 14 , pos 15 64 ,pos 16 , pos 17, pos 18, pos 19 , pos 20, pos 21 , pos 22, pos 23, pos 24 , pos 25 , pos 26, pos 27, pos 28 , pos 29, pos 30 , pos 31 65 ,pos 32 , pos 33, pos 34, pos 35 , pos 36, pos 37 , pos 38, pos 39, pos 40 , pos 41 , pos 42, pos 43, pos 44 , pos 45, pos 46 , pos 47] , dtype = float ) /100 66 67 # Multiply and rotate by alpha (=120 ) 68 L = np.dot (L,R) 86
Bibliography [1] Altera, 101 Innovation Drive San Jose, CA, 95134. Audio core for Altera DE-Series Boards, 10 2015. [2] Altera. Avalon Interface Specifications, 2015. [3] Altera, 101 Innovation Drive San Jose, CA, 95134. FIR II IP Core User Guide, 10 2015. [4] Analog Devices. 8-/6-/4-Channel DAS with 16-Bit, Bipolar Input, Simultaneous Sampling ADC, 2012. [5] Altera Corporation. " Cyclone V Device Handbook, Volume 3: Hard Processor System Technical Referene Manual," 31 July 2014, 2014. [6] Altera Corporation. "Nios II Gen2 Processor Reference Guide", 2015. [7] Altera Corporation. "Cyclone V Device Overview", 2016. [8] Altera Corporation. "HPS SoC Boot Guide - Cyclone V SoC Development Kit", 2016. [9] Altera Corporation. "SCFIFO and DCFIFO IP Cores User Guide", May 2016. [10] Eugene Weinstein, Kenneth Steele, Anant Agarwal, and James Glass. Loud: A 1020-node modular microphone array and beamformer for intelligent computing spaces. MIT Computer Science and Artificial Intelligence Laboratory, 2004. [11] Fairchild Semiconductor. NC7SZ32 TinyLogic® UHS Two-Input OR Gate, 2009. [12] Florian Parrodin, Janosch Nikolic, Joel Busset and Roland Siegwart. Design and calibration of large microphone arrays for robotic applications. IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 4596 – 4601, 2012. [13] InvenSense. Ultra-Low Noise Microphone with Bottom Port and Analog Output, 2014. [14] Ivan Dokmanic, Reza Parhizkar, Andreas Walther, Yue M. Lu, and Martin Vetterli. Raking the cocktail party. PNAS, 110(30), 2013. [15] Ivan Dokmanic, Robin Scheibler, Martin Vetterli. Raking the cocktail party. IEEE journal of selected topics in signal processing, 9(5), 2015. [16] Philipos C. Loizou. Speech Enhancement. 3 edition, 2007. [17] Uwe Meyer-Baese. Digital Signal Processing with Field Programmable Gate Arrays. 3 edition, 2007. [18] René Beuchat Sahand Kashani-Akhavan. SoC-FPGA Design Guide. [19] M.I. Skolnik. Introduction to Radar Systems. McGraw-Hill, New York, 1980. [20] Murata Power Solutions. "NTA Series Isolated 1W Dual Output SM DC/DC Converters". [21] Ivan Tashev. Sound Capture and Processing. 1 edition, 2009. 87
Bibliography [22] Terasic Technologies. "Terasic- DE Main Boards - Cyclone - DE1-SoC Board," [Online].Available:. [23] Altera University Program Terasic Technologies. DE1-SoC User Manual, 2014. [24] Texas Instrument. TPS780xx 150-mA Low-Dropout Regulator, Ultralow-Power, IQ 500 nA With Pin-Selectable, Dual-Level Output Voltage, 2007. [25] Texas Instruments. OPAx170 36-V, Single-Supply, SOT553, Low-Power Operational Amplifiers Value Line Series, 2011. [26] WM8731. "Portable Internet Audio CODEC with Headphone Driver and Programmable Sample Rates". 88
http://www.linkedin.com/in/juanazcarreta JUAN AZCARRETA ORTIZ Lausanne, Switzerland From: Vitoria-Gasteiz, Spain Born: 12/11/1992
[email protected] (+34) 669 86 88 46 Status: Single WORK EXPERIENCE 09/2016-08/2017 (exp.) NTT Communications SL: Signal Processing Group. Kyoto, Japan 02/2016-07/2016 (exp.) EPFL LCAV and LPA laboratories: An FPGA based platform for Lausanne, Switzerland many-channel audio acquisition and algorithms implementation. 02/2015-06/2015 Broadcom Networks Spain: Formation in Analog Barcelona, Spain Microelectronics with the aim of increasing knowledge in the design of high performance analog IC. 02/2014-07/2014 Basque Center on Cognition, Brain and Language, BCBL: San Sebastian, Spain Model physiological related BOLD signal variations in fMRI experiments. 01/2014-06/2014 Power harvesting from human body at University of Navarra. San Sebastian, Spain 07/2013 Metalúrgicas Alavesas: PLC programming and control. Vitoria, Spain 2012 CEIT: Undergraduate researcher in the Automations and San Sebastian, Spain Electronics department. EDUCATION 09/2015-07/2016 (exp.) MS of Science in Electrical Engineering (UPC.EUROPA program) Lausanne, Switzerland École Polytechnique Fédérale de Lausanne (EPFL) 09/2014-06/2015 Master’s Degree in Electronics Engineering (MEE) Barcelona, Spain at Universitat Politécnica de Catalunya (UPC). 09/2010-07/2014 BSc in Industrial Electronics Engineering San Sebastian, Spain at University of Navarra, Ranking: 1st out of 14. Fall 2013 Electric Engineering at Cal Poly, Exchange Program. California, USA Summer Course 2013 Multimedia Signal and Information Processing: Aalborg, Denmark Aalborg University. Machine learning for speech recognition. ACADEMIC BACKGROUND 02/2016-05/2016 Introduction to the IoT and Embedded Systems (UCI, Irvine) MOOC, Coursera 03/2014-04/2014 Statistical Analysis of fMRI data (Johns Hopkins University) MOOC, Coursera 09/2013-12/2013 Audio Engineering Club: Fuzz guitar pedal California, USA 07/2013 Anthem construction and design with CST Studio San Sebastian, Spain 01/2013-04/2013 Management and Leadership Skills San Sebastian, Spain 02/2013 Introduction to Digital Sound Design (Emory University) MOOC, Coursera 05/2012 Product Design and Development San Sebastian, Spain AWARDS 2016 Vulcanus in Japan Programme Scolarship: 1-year EU students exchange in Japan. EU- Japan Centre for Industrial Cooperation 2015 AGAUR Scolarship 2015: for mobility programs for outstanding students in Catalonia. 2014 KutxaBank Award for Academic Excellence: awarded to the most outstanding graduates in Gipuzkoa. LANGUAGES Spanish Mother Tongue English TOEFL 98 German A1 Basque Mother Tongue French B1 PROGRAMMING LANGUAGES C/C++, Java, Matlab, Python, VHDL VOLUNTEERING WORK 2010-2014 ASPACE: Spanish Association of cerebral palsy sufferers. San Sebastian, Spain 06/2013 FSL INDIA: Work Camp in construction and education fields. Dharamsala, India ADDITIONAL EXPERIENCE 13/03/2016-18/03/2016 MunEPFL: Russian Federation Delegate at Harvard WorldMun, UNHRC Rome, Italy 06/11/2015-08/11/2015 MunEPFL: Germany delegate at ManMun, SPECPOL Manchester, UK 2014 Founder of AUDIO TECHNOLOGIES TECNUN (ATT). San Sebastian, Spain Ebow Project: Electronic design and construction of an electronic bow. 2013 Class Representative of Electronics Engineering. San Sebastian, Spain Hobbies: Basketball – Music (guitar, accordion, bass) - Reading- Diving- Ski- Kendo- Make it Happen. 89