Digital Signal Processor

Size: px
Start display at page:

Download "Digital Signal Processor"

Transcription

1 Electronics FACET Digital Signal Processor Instructor Guide

2 Order no.: Revision level: 11/2014 By the staff of Festo Didactic Festo Didactic Ltée/Ltd, Quebec, Canada 2014 Internet: Printed in Canada All rights reserved ISBN (Printed version) ISBN (CD-ROM) Legal Deposit Bibliothèque et Archives nationales du Québec, 2014 Legal Deposit Library and Archives Canada, 2014 The purchaser shall receive a single right of use which is non-exclusive, non-time-limited and limited geographically to use at the purchaser's site/location as follows. The purchaser shall be entitled to use the work to train his/her staff at the purchaser's site/location and shall also be entitled to use parts of the copyright material as the basis for the production of his/her own training documentation for the training of his/her staff at the purchaser's site/location with acknowledgement of source and to make copies for this purpose. In the case of schools/technical colleges, training centers, and universities, the right of use shall also include use by school and college students and trainees at the purchaser's site/location for teaching purposes. The right of use shall in all cases exclude the right to publish the copyright material or to make this available for use on intranet, Internet and LMS platforms and databases such as Moodle, which allow access by a wide variety of users, including those outside of the purchaser's site/location. Entitlement to other rights relating to reproductions, copies, adaptations, translations, microfilming and transfer to and storage and processing in electronic systems, no matter whether in whole or in part, shall require the prior consent of Festo Didactic GmbH & Co. KG. Information in this document is subject to change without notice and does not represent a commitment on the part of Festo Didactic. The Festo materials described in this document are furnished under a license agreement or a nondisclosure agreement. Festo Didactic recognizes product names as trademarks or registered trademarks of their respective holders. All other trademarks are the property of their respective owners. Other trademarks and trade names may be used in this document to refer to either the entity claiming the marks and names or their products. Festo Didactic disclaims any proprietary interest in trademarks and trade names other than its own.

3 Safety and Common Symbols The following safety and common symbols may be used in this manual and on the Lab-Volt equipment: Symbol Description DANGER indicates a hazard with a high level of risk which, if not avoided, will result in death or serious injury. WARNING indicates a hazard with a medium level of risk which, if not avoided, could result in death or serious injury. CAUTION indicates a hazard with a low level of risk which, if not avoided, could result in minor or moderate injury. CAUTION used without the Caution, risk of danger sign, indicates a hazard with a potentially hazardous situation which, if not avoided, may result in property damage. Caution, risk of electric shock Caution, hot surface Caution, risk of danger Caution, lifting hazard Caution, hand entanglement hazard Notice, non-ionizing radiation Direct current Alternating current Both direct and alternating current Three-phase alternating current Earth (ground) terminal Festo Didactic III

4 Safety and Common Symbols Symbol Description Protective conductor terminal Frame or chassis terminal Equipotentiality On (supply) Off (supply) Equipment protected throughout by double insulation or reinforced insulation In position of a bi-stable push control Out position of a bi-stable push control IV Festo Didactic

5 Table of Contents Preface... XI About This Manual... XIII To the Instructor... XV Unit 1 Familiarization... 1 DISCUSSION OF FUNDAMENTALS... 1 Introduction... 1 Types of microprocessors... 2 General-purpose microprocessors... 3 Embedded systems microprocessors... 3 Peculiarities of DSPs... 3 Program execution... 4 Assembly language... 5 The C language... 6 Debugging... 7 Ex. 1-1 Overview of the DSP Circuit Board... 9 DISCUSSION... 9 The accessories section Power supply with an auxiliary power input DC source Microphone pre-amplifier Audio amplifier The DSP and its peripherals section Digital signal processor CODEC I/O interface Interrupts Auxiliary I/O USB ports PROCEDURE Circuit board introduction Familiarization with the circuit board using a DSP program Using a second application Ex. 1-2 Integrated Development Environment (IDE) and Project Structure DISCUSSION The Code Composer Studio software The code development perspective Project structure C code Assembly code Configuration file Festo Didactic V

6 Table of Contents The debug perspective Breakpoints Registers, Expressions, and Variables windows PROCEDURE Set up and connections Testing and debugging the project Viewing memory and graphics display Breakpoints Editing memory and registers Unit 2 Architecture DISCUSSION OF FUNDAMENTALS Introduction The Von Neumann architecture The Harvard architecture The architecture of the TMS320C CPU and the bus structure Memory Peripherals Ex. 2-1 Processor Arithmetic DISCUSSION Fixed-point and floating-point DSPs Binary and hexadecimal numbers Decimal to binary conversion Binary to decimal conversion Hexadecimal numbers Decimal to hexadecimal conversion Hexadecimal to decimal conversion Binary to hexadecimal and hexadecimal to binary conversion Two s complement representation (2s-format) Fractional numbers Q-format Fractional numbers Floating-point format PROCEDURE Converting a signed fractional number to Q14-format Converting a binary number to a decimal value Making numerical conversions from the Code Composer software Comparing the multiplication of integers to the multiplication of floats on a fixed-point DSP VI Festo Didactic

7 Table of Contents Ex. 2-2 Data Computation Unit DISCUSSION Introduction Accumulators and operand registers Multiply-and-Accumulate Units (MACs) Arithmetic Logic Unit (ALU) Barrel shifter Basic Instructions Addition Subtraction And Or Not Sign-extension mode The MAC: basic operations Operations: overflow, underflow, and saturation mode Status bits Parallelism PROCEDURE Set up of the DSP board Testing the program Basic operations Sign extension Overflow, saturation mode and carry bit Parallelism Ex. 2-3 Memory DISCUSSION Unified memory Linker command file PROCEDURE Set up and connections of the DSP board Testing the program bit sampling bit sampling using μ-law compression bit sampling bit sampling using the flash memory Exploring the memory spaces Festo Didactic VII

8 Table of Contents Ex. 2-4 Addressing DISCUSSION Addressing Absolute addressing Direct addressing Indirect addressing Circular buffering Borderline cases Implied addressing Immediate addressing PROCEDURE Set up and connections of the DSP board Listening to the output signal Observing addressing modes in action Observing the averaged signal with an oscilloscope Unit 3 I/O and Peripherals DISCUSSION OF FUNDAMENTALS Peripherals, Inputs and Outputs (I/O) Codec Ex. 3-1 An Application Using I/Os and Peripherals DISCUSSION List of peripherals used by the application Excerpts of the code of the application PROCEDURE Set up and connections of the DSP board Initialization functions Setting up the application Peripheral registers I 2 S peripheral DMA peripheral Unit 4 DSP Real-time Processing DISCUSSION OF FUNDAMENTALS Sampling and analog/digital conversion Using transforms Fourier transforms Types of Fourier transforms Using FFT library functions VIII Festo Didactic

9 Table of Contents Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion DISCUSSION Analog and digital signals Analog-to-digital conversion Analog signals Sampling Quantization Conversion to binary code words A/D and D/A converters The importance of sampling rate Aliasing Ideal sampling The Sampling Theorem Digital-to-analog conversion The sampling application used in this exercise PROCEDURE Set up and connections Time-domain observations Frequency-domain observations Ex. 4-2 The FFT and Optimizing DSP applications DISCUSSION The discrete Fourier transform (DFT) Basis functions Basis functions for a 16-point DFT How it works An example Correlation Correlation formula for the real DFT Calculating the magnitude spectrum More examples Spectral leakage The fast Fourier transform (FFT) Using the FFT Optimizing an FFT application Library functions Code optimization Using complier intrinsics Optimizing with compiler options Hardware FFT accelerator The FFT application used in the exercise Festo Didactic IX

10 Table of Contents PROCEDURE Set up and connections Using the sine-wave signal generator FFT display Observing output in Code Composer Spectral leakage Optimization Analyzing an external signal Unit 5 Signal Processing Applications DISCUSSION OF FUNDAMENTALS Signal processing applications Ex. 5-1 Applications: FIR and IIR Filters DISCUSSION Time and frequency domains Filters Digital filters FIR filters IIR filters PROCEDURE Set up and connections Testing the FIR filter Testing the IIR filter Appendix A Equipment Utilization Chart Appendix B Glossary of New Terms Appendix C Installation of Code Composer Appendix D Program Descriptions Appendix E Answers to Unit Test Questions Index of New Terms Acronyms Bibliography X Festo Didactic

11 Preface Digital signal processing is an extremely powerful technology that is rapidly changing our world. Thanks to digital signal processing, profound improvements have already been made in many areas of science, engineering and consumer products, covering many fields including: telephony and telecommunications space communications sound and music recording and reproduction video compression spectral analysis speech recognition and generation image processing and medical imaging radar and sonar industrial nondestructive testing simulation and modeling Conventional analog signal processing uses electronic components such as amplifiers, resistors, capacitors and inductors in order to modify signals in real time. Although these components are inexpensive and easy to assemble, they are often difficult to design, calibrate and modify. Digital signal processors (DSPs), on the other hand, are specialized microprocessors that manipulate numbers. An analog signal must first be sampled and converted to digital form in order to be processed by a DSP and, in many cases, must be converted back to analog form after processing. Once the signal is in digital form, a DSP uses mathematical operations determined by a computer program in order to manipulate the signal. This gives the DSP incredible flexibility in the types of processing available. It also make the processing easy to modify and perfectly reproducible. The processing carried out by a DSP is usually done in real time. This means that the data is processed as fast as it comes into the DSP system. In order to accomplish this, DSPs are specially designed to process vast quantities of data very quickly and use algorithms that are very efficient. The difficulty one encounters when studying digital signal processing is that there is a great deal to learn before you begin to use DSPs. This manual provides a general introduction to DSPs including the following topics: important concepts in digital signal processing the architecture of DSPs, memory and peripherals commonly-used DSP algorithms a typical programming environment used to develop, debug and compile DSP applications The most common programming language used to develop DSP programs is the C language. Although this manual does not teach C language programming, it invites you to examine several C language DSP programs that have been prepared in advance. Festo Didactic XI

12 Preface Do you have suggestions or criticism regarding this manual? If so, send us an at The authors and Festo Didactic look forward to your comments. XII Festo Didactic

13 About This Manual Manual objectives When you have completed this manual, you will have been introduced to the field of digital signal processing. You will be familiar with a typical DSP and with its architecture, memory, arithmetic and several of its peripherals. You will also be familiar with Code Composer from Texas Instruments, a typical integrated development environment used to develop, debug and compile DSP programs. You will also be familiar with two important aspects of DSP real-time processing, first with the subject of sampling and conversion of signals between analog and digital representations, and secondly, with the use of transforms to convert a signal from one form to another. A commonly-used transform, the fast Fourier transform, is used as an example. Finally, you will have studied several signal processing applications with emphasis on digital filter applications. Safety considerations As the equipment used in this manual operates at low voltage, no special safety measures need to be taken. Safety symbols that may be used in Lab-Volt manuals and on the Lab-Volt equipment are listed in the Safety Symbols table at the beginning of the manual. Reference material The DSP Resource Disc contains the programs used in this manual as well as reference documents. Refer to Appendix C for information on installing Code Composer. Prerequisites There are no special prerequisites for this manual. Some familiarity with computer programming, particularly with the C language, would be helpful. Although some mathematical equations are presented in order to explain certain algorithms, you are not required to use these equations during the exercises. Festo Didactic XIII

14

15 To the Instructor You will find in this Instructor Guide all the elements included in the Student Manual together with the answers to all questions, results of measurements, graphs, explanations, suggestions, and, in some cases, instructions to help you guide the students through their learning process. All the information that applies to you is placed between markers and appears in blue. Accuracy of measurements The numerical results of the hands-on exercises may differ from one student to another. For this reason, the results and answers given in this manual should be considered as a guide. Students who correctly performed the exercises should expect to demonstrate the principles involved and make observations and measurements similar to those given as answers. Festo Didactic XV

16

17 Samples Exercises Extracted from the Student Manual and the Instructor Guide

18

19 Exercise 2-4 Addressing EXERCISE OBJECTIVE When you have completed this exercise, you will be familiar with the addressing modes available to the DSP, including the circular buffer. DISCUSSION OUTLINE The Discussion of this exercise covers the following points: Addressing Absolute addressing Direct addressing Indirect addressing Circular buffering. Borderline cases Implied addressing. Immediate addressing. DISCUSSION Addressing A processor uses an address to identify specific memory storage spaces, such as a DARAM memory element or a peripheral register. An address becomes the reference for a certain memory location. It is used anytime the processor requires to write in or read an operand from a location. An addressing mode is a method used to specify the operand(s) of a machine code instruction. It describes to the processor the method that is used for storing and retrieving data from memory. The DSP uses addressing to gain access to the data memory, to MMR, to register bits, and to the I/O space. There are three types of addressing modes supported by the TMS320C5535: Absolute addressing references a location by supplying all or part of an address as a constant in an instruction. Direct addressing references a location using an address offset. Indirect addressing references a location using a pointer. Depending on the addressing mode used with an instruction, an operand could be fetched directly from an internal memory address or from a register. Different types of DSPs offer a variety of different addressing modes. The type of mode chosen with an instruction greatly influences the flexibility and performance of a program. Certain types of addressing are meant to be used in specific situations while others are restricted for use by a small subset of processor instructions. Festo Didactic

20 Ex. 2-4 Addressing Discussion Absolute addressing Absolute addressing is used to handle data that is located at a memory address which is constant. An exact address must be given to the instruction. This can be done either by explicitly stating a 23-bit constant or a 16-bit constant combined with the high-part of the extended data page register (a sort of bookmark). The specified address is part of the instruction code and cannot be modified without amending the source code and rebuilding the machine code. Example: Instruction: mov #456,*(#0018e4h) Instruction code: fb3101c80018e4 The value 456 (or 1C8 h ) is moved into the memory at address 0x000018E4. This address is directly included in the instruction code. This is a case of absolute addressing. Absolute addressing is used when the address of the operand is fixed. Variables with constant addresses are known as static variables. Direct addressing Direct addressing is a mode in which the program makes use of the address of a variable. This address is called explicitly using operator. In the following example, the address of register BK03 is passed to the function mmap: mov mmap(@bk03),ac0 This type of access can be performed in one of two ways, either using the data page pointer or the stack pointer. This method is more flexible as the address of a variable is decided upon when the program is compiled. This address is changed automatically if modifications are made to the program when the code is recompiled. Indirect addressing The indirect addressing mode makes use of the concept of pointers. A pointer is a variable which contains an address. The asterisk or star (*) operator can be used in front of a pointer to access the contents of the memory located at the address memorized in the pointer variable. This concept exists in the C language. In Assembly, an auxiliary register ARn ( ) is used to point to data in memory. In Figure 2-18, a variable var1 is a pointer located at address The memory at this address contains the number 02C009 which is the address of another variable: var2, an integer. It can thus be said that var1 points to var2. Consequently, *var1 is equal to the value of var2 (000123). 108 Festo Didactic

21 Ex. 2-4 Addressing Discussion Variable Name Memory Address Memory Content In the following example: mov AC1,*AR1 Figure The concept of a pointer in computer science. the AR1 (Auxiliary Register 1) label refers to the address of this auxiliary register in memory. *AR1 thus contains the address of a memory location of interest. The star operator accesses the contents of the AR1 register. It is also possible to use built-in tools to operate on pointers such as in the instruction: mov AC1,*AR1+ In this example, the content of the AR1 register (an address) is used in the mov instruction, but AR1 is incremented by one after the access. Circular buffering Pointers offer the flexibility to implement what is known as circular buffering (or addressing). The idea is to be able to store a fixed number of samples in memory while continuously updating the oldest ones as new samples are acquired. Festo Didactic

22 Ex. 2-4 Addressing Discussion To do so, a pointer is used. In our example AR0 is selected, but any of the eight auxiliary registers (ARn) or the coefficient data pointer (CDP) could be used on the TMS320C5535 DSP. A bit in the status register (ST2_55(0) = AR0LC) is set to allow circular buffering and the size of the buffer is stored in the buffer size register BK03. The starting address of the buffer is stored in BSA01. Whenever a new sample is written in the buffer, it is written in the position pointed by AR0 and AR0 is then incremented by one to point to the next spot in the buffer. The process goes on until the end on the buffer is reached; the following sample is then recorded at the beginning of the buffer and the pointer is reinitialized. Pointer Pointer Pointer a) b) c) Figure An example of circular buffer (four elements). In Figure 2-19a, a collection of samples is in the buffer and the pointer is pointing to the third element. A new sample (1234) is obtained. It is recorded as instructed by the pointer over the old value (3251) and the pointer is incremented by one position (the result is shown in Figure 2-19b). A new sample is obtained (5678) and is recorded in the last element of the buffer. The pointer is again incremented by one and is placed back to the first element, ready to record further samples in the circular buffer. Circular buffers are efficient because only a single value needs to be modified when a new sample is acquired and the whole array is readily available for calculations in-between sample acquisitions. They are known as circular buffers because the end of the linear array is connected to its beginning as if they were next to one another. Borderline cases Implied addressing The implied addressing mode (also known as implicit addressing) is one in which the address of an operand (either the source, the destination, or both) is not explicitly given for an instruction. The address of the operand is instead implied. This was used quite a lot in the past when processors had less registers or when dedicated registers are used for certain operations. For example, in the case where a MAC instruction automatically accumulates the result of the operation in the ACC accumulator, the instruction would be: MACM *(_x), T0 (Older DSP) 110 Festo Didactic

23 Ex. 2-4 Addressing Procedure Outline Contrast this with the current form of the instruction: MACM *(_x), T0, AC1 (TMS320C5535 DSP) In the first case, the destination of the result (ACC) was not specified, as it is implied with that DSP that all MAC results are accumulated in ACC. In the second case, the destination is specified (AC1). This gives more flexibility (AC0, AC2, etc. could also be used) to the programmer at the cost of more information being required. Implied addressing is simply a tool which makes possible the use of a shorthand notation for some instructions. Immediate addressing The immediate addressing mode does not use an address and is pretty much a misnomer. This case is not considered to be an addressing mode on many processors. It might be encountered in some contexts and is presented for this reason. Immediate addressing is the process by which an instruction uses an operand whose value is given within the instruction itself instead of being in memory. The operand is a constant which is explicitly contained in the instruction, such as #000000h in the following example: amov #000000h, XAR1 The constant 0 h is explicitly written in the instruction and the DSP does not need to access a memory case to obtain its value and place it in the XAR1 register. The constant is specified in the instruction code and becomes part of the machine code after the linking process. It consequently cannot be modified without rebuilding the output file. The # prefix is used to specify immediate addressing, unless not required by an instruction (in instructions that do not support any other mode, for instance). PROCEDURE OUTLINE The Procedure is divided into the following sections: Set up and connections of the DSP board Listening to the output signal Observing addressing modes in action Observing the averaged signal with an oscilloscope PROCEDURE Set up and connections of the DSP board 1. Perform the connections shown in Figure You can also connect the input of the microphone pre-amplifier to the audio output jack of your computer if you prefer to use an audio signal from your computer. Festo Didactic

24 Ex. 2-4 Addressing Procedure Figure Connections of Ex. 2-4 First part. 2. Connect the DSP board to your computer using USB port number 2 on the board and a standard USB port on your computer. Make sure that the circuit board power source is turned ON and that the Code Composer software is installed as explained in Appendix C. Launch Code Composer on your computer. 3. Make exercise_2_4 the active project simply by clicking on that project in the Project Explorer window. Open both the main.c and LVex2_4.asm files of this exercise Launch the Debug mode by clicking the DSP. icon to load the program into the 4. Press the run button to run the program on the board. At this point, you should see the following information on the LCD of the DSP circuit board: LabVolt Ex2-4 Signal Averaging This program allows the DSP to record an analog signal in a circular buffer containing sixteen samples. The average of the samples is calculated and the result is sent out as the analog output of the DSP. 112 Festo Didactic

25 Ex. 2-4 Addressing Procedure Listening to the output signal 5. Speak in the microphone (or play a sound file on your computer) as you listen to the resulting sound out of the DSP on the loudspeaker or headphones. How is the output signal affected by the DSP algorithm? The sound is not as sharp as the original signal. Higher frequencies (high register notes) are dampened. The averaging process acts as a sort of lowpass filter for the signal. Observing addressing modes in action 6. Click on the icon to halt the execution of the code. In the LVex2_4.asm file, observe the _initcb section of code. This part is used to initialize the circular buffer. The number of elements is set to 16, the DSP is configured to operate with circular buffers, and the index is set to Go to the _initdone part of the file and locate the mov mmap(@bk03), AC0 instruction. Insert a breakpoint at this line (below identifier ;Breakpoint #01) and press the icon to execute the program up to that point. Which type of addressing is used with regards to BK03? Direct addressing In the Disassembly window, observe the opcode associated to the instruction. What is the code? a032_98 8. Go to the amov #000000h, XAR1 instruction. Insert a breakpoint at this line (below identifier ;Breakpoint #02) and press the icon to execute the program up to that point. Which type of addressing is used? Immediate addressing In the Disassembly window, observe the opcode associated to the instruction. What is the code? What happens to the constant? ec319e Note that the constant (000000) is directly contained in the opcode. Festo Didactic

26 Ex. 2-4 Addressing Procedure 9. Go to the mov AC1,*AR1+ instruction. Insert a breakpoint at this line (below identifier ;Breakpoint #03) and press the icon to execute the program up to that point. Which type of addressing is used? Indirect addressing In the Disassembly window, observe the opcode associated to the instruction. What is the code? c Add the following two variables to the Expressions window: average and recbuff. The average variable contains the result of the sum of the samples divided by 16, that is, the average of the samples. The recbuff variable is a table containing sixteen different samples from the signal used in the circular buffer. 11. Edit the different elements of recbuff to values of your choice from the Expressions window. What is the number of samples stored in the table? What is the size (in bits) of each sample? There are 16 samples in the table. Each sample has a size of 16 bits, for a total of 256 bits. 12. Go to the mov HI(AC0<<#12),*(_average) instruction. Insert a breakpoint at this line (below identifier ;Breakpoint #04) and press the icon to execute the program up to that point. Press the assembly step into button to execute the current line. What is the result of the average of the different samples? Does it correspond to the average of the numbers you entered in recbuff? The result should be the average of the samples entered at the previous step in the recbuff table, rounded down. 13. Remove all breakpoints inserted so far. 114 Festo Didactic

27 Ex. 2-4 Addressing Procedure Observing the averaged signal with an oscilloscope 14. Modify the setup and perform the connections shown in Figure Signal generator Oscilloscope Figure Connections of Ex. 2-4 Second part. The CODEC is designed for low-voltage signals with a maximum input voltage of ±0.9 V. When using an external signal source, make sure the voltage at the ANALOG INPUT is within this range. Exceeding this voltage range could permanently damage the board. 15. Use a signal generator to produce a sinusoidal waveform with an amplitude of 0.4 V and a frequency of 100 Hz. Observe both the input signal (Channel 1) and the DSP output signal (Channel 2) on an oscilloscope. What does the signal look like? Festo Didactic

28 Ex. 2-4 Addressing Procedure The signal is basically another sinusoidal waveform. The input (CH1) and output (CH2) signals for a sinusoidal waveform. Is the output signal in sync with the input signal? No, the output signal is slightly delayed. What is the amplitude of the output signal? The amplitude is about 1.1 V. How is the quality of the output signal? The output signal is slightly fuzzier than the original one. 16. Increase the frequency of the signal to 800 Hz. Observe both the input signal (Channel 1) and the DSP output signal (Channel 2) on an oscilloscope. 116 Festo Didactic

29 Ex. 2-4 Addressing Procedure Is the output signal in sync with the input signal? No, the output signal is slightly delayed. What is the amplitude of the output signal? The amplitude is about 0.25 V. How is the quality of the output signal? The output signal is fuzzier than the original one. 17. Change the frequency of the signal to 450 Hz. Observe both the input signal (Channel 1) and the DSP output signal (Channel 2) on an oscilloscope. Is the output signal in sync with the input signal? No, the output signal is almost inverted with respect to the original signal. What is the amplitude of the output signal? The amplitude is about V. How is the quality of the output signal? The output signal is fuzzier than the original one. 18. Use a signal generator to produce a triangle waveform with an amplitude of 0.4 V and a frequency of 100 Hz. Observe both the input signal (Channel 1) and the DSP output signal (Channel 2) on an oscilloscope. Festo Didactic

30 Ex. 2-4 Addressing Procedure What does the signal look like? The signal is close to being a sinusoidal waveform. The averaging algorithm smoothes the original signal. There is a delay between the two. The input (CH1) and output (CH2) signals for a triangle waveform. 19. Use a signal generator to produce a square waveform with an amplitude of 0.4 V and a frequency of 180 Hz. Observe both the input signal (Channel 1) and the DSP output signal (Channel 2) on an oscilloscope. What does the signal look like? 118 Festo Didactic

31 Ex. 2-4 Addressing Conclusion The signal looks like a triangular waveform, but it saturates, as the average of a plateau cannot be higher than the plateau itself. There is also a delay between the two signals. The input (CH1) and output (CH2) signals for a square waveform. 20. Click on the icon to terminate the execution of the program. Return to the projects tab and quit Code Composer. Turn OFF the power supply and remove the connections (leads) you made on the circuit board. CONCLUSION This exercise illustrated the requirement for the processor to access data at different addresses using different types of addressing modes. The special case of the circular buffer was presented to demonstrate that certain modes of addressing are meant to be used for specific situations. The type of addressing used has a large influence over the performance and flexibility of a program. REVIEW QUESTIONS 1. What are addressing modes? a. The addresses in a set that occur the most frequently b. Possible configurations of a postal service sorting facility Festo Didactic

32 Ex. 2-4 Addressing Review Questions c. Different methods to access information in memory, either to read it or write over it d. Techniques to speak at an assembly in an informal way c. Different methods to access information in memory, either to read it or write over it 2. Pointers are associated to: a. Absolute addressing b. Direct addressing c. Indirect addressing d. Implied addressing c. Indirect addressing 3. Which mode is associated to a constant address explicitly specified in the instruction? a. Absolute addressing b. Direct addressing c. Indirect addressing d. Implied addressing a. Absolute addressing 4. Which mode is associated with operator to specify a call of the address of a variable in the instruction? a. Absolute addressing b. Direct addressing c. Indirect addressing d. Implied addressing b. Direct addressing 5. A circular buffer requires: a. A circular memory chip b. A data pointer c. A buffer size register 120 Festo Didactic

33 Ex. 2-4 Addressing Review Questions d. Both b. and c d. Both b. and c Festo Didactic

34

35 Exercise 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion EXERCISE OBJECTIVE When you have completed this exercise, you will be familiar with the basic principles that allow a digital device, such as a DSP, to interact with analog signals. DISCUSSION OUTLINE The Discussion of this exercise covers the following points: Analog and digital signals Analog-to-digital conversion Analog signals. Sampling. Quantization. Conversion to binary code words. A/D and D/A converters The importance of sampling rate Aliasing. Ideal sampling. The Sampling Theorem. Digital-to-analog conversion The sampling application used in this exercise DISCUSSION Analog and digital signals Physical phenomena, such as sound, produce signals that are in analog form. In order to be processed by a DSP, an analog signal must be converted to digital form (digital data). After processing, the digital data produced by the DSP is often converted back into analog form. The conversion from analog to digital form and from digital to analog form is performed by a CODEC (COder and DECoder). As already mentioned, a typical CODEC is made up of the following components: A programmable input gain (A), used to amplify the amplitude of the input signal as required. An anti-aliasing filter, used to restrict the bandwidth of the input signal so as to satisfy the sampling theorem and avoid ambiguous interpretations of the signal from its samples. (The sampling theorem is explained in this Discussion.) An analog-to-digital (A/D) converter. This component samples the filtered analog signal and converts it to a series of numbers that represent the amplitude of the signal. A digital-to-analog (D/A) converter. This component converts the digital signal (a series of number representing amplitudes) into a continuous analog signal. A post filter that removes unwanted harmonics in the signal. This is a low-pass filter. Festo Didactic

36 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion In this Discussion, we will first examine the analog-to-digital conversion process in order to show the consequences of this conversion on the signal and to understand why an adequate sampling rate and an anti-aliasing filter are necessary. Analog-to-digital conversion An A/D converter performs the conversion from analog to digital form very rapidly. In order to understand how the conversion process works, it can be broken down into three distinct steps (some A/D converters perform the three steps simultaneously). These three steps are Sampling Quantization Conversion to binary code words Analog signals A signal is a description of how one variable, such as voltage, is related to another variable, such as time. When both variables can assume a continuous range of values, the signal is called a continuous signal. Such a signal can be represented mathematically as a function, for example,, where is a voltage that varies continuously with time, as shown as a blue trace in Figure 4-4. (For simplicity, all values in this figure are positive.) Voltage Time t Figure 4-4. Analog signal and samples. The horizontal axis ( -axis, or abscissa) of the graphed function represents the independent variable which is also called the domain. The vertical axis (y-axis or ordinate) represents the dependent variable. The function describes how the dependent variable varies with respect to the independent variable. When time is the domain of the function, as is often the case in electronics, the function is said to be in the time domain. An oscilloscope displays signals in the time domain. However, other parameters could be used as the domain. When frequency is the domain, the function is said to be in the frequency domain. A spectrum analyzer display signals in the frequency domain. 150 Festo Didactic

37 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion The independent variable can be any measurable parameter such as pressure, sound intensity, voltage or current. In many cases, a transducer produces a continuous voltage or current that represents a physical parameter. For example, a microphone produces a continuous voltage that represents a continuously varying sound intensity. The continuous voltage is called an analog signal because it is analogous to another continuous signal. Sampling If an analog signal is time sampled, that is, its instantaneous voltage is measured periodically at times,,,, the result is a series of sample values,,, that make up a discrete-time signal, or simply, a discrete signal. The series of red bars in Figure 4-4 present an example of such a signal. The height of each bar represents the exact voltage that was measured at the sample time. Although there are now only a finite number of samples in a given time interval, each sample can take on an infinite number of possible values, between a certain minimum and maximum. Quantization If, instead of an infinite number of possible values for each sample, there is only a discrete set of values available, the measured voltage of each sample must be rounded off to the closest available value. This is illustrated by the red bars in Figure 4-5, where each sample value is rounded off to the nearest volt. The process of constraining something from a continuous set of values to a discrete set is called quantization. Quantization of a sampled signal produces a discretetime signal with discrete values Voltage Time t Figure 4-5. Analog signal and quantized samples. Festo Didactic

38 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion In this example, a very small number of discrete values (multiples of 1 V) are available. The resolution of the quantizer is therefore 1 V. In a real application, many values would be available and the resolution would be much smaller. The resolution of the quantizer is its step size, that is, the difference between adjacent levels. Note that there is a difference between the quantized voltage of each sample and the original analog voltage. This difference is called quantization error or quantization distortion and is introduced by the rounding process. It often results in a perceptible noise called quantization noise. Quantization error can be reduced by using a higher resolution (smaller step size). Conversion to binary code words In order for the DSP to be able to process a sampled and quantized signal, the signal must be represented in digital form, that is, by binary numbers made up of 1s and 0s. These binary numbers are often called code words. In this example, only 16 code words are used (from 0000 to 1111). In a real application, many code words would be used. Table 4-1 shows an example of the entire analog-to-digital conversion process. Each sampled voltage is quantized and then converted to a binary code word. In this example, the value of each code word simply equals the quantized voltage (0001 corresponds to 1 V, 0010 to 2 V, etc.). Table 4-1. Binary representation of a digital signal. Time Sampled voltage Quantized value Code word Each code word of a digital signal represents only an approximation of the sampled voltage of the original analog signal. This approximation can be made to be as accurate as desired by increasing the resolution, which increases the number of values available and therefore the number of bits in each code word. There are disadvantages, however, associated with increased resolution. An A/D converter with a higher resolution is more costly than one with low-resolution. In addition, the larger code words produced require more memory to store as well as more time to transfer and to process. For real-time processing of larger code words, a more powerful and more costly DSP may be required. For these reasons, a DSP application should use the lowest resolution that will produce acceptable results. 152 Festo Didactic

39 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion A/D and D/A converters The entire process of converting an analog signal to digital form is called analogto-digital (A/D) conversion. The inverse process is called digital-to-analog (D/A) conversion. Figure 4-6 illustrates the analog-to-digital converter (A/D converter or ADC) in a typical CODEC. This converter periodically samples the amplitude of an analog signal and converts it into a digital signal consisting of a series of code words. Code Words Analog Signal (continuous waveform) Analog to Digital Converter (ADC) Figure 4-6. An analog-to-digital converter. In order to convert a processed digital signal to an analog signal, a CODEC includes a digital-to-analog converter (D/A converter or DAC), illustrated in Figure 4-7. Since there are only a limited number of code words used, the resulting signal is a staircase waveform containing steps or transitions. These steps result in unwanted harmonics in the signal. Of course, the greater the resolution, the smaller the steps. Code Words Digital to Analog Converter (DAC) Analog Signal (staircase waveform) Figure 4-7. A digital-to-analog converter. The CODEC includes a low-pass post filter which removes the high-frequency harmonics leaving (hopefully) a continuous analog signal with the desired waveform. In a digital communication system, the original analog signal is called the message signal. The message signal is A/D converted at the transmitter and D/A converted at the receiver. The D/A converted signal at the receiver is called the reconstructed signal. The objective with a digital communication system is to have the reconstructed signal resemble the message signal as closely as possible. Festo Didactic

40 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion Examples of the type of processing that a DSP could perform on the digital data is filtering, noise removal, or adding special effects, such as echo or flanging. With DSP applications, however, the DSP usually processes the digital data in order to modify it before it is reconverted to analog form. The resulting analog signal may be very different from the original analog signal. In both types of systems, however, an adequate resolution and sampling rate must be used in order to obtain the desired results. a In this exercise, the CODEC samples and A/D converts an analog signal to digital data, and then D/A converts the unmodified data in order to reconstruct the analog signal. We will refer to the input analog signal as the message signal and the D/A converted and post-filtered signal as the reconstructed signal. The importance of sampling rate When an analog signal is sampled, some information is lost. (This is true even if the signal is quantized using a very high resolution.) For example, after sampling the analog signal in Figure 4-4, the only information retained is the quantized voltage of the individual samples. No record of what happens between samples is kept. In order to reconstruct a signal correctly, it is essential that the samples adequately represent the analog message signal. This is possible only if the rate at which the message signal was sampled is sufficiently high. The rate at which the samples are taken is called the sampling rate. The time between consecutive samples is called the sampling period. Aliasing A simple theorem allows you to determine the minimum sampling rate that can be used to sample an analog signal while conserving the important information. When the sampling rate is less than this minimum rate, a phenomenon called aliasing occurs which produces distortion in the received signal. If there is no aliasing, the post filter in a CODEC easily removes the undesired harmonics that result from D/A conversion. If aliasing occurs, however, it causes distortion that no filter can remove. Figure 4-8 shows the time-domain samples of an analog waveform. This waveform was sampled at a sampling rate. The time between samples, or sampling period,. 1.0 Amplitude (V) Time (ms) -1.0 Figure 4-8. Time-domain samples (discrete time-domain signal). 154 Festo Didactic

41 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion At first glance, the samples in Figure 4-8 seem to come from a sine wave message signal with a period, that is, with frequency. Recall, however, that the sampling process loses all information between the samples. Therefore, there is no guarantee that the samples in Figure 4-8 actually come from a 125 Hz sine wave. Figure 4-9 shows two different waveforms that could produce these samples. The blue waveform is 125 Hz sine wave. The red waveform has a much higher frequency (875 Hz) but produces exactly the same samples. 1.0 Amplitude (V) Time (ms) -1.0 Figure 4-9. Time-domain samples and two possible waveforms. Theoretically, there are an infinite number of waveforms, of higher and higher frequencies, that could produce exactly the same samples. Aliasing is the phenomenon by which different waveforms can produce the same samples. Aliasing is a potential problem in any discrete time system because it can cause distortion or even make the signal unrecognizable. Suppose the red waveform in Figure 4-9 is A/D converted by a CODEC, producing the green samples. These sample values are stored in the DSP memory. Then, the samples are D/A converted in order to reconstruct the analog signal. The reconstructed analog signal will resemble the blue waveform and not the original red waveform. This is clearly something you do not want in a DSP system. Although Figure 4-9 shows an example of aliasing in a time-domain representation, aliasing is easier to understand by looking at the signals in the frequency domain. Ideal sampling Before we examine how a DSP CODEC actually samples and reconstructs signals, we will consider a theoretical concept called ideal sampling. Ideal sampling involves multiplying the message signal with a sampling signal which consists of pulses of infinitesimal width. Figure 4-10a shows a message signal. For the sake of this example, the message signal is sinusoidal. Figure 4-10b shows a series of infinitesimal-width pulses of unity amplitude. This is called the sampling signal. Festo Didactic

42 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion Multiplying the message signal by the sampling signal gives the sampled signal in Figure 4-10c. This is a discrete analog signal. At every sampling instant, the amplitude of the sampled signal is equal to the amplitude of the message signal. Between the sampling instants, the amplitude of the sampled signal is zero. 1.0 a) Message signal Amplitude (V) Time (ms) b) Sampling signal Amplitude (V) Time (ms) c) Sampled signal Amplitude (V) Time (ms) -1.0 Figure Time-domain representation of ideal sampling. Figure 4-11a shows the frequency spectrum of the message signal as it would be displayed on a spectrum analyzer. Since the message signal contains only one sinusoidal frequency component, whose frequency is there is only one peak in the frequency spectrum. To the instructor For simplicity, Figure 4-11a shows the message signal spectrum as being single-sided. Many references show this spectrum as being double-sided, that is, containing both a positive frequency component and a negative frequency component. In this case, the message signal spectrum has two components and each replica is an exact copy of the message signal spectrum shifted to a multiple of the sampling rate. 156 Festo Didactic

43 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion a) Message signal Magnitude Frequency Low-pass filter Replica Replica b) Sampled signal Magnitude Frequency Figure Frequency-domain representation of ideal sampling. Figure 4-11b shows part of the frequency spectrum of the sampled signal. In addition to the message signal, the spectrum shows replicas of the message signal spectrum located at multiples of the sampling rate. Each replica has two components, one located below and one above a multiple of the sampling rate. The frequencies of these replica components are,,, With ideal sampling, there are an infinite number of replicas in the spectrum, all at multiples of the sampling rate, and each replica has the same magnitude as the message signal. The dotted green line in Figure 4-11b shows the frequency response of a lowpass filter. If this filter is used to filter the sampled signal, the filter would completely remove the replicas of the sampled signal leaving only the original (reconstructed) message signal. Figure 4-12 shows what happens when the frequency of the sinusoidal message signal is increased. The peak corresponding to the message signal moves to the right. In addition, the two peaks of each replica move apart. The message signal is now near the cutoff frequency of the low-pass filter. Under these conditions, the low-pass filter could still remove the replicas in order to reconstruct the message signal from the sampled signal. Festo Didactic

44 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion a) Message signal Magnitude Frequency b) Sampled signal Magnitude Frequency Figure The effect of increasing the message signal frequency ( ). Figure 4-13 shows what happens when the message signal frequency reaches half the sampling rate. The spectrum of the message signal and the lower part of the first replica now coincide. Sampled signal Magnitude Frequency Figure The effect of making the message signal frequency. In Figure 4-14, the message signal frequency is now greater than half the sampling rate. Aliasing has occurred and this figure shows its effect in the frequency domain. The lower part of the first replica is now below the message signal frequency and has moved into the pass band of the low-pass filter. It is therefore impossible to reconstruct the message signal by filtering the sampled signal. The filtered signal would contain only the frequency. Sampled signal Magnitude Frequency Figure The effect of making the message signal frequency. 158 Festo Didactic

45 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion The above example illustrated aliasing using a message signal containing a single frequency. In most cases, the message signal contains a range of frequencies, as shown in Figure The message signal in Figure 4-15a represents a typical band-limited signal containing frequencies ranging from near 0 Hz to. Figure 4-15b, c, and d show the effect on the spectrum of the sampled signal of reducing the sampling rate. a) Message signal Magnitude Frequency Low-pass filter b) Sampled signal Magnitude c) Sampled signal Magnitude d) Sampled signal Magnitude Figure The effect of reducing the sampling rate. In Figure 4-15b, the sampling rate is high enough so that the replicas are spread far apart. In this case, a low-pass filter could easily remove the replicas in order to reconstruct the message signal. In Figure 4-15c, the sampling rate has been reduced to. The replicas now touch each other. A very sharp filter could, in theory, remove the replicas and reconstruct the message signal. Festo Didactic

46 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion In Figure 4-15d, the sampling rate has been reduced below. The frequency range occupied by the first replica now overlaps that of the message signal and the filter can no longer completely remove the replicas. In this case the reconstructed signal will contain undesired frequency components (distortion). The Sampling Theorem Figure 4-15 is an illustration of the Sampling Theorem, which can be stated as follows: A band-limited signal of maximum frequency, when sampled at regular intervals at a rate of at least, can be completely reconstructed from these samples with no distortion. A signal waveform can therefore be properly represented if at least two samples are taken for every cycle of the highest significant signal frequency. This minimum theoretical sampling rate 2f max is known as the Nyquist rate. In actual DSP systems, the sampling rate is always chosen to be somewhat higher than the Nyquist rate. For any particular sampling rate, the Sampling Theorem is respected only if all frequency components of the message signal are less than. Any frequency component greater than will cause aliasing. Digital-to-analog conversion One more detail is necessary in order to understand how the DSP CODEC samples and reconstructs analog signals. The previous examples used ideal sampling, which is a theoretical concept. A practical digital system operates differently. An A/D converter periodically detects the amplitude of the input analog signal at very brief sampling instants. In a sense, this resembles ideal sampling. The difference between ideal sampling and a practical system lies in the operation of the D/A converter. Instead of producing pulses of infinitesimal duration, the D/A converter uses a sample-and-hold technique, that is, the analog voltage at the D/A output (before the post filter) is held constant between samples. The sample-and-hold reconstruction technique concerns D/A conversion and not the sampling process used for A/D conversion. Nonetheless, the term flat-top sampling is sometimes used to describe the resulting signal. This sample-and-hold reconstruction technique, which is sometimes referred to as flat-top sampling, is illustrated in Figure Festo Didactic

47 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion 1.0 a) Message signal and sample values Time b) Samples values and D/A converted signal Time -1.0 c) D/A converted signal spectrum Envelope Frequency Figure Sampling and sample-and-hold reconstruction. Figure 4-16a shows the analog message signal (the blue trace) and the amplitude samples (the green squares) obtained by the sampling process. These sample values are A/D converted and stored in memory. Figure 4-16b shows what the analog output signal of the D/A converter would look like if it simply output the stored sample values. The output voltage is held constant between samples, resulting in a staircase waveform. The magnitudes in the spectrum are multiplied by a the factor Figure 4-16c shows the consequences in the frequency domain of holding the output value constant between samples. The frequency response of the D/A converter is not uniform. Instead of all replicas having the same amplitude, as with ideal sampling, the higher frequencies in the spectrum are attenuated. The spectrum appears to be multiplied by a curved envelope (shown as a dotted line). This envelope has nulls multiples of the sampling rate. where. This gives the envelope what is called the shape. Festo Didactic

48 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion Figure 4-17 shows the spectrum of a D/A converted, band-limited signal, as was shown in Figure The spectrum has the same envelope as Figure 4-15, with nulls at multiples of the sampling rate. a) Magnitude Aperture distortion b) Magnitude Frequency c) Magnitude Frequency Figure The effect on a D/A converted signal spectrum of reducing the sampling rate. In Figure 4-17a, the dotted blue line shows the spectrum of the original message signal. With ideal sampling, the message signal appears unaltered in the spectrum of the sampled signal. D/A conversion, with the output value held between samples, attenuates the higher frequencies of the D/A converted signal. This attenuation of higher frequencies is called aperture distortion. Figure 4-18 gives a closer look at aperture distortion and shows one way a DSP can be used to compensate for aperture distortion. This technique is called pre-equalizing. A digital filter implemented in the DSP program boosts the high frequencies exactly the right amount while the signal is in digital form. The D/A converter still attenuates the higher frequencies, but since they were boosted by the DSP, the result is a flat frequency response. This technique is frequently used in high-quality audio equipment such as CD players. 162 Festo Didactic

49 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Discussion Magnitude Aperture distortion Original signal Envelope Output signal First replica Frequency Magnitude High frequencies are boosted by the DSP before D/A conversion Equalized signal Envelope Output signal First replica Frequency Figure Correction of D/A converter frequency response using pre-equalizing. The sampling application used in this exercise The application used in this exercise has the following characteristics: An analog signal with a maximum amplitude of approximately ±0.75 V peak must be applied to the ANALOG INPUT. This signal is filtered by the antialiasing filter. a Voltages greater than ±0.8 V peak may result in clipping. The CODEC continuously samples the filtered ANALOG INPUT at a sampling rate determined by the INPUT DIP switch and performs the A/D conversion to obtain the digital data. (The sampling rate changes immediately when you change the DIP switch setting; it is not necessary to press in interrupt button.) The CODEC immediately performs D/A conversion of the digital data. The output voltage is held constant between samples. The post filter filters the D/A converted signal in an attempt to reconstruct the analog signal by filtering out the replicas. Festo Didactic

50 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure Outline Two output modes are available: Waveform and Spectrum: Waveform mode: The reconstructed analog signal is available at the ANALOG OUTPUT. This waveform can be observed on an oscilloscope. Spectrum mode: The frequency spectrum of the reconstructed analog signal is available at the ANALOG OUTPUT. This frequency spectrum can be observed on an oscilloscope. The output mode is selected using the button. The selected output mode is displayed on the LCD. The anti-aliasing filter at the input of the CODEC and the post-filter at the output of the CODEC can be turned on or off together using the button. The state of the filters is displayed on the LCD. Both of these filters are lowpass filters. The 3-dB cutoff frequency of these filters is fixed at approximately 3100 Hz. The LCD displays the sampling rate, the output mode and the state of the filters. PROCEDURE OUTLINE The Procedure is divided into the following sections: Set up and connections Time-domain observations Frequency-domain observations PROCEDURE Set up and connections 1. Connect the DSP board to your computer using USB port number 2 on the board and a standard USB port on your computer. Make sure that the circuit board power source is turned ON and that the Code Composer software is installed as explained in Appendix C. Set the INPUT DIP switch to Launch Code Composer on your computer. 2. Make Exercise_4_1 the active project simply by clicking on that project in the Project Explorer window. Open both the interrupt.c file of this exercise If the Breakpoints window is not visible, choose Breakpoints in the View menu. If any breakpoints are shown in this window, right-click in the window and select Remove All. Launch the Debug mode by clicking the DSP. a icon to load the program into the If you see the warning shift count is too large, you can simply ignore this warning. 164 Festo Didactic

51 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure 3. Press the run button to run the program on the board. At this point, you should see the following information on the LCD of the DSP circuit board: LabVolt Ex4-1 Sampling Rate = Hz Waveform,Filters OFF Time-domain observations 4. Make the connections shown in Figure The output of the signal generator should be connected to Ch 1 of the oscilloscope. The ANALOG OUTPUT of the CODEC should be connected to Ch 2. a Before connecting the signal generator, adjust its output level to 0 V. The CODEC is designed for low-voltage signals with a maximum input voltage of ±0.9 V. When using an external signal source, make sure the voltage at the ANALOG INPUT is within this range. Exceeding this voltage range could permanently damage the board. Signal generator Oscilloscope Figure Connections for observing sampling. Festo Didactic

52 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure 5. Table 4-2 shows the DIP switch settings to use for the different sampling rates. The application has an effective internal sampling rate of Hz ( samples per second). Lower sampling rates are obtained by decimating the samples by a factor that varies from 1 to 9. Table 4-2. Sampling rate settings (decimated from Hz). DIP SW Decimation factor Sampling rate (Hz) Sampling period (ms) or a All available sampling rates are shown in the table. Using DIP switch settings other than those shown will result in the minimum sampling rate. The LCD displays the sampling Rate. It also displays the output mode (Waveform or Spectrum) and the state of the anti-aliasing filter and post-filter (Filters OFF or Filters ON). Use the DIP switch to set the sampling rate to Hz (DIP SW: ). Use the button to set the output mode to Waveform. Use the button to turn the filters OFF. a You may have to press an interrupt button more than once to obtain the desired setting. Adjust the signal generator to produce a sine wave message signal with an amplitude of 0.7 V peak. Set the frequency of the sine wave to 300 Hz. 166 Festo Didactic

53 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure Figure 4-20 shows an example of what you should observe on the oscilloscope. Input message signal D/A converted output signal Figure Input and output signal (,, filters OFF). How does the output signal compare to the input signal? The output signal is a stepped waveform that has the same shape and frequency as the input signal 6. Use the cursors on the oscilloscope to determine the sampling period, that is, the duration of each step in the output waveform. Then calculate the sampling rate. b Measure the duration of several steps, as shown in Figure 4-21 and find the average step duration. Festo Didactic

54 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure Figure Using cursors to measure the duration of 5 steps in the output waveform. The sampling period. (The measured period may differ slightly). The sampling rate. 7. In code Composer, pause the program using the Halt button. In the file interrupt.c, find the comment //Breakpoint #01. Set a breakpoint on the line immediately below this comment by double-clicking to the left of the line number. Press the run button to run the program. It will stop after acquiring samples from the ANALOG INPUT signal, via the DMA buffer, and placing this data in the vector x. You can display a graph of the vector x in Code composer. In the Tools menu, choose Graph, then Single Time. Set the parameters as shown in Figure Festo Didactic

55 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure Figure Parameters for graphing the contents of x. Figure 4-23 shows execution stopped at the breakpoint and shows an example graph of the values in x. (The starting point of the waveform will be different each time execution reaches this breakpoint.) Figure Graph of the values in x. Does the graph of the values in x resemble the output signal waveform displayed on the oscilloscope? Yes No Yes Festo Didactic

56 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure 8. In Code Composer, deactivate or remove the breakpoint. Press the run button. Use the button to turn the filters ON. What effect do the anti-aliasing filter and the post-filter have under the present conditions? b As mentioned under The sampling application used in this exercise on page 165, the 3-dB cutoff frequency of these filters is fixed at approximately 3100 Hz. The anti-aliasing filter has little effect on the input waveform because its cutoff frequency (3100 Hz) is much higher than the input signal frequency (300 Hz). The post filter smoothes the steps in the output waveform. Input message signal Output reconstructed signal Input and output analog signal (,, filter ON). 9. Slowly increase the input signal frequency to approximately 3000 Hz. b You can listen to the output signal as you make changes. Does the output signal resemble the original analog signal? Yes No Yes 170 Festo Didactic

57 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure 10. Slowly increase the input signal frequency to approximately 4000 Hz. Explain what happens. Since the filters are ON, the output signal amplitude diminishes rapidly as the input signal frequency increases beyond 3000 Hz. At 4000 Hz, the output signal amplitude is zero. Determine the Nyquist rate for the selected sampling rate. What is the purpose of the anti-aliasing filter? The anti-aliasing filter removes high-frequency components from the input signal that could result in aliasing. Since the 3-dB cutoff frequency of the filter is approximately 3100 Hz, the filter completely removes frequencies above 4000 Hz, which is well below the Nyquist rate. 11. Set the sampling rate to 6000 Hz (set the DIP switch to ). Figure 4-24 shows an example of what you should observe. Festo Didactic

58 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure Figure Input and output signal (,, filters ON). Describe the output signal. The output signal is a sinusoidal waveform at a lower frequency than the input signal. What is the frequency of the output waveform? Explain what has happened. b If necessary, you can use vertical cursors to determine the frequency. The frequency of the output waveform is 2000 Hz. The Nyquist rate is now. Since the input signal frequency is greater than the Nyquist rate, aliasing has occurred. The output waveform is that of the first replica. Its frequency is. a Because the cut-off frequency of the anti-aliasing filter is approximately 3100 Hz, this filter cannot prevent aliasing under these conditions. 12. Set the frequency of the input signal to 1000 Hz. Use the button to turn the filters OFF. 172 Festo Didactic

59 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure Set the sampling rate to each of the values in Table 4-3 while observing the output waveform on the oscilloscope. Table 4-3. Sampling rates. DIP SW Sampling rate (Hz) Describe the output waveform with the sampling rate set to 2000 Hz and explain what is happening. With the sampling rate set to 2000 Hz, the output waveform may resemble that shown below: Original and reconstructed signal (,, filters OFF). Festo Didactic

60 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure The output waveform is almost a square wave at the same frequency as the input signal. The input message signal is being sampled at the Nyquist rate. Only two samples are taken per cycle of the waveform. 13. Set the sampling rate to 1714 Hz (DIP SW: ) and then to 1500 Hz (DIP SW: ). Describe the output waveform. With a sampling rate of 1500 Hz, the output waveform may resemble that shown below: Original and output signal (,, filters OFF). The output signal is a stepped waveform. 174 Festo Didactic

61 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure What is the frequency of the output waveform? Explain what has happened. The frequency of the output waveform is 500 Hz. The Nyquist rate is now. Since the input signal frequency is greater than the Nyquist rate, aliasing has occurred. The output waveform is that of the first replica. Its frequency is. Frequency-domain observations Frequency domain observations can be made by placing the application in the Spectrum mode. In this mode, the signal at the analog output of the CODEC contains a frequency spectrum that can be displayed on a standard oscilloscope. This will allow you to make qualitative observations in the frequency domain. In this mode, when the filters are ON, the output signal is filtered by the post filter before the spectrum is calculated. This allows you to display the spectrum of the filtered signal. a Although you can also use the Spectrum mode to determine the approximate frequencies of the frequency components in the signal, frequency measurements in this mode are very imprecise. 14. Use the DIP switch to set the sampling rate to (DIP SW: ). Use the button to set the output mode to Spectrum. Use the button to turn the filters OFF. Adjust the output level of the signal generator to 0 V. On the oscilloscope: set the Time Base to 0.5 ms/div. set the Channel 2 Scale to 50 mv/div. set the Trigger Source to Ch 2, set the Trigger Slope to Falling and set the Trigger Level to approximately V. The oscilloscope should trigger on a negative peak. If necessary, move the horizontal trigger point in order to see this peak, as shown in Figure b Adjust the Trigger Level, if necessary, to produce a stable display. Festo Didactic

62 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure Figure Setting the oscilloscope to trigger on the negative peak (Ch 2). 15. Move the horizontal trigger position to the extreme left side of the graticule. Adjust the signal generator to produce a sine wave message signal with an amplitude of 0.7 V peak. Set the frequency of the sine wave to 1000 Hz. You should see a positive peak near the middle of the first division, as shown in Figure Festo Didactic

63 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure Figure Spectrum of a 1000 Hz sine wave ( ). This positive peak represents a sinusoidal frequency of 1000 Hz. Show the vertical cursors and position a vertical cursor at the center of this positive peak. Do not move this cursor for the rest of this exercise. The oscilloscope should indicate the horizontal position of this cursor in ms. The extreme left side of the Ch 2 trace corresponds to 0 Hz (dc). The position in ms of the cursor you moved over the positive peak corresponds to 1000 Hz. 16. Set the frequency of the input message signal to 3000 Hz. The left-most positive peak should now be in the second division of the graticule and three other peaks should be visible, as shown in Figure Position a second vertical cursor vertical at the center of the left-most positive peak, as shown in Figure This horizontal position corresponds to 3000 Hz. (Do not move the cursor at 1000 Hz.) Festo Didactic

64 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure Figure Vertical cursors set at 1000 Hz and 3000 Hz. Enter the horizontal position (in ms) that corresponds to 3000 Hz in the first row of Table 4-4. Use the second cursor to determine the horizontal position of the three other peaks and enter these in Table Festo Didactic

65 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure Table 4-4. Frequency components in Figure Peak (from the left) Horizontal position (ms) Frequency (Hz) Frequency calculation in terms of and The frequency scale of the Spectrum display is roughly 4500 Hz/ms. Use this scale to determine the approximate frequencies of the last three positive peaks in Table 4-4. b Round off your answers to the nearest 5000 Hz. Festo Didactic

66 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure Table 4-4. Frequency components in Figure Peak (from the left) Horizontal position (ms) Frequency (Hz) Frequency calculation in terms of and a All values shown in this table are approximate. The input message signal frequency. In the last column of Table 4-4, express the frequency of each peak in terms of the input message signal frequency and the sampling rate. 17. Position the second cursor at 3000 Hz, as shown in Figure this cursor and the one at 1000 Hz will serve as frequency references. Set the frequency of the input sine wave to the first frequency in Table 4-5. Set the sampling rate to 6000 Hz (DIP SW: ). 180 Festo Didactic

67 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure Table 4-5. Sine wave frequencies for observing aliasing. Sine wave frequency (Hz) What is the Nyquist rate for the current sampling rate? The Nyquist rate is. 18. While observing the frequency spectrum on the oscilloscope, set the frequency of the sine wave to the other frequencies in Table 4-5. Explain what happens as the input sine wave frequency approaches the Nyquist rate, when it reaches the Nyquist rate, and when it goes above the Nyquist rate. As the sine wave message signal frequency increases, its peak in the spectrum display moves to the right. At the same time, the peaks in the first replica spread apart. When the Nyquist rate is reached, the message signal and the lower component of the first replica coincide. Beyond the Nyquist rate, the lower component of the first replica moves below the message signal frequency and aliasing occurs. Festo Didactic

68 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure To the instructor The following screens show what students should observe: 1000 Hz 3000 Hz,, Spectrum, Filters OFF.,, Spectrum, Filters OFF. 182 Festo Didactic

69 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure,, Spectrum, Filters OFF.,, Spectrum, Filters OFF. Festo Didactic

70 Ex. 4-1 Sampling and Analog-to-Digital/Digital-to-Analog Conversion Procedure,, Spectrum, Filters OFF.,, Spectrum, Filters OFF. 184 Festo Didactic

Three-Phase Transformer Banks

Three-Phase Transformer Banks Electricity and New Energy Three-Phase Transformer Banks Student Manual 86379-00 Order no.: 86379-00 Revision level: 01/2015 By the staff of Festo Didactic Festo Didactic Ltée/Ltd, Quebec, Canada 2011

More information

Single-Phase Power Transformers

Single-Phase Power Transformers ` Electricity and New Energy Single-Phase Power Transformers Course Sample 594132 Order no.: 594132 (Printed version) 594446 (CD-ROM) First Edition Revision level: 10/2018 By the staff of Festo Didactic

More information

Introduction to Robotics

Introduction to Robotics Mechatronics Introduction to Robotics Courseware Sample 39411-F0 Order no.: 39411-00 First Edition Revision level: 02/2015 By the staff of Festo Didactic Festo Didactic Ltée/Ltd, Quebec, Canada 2007 Internet:

More information

Single-Phase Power Transformers

Single-Phase Power Transformers ` Electricity and New Energy Single-Phase Power Transformers Course Sample 579439 Order no.: 579439 (Printed version) 591956 (CD-ROM) First Edition Revision level: 10/2018 By the staff of Festo Didactic

More information

Three-Phase AC Power Circuits

Three-Phase AC Power Circuits Electricity and New Energy Three-Phase AC Power Circuits Student Manual 86360-0 Order no.: 86360-10 First Edition Revision level: 09/2016 By the staff of Festo Didactic Festo Didactic Ltée/Ltd, Quebec,

More information

Three-Phase AC Power Circuits

Three-Phase AC Power Circuits Electricity and New Energy Three-Phase AC Power Circuits Course Sample 57978 Order no.: 57978 (Printed version) 591861 (CD-ROM) First Edition Revision level: 09/2018 By the staff of Festo Didactic Festo

More information

Microwave Variable-Frequency Measurements and Applications

Microwave Variable-Frequency Measurements and Applications Telecommunications Microwave Variable-Frequency Measurements and Applications Courseware Sample 39974-F0 Order no.: 39974-00 First Edition Revision level: 02/2015 By the staff of Festo Didactic Festo Didactic

More information

Power Circuits and Transformers

Power Circuits and Transformers Electricity and New Energy Power Circuits and Transformers Student Manual 30328-00 Order no.: 30328-00 Revision level: 11/2014 By the staff of Festo Didactic Festo Didactic Ltée/Ltd, Quebec, Canada 1995

More information

Single-Phase AC Power Circuits

Single-Phase AC Power Circuits Electricity and New Energy Single-Phase AC Power Circuits Courseware Sample 86358-F0 Order no.: 86358-10 First Edition Revision level: 06/2017 By the staff of Festo Didactic Festo Didactic Ltée/Ltd, Quebec,

More information

DIGITAL SIGNAL PROCESSING LABORATORY

DIGITAL SIGNAL PROCESSING LABORATORY DIGITAL SIGNAL PROCESSING LABORATORY SECOND EDITION В. Preetham Kumar CRC Press Taylor & Francis Group Boca Raton London New York CRC Press is an imprint of the Taylor & Francis Croup, an informa business

More information

Electricity and New Energy. DC Power Circuits. Courseware Sample F0

Electricity and New Energy. DC Power Circuits. Courseware Sample F0 Electricity and New Energy DC Power Circuits Courseware Sample 86350-F0 Order no.: 86350-10 First Edition Revision level: 06/2017 By the staff of Festo Didactic Festo Didactic Ltée/Ltd, Quebec, Canada

More information

ENGR 210 Lab 12: Sampling and Aliasing

ENGR 210 Lab 12: Sampling and Aliasing ENGR 21 Lab 12: Sampling and Aliasing In the previous lab you examined how A/D converters actually work. In this lab we will consider some of the consequences of how fast you sample and of the signal processing

More information

Digital Signal Processing. VO Embedded Systems Engineering Armin Wasicek WS 2009/10

Digital Signal Processing. VO Embedded Systems Engineering Armin Wasicek WS 2009/10 Digital Signal Processing VO Embedded Systems Engineering Armin Wasicek WS 2009/10 Overview Signals and Systems Processing of Signals Display of Signals Digital Signal Processors Common Signal Processing

More information

Digital Communications Simulation Software (LVSIM -DCOM)

Digital Communications Simulation Software (LVSIM -DCOM) Digital Communications Simulation Software (LVSIM -DCOM) LabVolt Series Datasheet Festo Didactic en 240 V - 50 Hz 06/2018 Table of Contents General Description 2 Features 3 Digital Communications Equipment

More information

Electricity and New Energy. DC Power Electronics. Courseware Sample F0

Electricity and New Energy. DC Power Electronics. Courseware Sample F0 Electricity and New Energy DC Power Electronics Courseware Sample 86356-F0 Order no.: 86356-10 Revision level: 12/2014 By the staff of Festo Didactic Festo Didactic Ltée/Ltd, Quebec, Canada 2010 Internet:

More information

REAL TIME DIGITAL SIGNAL PROCESSING. Introduction

REAL TIME DIGITAL SIGNAL PROCESSING. Introduction REAL TIME DIGITAL SIGNAL Introduction Why Digital? A brief comparison with analog. PROCESSING Seminario de Electrónica: Sistemas Embebidos Advantages The BIG picture Flexibility. Easily modifiable and

More information

FOUNDATION Fieldbus Device Configuration

FOUNDATION Fieldbus Device Configuration Process Control FOUNDATION Fieldbus Device Configuration Courseware Sample 86002-F0 Order no.: 86002-10 First Edition Revision level: 02/2015 By the staff of Festo Didactic Festo Didactic Ltée/Ltd, Quebec,

More information

Advanced Digital Signal Processing Part 2: Digital Processing of Continuous-Time Signals

Advanced Digital Signal Processing Part 2: Digital Processing of Continuous-Time Signals Advanced Digital Signal Processing Part 2: Digital Processing of Continuous-Time Signals Gerhard Schmidt Christian-Albrechts-Universität zu Kiel Faculty of Engineering Institute of Electrical Engineering

More information

The Discrete Fourier Transform. Claudia Feregrino-Uribe, Alicia Morales-Reyes Original material: Dr. René Cumplido

The Discrete Fourier Transform. Claudia Feregrino-Uribe, Alicia Morales-Reyes Original material: Dr. René Cumplido The Discrete Fourier Transform Claudia Feregrino-Uribe, Alicia Morales-Reyes Original material: Dr. René Cumplido CCC-INAOE Autumn 2015 The Discrete Fourier Transform Fourier analysis is a family of mathematical

More information

Laboratory Assignment 1 Sampling Phenomena

Laboratory Assignment 1 Sampling Phenomena 1 Main Topics Signal Acquisition Audio Processing Aliasing, Anti-Aliasing Filters Laboratory Assignment 1 Sampling Phenomena 2.171 Analysis and Design of Digital Control Systems Digital Filter Design and

More information

Exploring DSP Performance

Exploring DSP Performance ECE1756, Experiment 02, 2015 Communications Lab, University of Toronto Exploring DSP Performance Bruno Korst, Siu Pak Mok & Vaughn Betz Abstract The performance of two DSP architectures will be probed

More information

Microwave Fundamentals

Microwave Fundamentals Telecommunications Microwave Fundamentals 28113- Order no.: 28113-00 Revision level: 12/2014 By the staff of Festo Didactic Festo Didactic Ltée/Ltd, Quebec, Canada 1988, 2008 Internet: www.festo-didactic.com

More information

TE 302 DISCRETE SIGNALS AND SYSTEMS. Chapter 1: INTRODUCTION

TE 302 DISCRETE SIGNALS AND SYSTEMS. Chapter 1: INTRODUCTION TE 302 DISCRETE SIGNALS AND SYSTEMS Study on the behavior and processing of information bearing functions as they are currently used in human communication and the systems involved. Chapter 1: INTRODUCTION

More information

Telecommunications Radar Courseware Sample

Telecommunications Radar Courseware Sample Telecommunications Radar Courseware Sample 38542-F0 Order no.: 38542-00 First Edition Revision level: 08/2015 By the staff of Festo Didactic Festo Didactic Ltée/Ltd, Quebec, Canada 2006 Internet: www.festo-didactic.com

More information

The Fundamentals of Mixed Signal Testing

The Fundamentals of Mixed Signal Testing The Fundamentals of Mixed Signal Testing Course Information The Fundamentals of Mixed Signal Testing course is designed to provide the foundation of knowledge that is required for testing modern mixed

More information

Spectrum Analysis - Elektronikpraktikum

Spectrum Analysis - Elektronikpraktikum Spectrum Analysis Introduction Why measure a spectra? In electrical engineering we are most often interested how a signal develops over time. For this time-domain measurement we use the Oscilloscope. Like

More information

Chapter 7. Introduction. Analog Signal and Discrete Time Series. Sampling, Digital Devices, and Data Acquisition

Chapter 7. Introduction. Analog Signal and Discrete Time Series. Sampling, Digital Devices, and Data Acquisition Chapter 7 Sampling, Digital Devices, and Data Acquisition Material from Theory and Design for Mechanical Measurements; Figliola, Third Edition Introduction Integrating analog electrical transducers with

More information

4. Digital Measurement of Electrical Quantities

4. Digital Measurement of Electrical Quantities 4.1. Concept of Digital Systems Concept A digital system is a combination of devices designed for manipulating physical quantities or information represented in digital from, i.e. they can take only discrete

More information

Electricity and New Energy. Photovoltaic Systems. Course Sample

Electricity and New Energy. Photovoltaic Systems. Course Sample Electricity and New Energy Photovoltaic Systems Course Sample 593987 Order no.: 593987 (Printed version) 594303 (CD-ROM) First Edition Revision level: 09/2018 By the staff of Festo Didactic Festo Didactic

More information

Chapter 5: Signal conversion

Chapter 5: Signal conversion Chapter 5: Signal conversion Learning Objectives: At the end of this topic you will be able to: explain the need for signal conversion between analogue and digital form in communications and microprocessors

More information

Chapter 2: Digitization of Sound

Chapter 2: Digitization of Sound Chapter 2: Digitization of Sound Acoustics pressure waves are converted to electrical signals by use of a microphone. The output signal from the microphone is an analog signal, i.e., a continuous-valued

More information

System analysis and signal processing

System analysis and signal processing System analysis and signal processing with emphasis on the use of MATLAB PHILIP DENBIGH University of Sussex ADDISON-WESLEY Harlow, England Reading, Massachusetts Menlow Park, California New York Don Mills,

More information

LAB #7: Digital Signal Processing

LAB #7: Digital Signal Processing LAB #7: Digital Signal Processing Equipment: Pentium PC with NI PCI-MIO-16E-4 data-acquisition board NI BNC 2120 Accessory Box VirtualBench Instrument Library version 2.6 Function Generator (Tektronix

More information

Subra Ganesan DSP 1.

Subra Ganesan DSP 1. DSP 1 Subra Ganesan Professor, Computer Science and Engineering Associate Director, Product Development and Manufacturing Center, Oakland University, Rochester, MI 48309 Email: ganesan@oakland.edu Topics

More information

EECS 452 Midterm Exam (solns) Fall 2012

EECS 452 Midterm Exam (solns) Fall 2012 EECS 452 Midterm Exam (solns) Fall 2012 Name: unique name: Sign the honor code: I have neither given nor received aid on this exam nor observed anyone else doing so. Scores: # Points Section I /40 Section

More information

Pressure and Level Switches

Pressure and Level Switches Process Control Pressure and Level Switches Courseware Sample 86000-F0 Order no.: 86000-10 First Edition Revision level: 03/2016 By the staff of Festo Didactic Festo Didactic Ltée/Ltd, Quebec, Canada 2010

More information

ECEn 487 Digital Signal Processing Laboratory. Lab 3 FFT-based Spectrum Analyzer

ECEn 487 Digital Signal Processing Laboratory. Lab 3 FFT-based Spectrum Analyzer ECEn 487 Digital Signal Processing Laboratory Lab 3 FFT-based Spectrum Analyzer Due Dates This is a three week lab. All TA check off must be completed by Friday, March 14, at 3 PM or the lab will be marked

More information

Hideo Okawara s Mixed Signal Lecture Series. DSP-Based Testing Fundamentals 6 Spectrum Analysis -- FFT

Hideo Okawara s Mixed Signal Lecture Series. DSP-Based Testing Fundamentals 6 Spectrum Analysis -- FFT Hideo Okawara s Mixed Signal Lecture Series DSP-Based Testing Fundamentals 6 Spectrum Analysis -- FFT Verigy Japan October 008 Preface to the Series ADC and DAC are the most typical mixed signal devices.

More information

Page 1/10 Digilent Analog Discovery (DAD) Tutorial 6-Aug-15. Figure 2: DAD pin configuration

Page 1/10 Digilent Analog Discovery (DAD) Tutorial 6-Aug-15. Figure 2: DAD pin configuration Page 1/10 Digilent Analog Discovery (DAD) Tutorial 6-Aug-15 INTRODUCTION The Diligent Analog Discovery (DAD) allows you to design and test both analog and digital circuits. It can produce, measure and

More information

Contents. Introduction 1 1 Suggested Reading 2 2 Equipment and Software Tools 2 3 Experiment 2

Contents. Introduction 1 1 Suggested Reading 2 2 Equipment and Software Tools 2 3 Experiment 2 ECE363, Experiment 02, 2018 Communications Lab, University of Toronto Experiment 02: Noise Bruno Korst - bkf@comm.utoronto.ca Abstract This experiment will introduce you to some of the characteristics

More information

Experiment # 2. Pulse Code Modulation: Uniform and Non-Uniform

Experiment # 2. Pulse Code Modulation: Uniform and Non-Uniform 10 8 6 4 2 0 2 4 6 8 3 2 1 0 1 2 3 2 3 4 5 6 7 8 9 10 3 2 1 0 1 2 3 4 1 2 3 4 5 6 7 8 9 1.5 1 0.5 0 0.5 1 ECE417 c 2017 Bruno Korst-Fagundes CommLab Experiment # 2 Pulse Code Modulation: Uniform and Non-Uniform

More information

Process Control Process Control Air, Pressure, and Flow Courseware Sample

Process Control Process Control Air, Pressure, and Flow Courseware Sample Process Control Process Control Air, Pressure, and Flow Courseware Sample 85989-F0 Order no.: 85989-10 First Edition Revision level: 01/2015 By the staff of Festo Didactic Festo Didactic Ltée/Ltd, Quebec,

More information

AC Power Transmission Training System Add- On to ( )

AC Power Transmission Training System Add- On to ( ) AC Power Transmission Training System Add- On to 8006 587433 (89252-00) LabVolt Series Datasheet Festo Didactic en 120 V - 60 Hz 03/2019 Table of Contents General Description 2 List of Equipment 2 List

More information

Digital Signal Processing System Design: LabVIEW-Based Hybrid Programming

Digital Signal Processing System Design: LabVIEW-Based Hybrid Programming Digital Signal Processing System Design: LabVIEW-Based Hybrid Programming by Nasser Kehtarnavaz University of Texas at Dallas With laboratory contributions by Namjin Kim and Qingzhong Peng 1111» AMSTERDAM

More information

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Linear Integrated Circuits Applications

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Linear Integrated Circuits Applications About the Tutorial Linear Integrated Circuits are solid state analog devices that can operate over a continuous range of input signals. Theoretically, they are characterized by an infinite number of operating

More information

Appendix B. Design Implementation Description For The Digital Frequency Demodulator

Appendix B. Design Implementation Description For The Digital Frequency Demodulator Appendix B Design Implementation Description For The Digital Frequency Demodulator The DFD design implementation is divided into four sections: 1. Analog front end to signal condition and digitize the

More information

Introduction. Chapter Time-Varying Signals

Introduction. Chapter Time-Varying Signals Chapter 1 1.1 Time-Varying Signals Time-varying signals are commonly observed in the laboratory as well as many other applied settings. Consider, for example, the voltage level that is present at a specific

More information

AC : INTERACTIVE LEARNING DISCRETE TIME SIGNALS AND SYSTEMS WITH MATLAB AND TI DSK6713 DSP KIT

AC : INTERACTIVE LEARNING DISCRETE TIME SIGNALS AND SYSTEMS WITH MATLAB AND TI DSK6713 DSP KIT AC 2007-2807: INTERACTIVE LEARNING DISCRETE TIME SIGNALS AND SYSTEMS WITH MATLAB AND TI DSK6713 DSP KIT Zekeriya Aliyazicioglu, California State Polytechnic University-Pomona Saeed Monemi, California State

More information

Digital Signal Processing

Digital Signal Processing Digital Signal Processing System Analysis and Design Paulo S. R. Diniz Eduardo A. B. da Silva and Sergio L. Netto Federal University of Rio de Janeiro CAMBRIDGE UNIVERSITY PRESS Preface page xv Introduction

More information

Qäf) Newnes f-s^j^s. Digital Signal Processing. A Practical Guide for Engineers and Scientists. by Steven W. Smith

Qäf) Newnes f-s^j^s. Digital Signal Processing. A Practical Guide for Engineers and Scientists. by Steven W. Smith Digital Signal Processing A Practical Guide for Engineers and Scientists by Steven W. Smith Qäf) Newnes f-s^j^s / *" ^"P"'" of Elsevier Amsterdam Boston Heidelberg London New York Oxford Paris San Diego

More information

SIGMA-DELTA CONVERTER

SIGMA-DELTA CONVERTER SIGMA-DELTA CONVERTER (1995: Pacífico R. Concetti Western A. Geophysical-Argentina) The Sigma-Delta A/D Converter is not new in electronic engineering since it has been previously used as part of many

More information

Data acquisition and instrumentation. Data acquisition

Data acquisition and instrumentation. Data acquisition Data acquisition and instrumentation START Lecture Sam Sadeghi Data acquisition 1 Humanistic Intelligence Body as a transducer,, data acquisition and signal processing machine Analysis of physiological

More information

Advanced Lab LAB 6: Signal Acquisition & Spectrum Analysis Using VirtualBench DSA Equipment: Objectives:

Advanced Lab LAB 6: Signal Acquisition & Spectrum Analysis Using VirtualBench DSA Equipment: Objectives: Advanced Lab LAB 6: Signal Acquisition & Spectrum Analysis Using VirtualBench DSA Equipment: Pentium PC with National Instruments PCI-MIO-16E-4 data-acquisition board (12-bit resolution; software-controlled

More information

Lab 4 Digital Scope and Spectrum Analyzer

Lab 4 Digital Scope and Spectrum Analyzer Lab 4 Digital Scope and Spectrum Analyzer Page 4.1 Lab 4 Digital Scope and Spectrum Analyzer Goals Review Starter files Interface a microphone and record sounds, Design and implement an analog HPF, LPF

More information

DTMF Signal Detection Using Z8 Encore! XP F64xx Series MCUs

DTMF Signal Detection Using Z8 Encore! XP F64xx Series MCUs DTMF Signal Detection Using Z8 Encore! XP F64xx Series MCUs AN033501-1011 Abstract This application note demonstrates Dual-Tone Multi-Frequency (DTMF) signal detection using Zilog s Z8F64xx Series microcontrollers.

More information

Experiment I: An Introduction to the Arduino Due + Sampling and Reconstruction

Experiment I: An Introduction to the Arduino Due + Sampling and Reconstruction ELEC 00/7: Signals Systems & Controls Prac/Lab : Introduction to the Arduino Due + Sampling & Reconstruction on the Arduino Due Revised March, 0 Pre-Lab The Pre-laboratory exercise for this laboratory

More information

Static Synchronous Compensator (STATCOM)

Static Synchronous Compensator (STATCOM) Electricity and New Energy Static Synchronous Compensator (STATCOM) Courseware Sample 86371-F0 Order no.: 86371-10 First Edition Revision level: 07/2016 By the staff of Festo Didactic Festo Didactic Ltée/Ltd,

More information

332:223 Principles of Electrical Engineering I Laboratory Experiment #2 Title: Function Generators and Oscilloscopes Suggested Equipment:

332:223 Principles of Electrical Engineering I Laboratory Experiment #2 Title: Function Generators and Oscilloscopes Suggested Equipment: RUTGERS UNIVERSITY The State University of New Jersey School of Engineering Department Of Electrical and Computer Engineering 332:223 Principles of Electrical Engineering I Laboratory Experiment #2 Title:

More information

EE-4022 Experiment 2 Amplitude Modulation (AM)

EE-4022 Experiment 2 Amplitude Modulation (AM) EE-4022 MILWAUKEE SCHOOL OF ENGINEERING 2015 Page 2-1 Student objectives: EE-4022 Experiment 2 Amplitude Modulation (AM) In this experiment the student will use laboratory modules to implement operations

More information

Analog-Digital Interface

Analog-Digital Interface Analog-Digital Interface Tuesday 24 November 15 Summary Previous Class Dependability Today: Redundancy Error Correcting Codes Analog-Digital Interface Converters, Sensors / Actuators Sampling DSP Frequency

More information

Module 1: Introduction to Experimental Techniques Lecture 2: Sources of error. The Lecture Contains: Sources of Error in Measurement

Module 1: Introduction to Experimental Techniques Lecture 2: Sources of error. The Lecture Contains: Sources of Error in Measurement The Lecture Contains: Sources of Error in Measurement Signal-To-Noise Ratio Analog-to-Digital Conversion of Measurement Data A/D Conversion Digitalization Errors due to A/D Conversion file:///g /optical_measurement/lecture2/2_1.htm[5/7/2012

More information

A DSP IMPLEMENTED DIGITAL FM MULTIPLEXING SYSTEM

A DSP IMPLEMENTED DIGITAL FM MULTIPLEXING SYSTEM A DSP IMPLEMENTED DIGITAL FM MULTIPLEXING SYSTEM Item Type text; Proceedings Authors Rosenthal, Glenn K. Publisher International Foundation for Telemetering Journal International Telemetering Conference

More information

Lab 3 FFT based Spectrum Analyzer

Lab 3 FFT based Spectrum Analyzer ECEn 487 Digital Signal Processing Laboratory Lab 3 FFT based Spectrum Analyzer Due Dates This is a three week lab. All TA check off must be completed prior to the beginning of class on the lab book submission

More information

Chapter 2 Analog-to-Digital Conversion...

Chapter 2 Analog-to-Digital Conversion... Chapter... 5 This chapter examines general considerations for analog-to-digital converter (ADC) measurements. Discussed are the four basic ADC types, providing a general description of each while comparing

More information

Experiment # 4. Frequency Modulation

Experiment # 4. Frequency Modulation ECE 416 Fall 2002 Experiment # 4 Frequency Modulation 1 Purpose In Experiment # 3, a modulator and demodulator for AM were designed and built. In this experiment, another widely used modulation technique

More information

Introduction to Real-Time Digital Signal Processing

Introduction to Real-Time Digital Signal Processing Real-Time Digital Signal Processing. Sen M Kuo, Bob H Lee Copyright # 2001 John Wiley & Sons Ltd ISBNs: 0-470-84137-0 Hardback); 0-470-84534-1 Electronic) 1 Introduction to Real-Time Digital Signal Processing

More information

Advantages of Analog Representation. Varies continuously, like the property being measured. Represents continuous values. See Figure 12.

Advantages of Analog Representation. Varies continuously, like the property being measured. Represents continuous values. See Figure 12. Analog Signals Signals that vary continuously throughout a defined range. Representative of many physical quantities, such as temperature and velocity. Usually a voltage or current level. Digital Signals

More information

EE 351M Digital Signal Processing

EE 351M Digital Signal Processing EE 351M Digital Signal Processing Course Details Objective Establish a background in Digital Signal Processing Theory Required Text Discrete-Time Signal Processing, Prentice Hall, 2 nd Edition Alan Oppenheim,

More information

BIOMEDICAL DIGITAL SIGNAL PROCESSING

BIOMEDICAL DIGITAL SIGNAL PROCESSING BIOMEDICAL DIGITAL SIGNAL PROCESSING C-Language Examples and Laboratory Experiments for the IBM PC WILLIS J. TOMPKINS Editor University of Wisconsin-Madison 2000 by Willis J. Tompkins This book was previously

More information

SigCal32 User s Guide Version 3.0

SigCal32 User s Guide Version 3.0 SigCal User s Guide . . SigCal32 User s Guide Version 3.0 Copyright 1999 TDT. All rights reserved. No part of this manual may be reproduced or transmitted in any form or by any means, electronic or mechanical,

More information

9063-RC Data Acquisition and Control Interface

9063-RC Data Acquisition and Control Interface 9063-RC Data Acquisition and Control Interface LabVolt Series Datasheet Festo Didactic en 230 V - 50 Hz 11/2017 Table of Contents General Description 2 LVDAC-EMS 2 Metering 3 Oscilloscope 3 Phasor Analyzer

More information

Notes on Experiment #1

Notes on Experiment #1 Notes on Experiment #1 Bring graph paper (cm cm is best) From this week on, be sure to print a copy of each experiment and bring it with you to lab. There will not be any experiment copies available in

More information

Analyzing A/D and D/A converters

Analyzing A/D and D/A converters Analyzing A/D and D/A converters 2013. 10. 21. Pálfi Vilmos 1 Contents 1 Signals 3 1.1 Periodic signals 3 1.2 Sampling 4 1.2.1 Discrete Fourier transform... 4 1.2.2 Spectrum of sampled signals... 5 1.2.3

More information

Combinational logic: Breadboard adders

Combinational logic: Breadboard adders ! ENEE 245: Digital Circuits & Systems Lab Lab 1 Combinational logic: Breadboard adders ENEE 245: Digital Circuits and Systems Laboratory Lab 1 Objectives The objectives of this laboratory are the following:

More information

Analogue Interfacing. What is a signal? Continuous vs. Discrete Time. Continuous time signals

Analogue Interfacing. What is a signal? Continuous vs. Discrete Time. Continuous time signals Analogue Interfacing What is a signal? Signal: Function of one or more independent variable(s) such as space or time Examples include images and speech Continuous vs. Discrete Time Continuous time signals

More information

YEDITEPE UNIVERSITY ENGINEERING FACULTY COMMUNICATION SYSTEMS LABORATORY EE 354 COMMUNICATION SYSTEMS

YEDITEPE UNIVERSITY ENGINEERING FACULTY COMMUNICATION SYSTEMS LABORATORY EE 354 COMMUNICATION SYSTEMS YEDITEPE UNIVERSITY ENGINEERING FACULTY COMMUNICATION SYSTEMS LABORATORY EE 354 COMMUNICATION SYSTEMS EXPERIMENT 3: SAMPLING & TIME DIVISION MULTIPLEX (TDM) Objective: Experimental verification of the

More information

II Year (04 Semester) EE6403 Discrete Time Systems and Signal Processing

II Year (04 Semester) EE6403 Discrete Time Systems and Signal Processing Class Subject Code Subject II Year (04 Semester) EE6403 Discrete Time Systems and Signal Processing 1.CONTENT LIST: Introduction to Unit I - Signals and Systems 2. SKILLS ADDRESSED: Listening 3. OBJECTIVE

More information

The quality of the transmission signal The characteristics of the transmission medium. Some type of transmission medium is required for transmission:

The quality of the transmission signal The characteristics of the transmission medium. Some type of transmission medium is required for transmission: Data Transmission The successful transmission of data depends upon two factors: The quality of the transmission signal The characteristics of the transmission medium Some type of transmission medium is

More information

Understanding Digital Signal Processing

Understanding Digital Signal Processing Understanding Digital Signal Processing Richard G. Lyons PRENTICE HALL PTR PRENTICE HALL Professional Technical Reference Upper Saddle River, New Jersey 07458 www.photr,com Contents Preface xi 1 DISCRETE

More information

Laboratory Experiment #1 Introduction to Spectral Analysis

Laboratory Experiment #1 Introduction to Spectral Analysis J.B.Francis College of Engineering Mechanical Engineering Department 22-403 Laboratory Experiment #1 Introduction to Spectral Analysis Introduction The quantification of electrical energy can be accomplished

More information

Spectrum Analysis: The FFT Display

Spectrum Analysis: The FFT Display Spectrum Analysis: The FFT Display Equipment: Capstone, voltage sensor 1 Introduction It is often useful to represent a function by a series expansion, such as a Taylor series. There are other series representations

More information

Design Implementation Description for the Digital Frequency Oscillator

Design Implementation Description for the Digital Frequency Oscillator Appendix A Design Implementation Description for the Frequency Oscillator A.1 Input Front End The input data front end accepts either analog single ended or differential inputs (figure A-1). The input

More information

Experiment # 2 Pulse Code Modulation: Uniform and Non-Uniform

Experiment # 2 Pulse Code Modulation: Uniform and Non-Uniform 10 8 6 4 2 0 2 4 6 8 3 2 1 0 1 2 3 2 3 4 5 6 7 8 9 10 3 2 1 0 1 2 3 4 1 2 3 4 5 6 7 8 9 1.5 1 0.5 0 0.5 1 ECE417 c 2015 Bruno Korst-Fagundes CommLab Experiment # 2 Pulse Code Modulation: Uniform and Non-Uniform

More information

Fourier Signal Analysis

Fourier Signal Analysis Part 1B Experimental Engineering Integrated Coursework Location: Baker Building South Wing Mechanics Lab Experiment A4 Signal Processing Fourier Signal Analysis Please bring the lab sheet from 1A experiment

More information

Generating DTMF Tones Using Z8 Encore! MCU

Generating DTMF Tones Using Z8 Encore! MCU Application Note Generating DTMF Tones Using Z8 Encore! MCU AN024802-0608 Abstract This Application Note describes how Zilog s Z8 Encore! MCU is used as a Dual-Tone Multi- (DTMF) signal encoder to generate

More information

Instruction Manual for Concept Simulators. Signals and Systems. M. J. Roberts

Instruction Manual for Concept Simulators. Signals and Systems. M. J. Roberts Instruction Manual for Concept Simulators that accompany the book Signals and Systems by M. J. Roberts March 2004 - All Rights Reserved Table of Contents I. Loading and Running the Simulators II. Continuous-Time

More information

EE 422G - Signals and Systems Laboratory

EE 422G - Signals and Systems Laboratory EE 422G - Signals and Systems Laboratory Lab 3 FIR Filters Written by Kevin D. Donohue Department of Electrical and Computer Engineering University of Kentucky Lexington, KY 40506 September 19, 2015 Objectives:

More information

What the LSA1000 Does and How

What the LSA1000 Does and How 2 About the LSA1000 What the LSA1000 Does and How The LSA1000 is an ideal instrument for capturing, digitizing and analyzing high-speed electronic signals. Moreover, it has been optimized for system-integration

More information

PART I: The questions in Part I refer to the aliasing portion of the procedure as outlined in the lab manual.

PART I: The questions in Part I refer to the aliasing portion of the procedure as outlined in the lab manual. Lab. #1 Signal Processing & Spectral Analysis Name: Date: Section / Group: NOTE: To help you correctly answer many of the following questions, it may be useful to actually run the cases outlined in the

More information

Digital Signal Processing

Digital Signal Processing Digital Signal Processing Fourth Edition John G. Proakis Department of Electrical and Computer Engineering Northeastern University Boston, Massachusetts Dimitris G. Manolakis MIT Lincoln Laboratory Lexington,

More information

Sampling and Reconstruction

Sampling and Reconstruction Experiment 10 Sampling and Reconstruction In this experiment we shall learn how an analog signal can be sampled in the time domain and then how the same samples can be used to reconstruct the original

More information

DSP VLSI Design. DSP Systems. Byungin Moon. Yonsei University

DSP VLSI Design. DSP Systems. Byungin Moon. Yonsei University Byungin Moon Yonsei University Outline What is a DSP system? Why is important DSP? Advantages of DSP systems over analog systems Example DSP applications Characteristics of DSP systems Sample rates Clock

More information

Objectives. Abstract. This PRO Lesson will examine the Fast Fourier Transformation (FFT) as follows:

Objectives. Abstract. This PRO Lesson will examine the Fast Fourier Transformation (FFT) as follows: : FFT Fast Fourier Transform This PRO Lesson details hardware and software setup of the BSL PRO software to examine the Fast Fourier Transform. All data collection and analysis is done via the BIOPAC MP35

More information

SIGNALS AND SYSTEMS LABORATORY 13: Digital Communication

SIGNALS AND SYSTEMS LABORATORY 13: Digital Communication SIGNALS AND SYSTEMS LABORATORY 13: Digital Communication INTRODUCTION Digital Communication refers to the transmission of binary, or digital, information over analog channels. In this laboratory you will

More information

Lesson 7. Digital Signal Processors

Lesson 7. Digital Signal Processors Lesson 7 Digital Signal Processors Instructional Objectives After going through this lesson the student would learn o Architecture of a Real time Signal Processing Platform o Different Errors introduced

More information

Cyclone II Filtering Lab

Cyclone II Filtering Lab May 2005, ver. 1.0 Application Note 376 Introduction The Cyclone II filtering lab design provided in the DSP Development Kit, Cyclone II Edition, shows you how to use the Altera DSP Builder for system

More information

Auto Harmonizer. EEL 4924 Electrical Engineering Design (Senior Design) Final Design Report 26 April 2012

Auto Harmonizer. EEL 4924 Electrical Engineering Design (Senior Design) Final Design Report 26 April 2012 Auto Harmonizer EEL 4924 Electrical Engineering Design (Senior Design) Final Design Report 26 April 2012 Team Name: Slubberdegullions Team Members: Josh Elliott and Henry Hatton, Jr. Project Abstract:

More information

EE 210 Lab Exercise #4 D/A & A/D Converters

EE 210 Lab Exercise #4 D/A & A/D Converters EE 210 Lab Exercise #4 D/A & A/D Converters Introduction This lab deals with simple resistive circuits to perform Digital-to-Analog (D/A) conversion. We also introduce the use of a basic Analog-to-Digital

More information

Lab 12 Laboratory 12 Data Acquisition Required Special Equipment: 12.1 Objectives 12.2 Introduction 12.3 A/D basics

Lab 12 Laboratory 12 Data Acquisition Required Special Equipment: 12.1 Objectives 12.2 Introduction 12.3 A/D basics Laboratory 12 Data Acquisition Required Special Equipment: Computer with LabView Software National Instruments USB 6009 Data Acquisition Card 12.1 Objectives This lab demonstrates the basic principals

More information

Department of Electronic Engineering NED University of Engineering & Technology. LABORATORY WORKBOOK For the Course SIGNALS & SYSTEMS (TC-202)

Department of Electronic Engineering NED University of Engineering & Technology. LABORATORY WORKBOOK For the Course SIGNALS & SYSTEMS (TC-202) Department of Electronic Engineering NED University of Engineering & Technology LABORATORY WORKBOOK For the Course SIGNALS & SYSTEMS (TC-202) Instructor Name: Student Name: Roll Number: Semester: Batch:

More information