程序案例-ADSPBF706

1 Digital Signal Processing Laboratory using the ADSPBF706 and Signal Wizard for Blackfin+ 2 Digital Signal Processing Laboratory With the ADSP-BF706 EZ-KIT Evaluation System and Signal Wizard for Blackfin+ Equipment and software ADSP-BF706 EZ-KIT hardware Two stereo cables with 3.5mm jack plugs Stereo cable with 3.5 mm jack plug to phono plugs Two phono-to-BNC adapters Mini USB cable Oscilloscope Headphones Computer running Windows Software: CrossCore Embedded Studio (CCES) Software: Signal Wizard for Blackfin+ Software: folder with student project files Data sheets Introduction The DSP laboratory comprises a series of exercises, designed to teach basic principles of real-time assembly program development and execution using the ADSP-BF706 EZ-KIT hardware, in combination with CCES and Signal Wizard. The Eclipse-based CCES environment allows the user to develop, download, debug and execute software (both in assembly code and C) with the ADSBF70x family of DSP devices. The exercises require the coding of various programs, described in detail below, which you will evaluate using the equipment supplied. Test signals, in the form of audio inputs, are located in the relevant folder, and will be used to validate the programs you have developed. Validation will include oscilloscope analysis of the outputs and listening tests using the loudspeakers. Folder contents The main DSP Laboratory folder includes four sub-folders as follows: Projects: This contains eight projects (real-time assembly routines). Two of these are complete and ready to be executed. The remaining six are partially complete, and require you to provide the missing code. Audio files: This contains four audio files in .wav format, from wave 1.wav to wave 4.wav. These will be used to test the programs you develop. Signal Wizard: Contains the Signal Wizard for Blackfin+ application, which you will use to generate filter coefficient files. Data sheets: This contains PDF data sheets for the EZ-KIT hardware, the BF706 processor, the ADAU1761 audio codec, CCES and assembly language programming. Team working and laboratory sessions, exercises 1-6 You will work in teams of between 3 to 5 individuals. Each team will attend three laboratory sessions, with each session lasting three hours. Hence the total laboratory duration is nine hours. Once you have completed each exercise, you must inform the demonstrator, who will then assess your work as a team. Each program you develop must be fully annotated with comments in the code. Exercises 1 to 6 will be conducted and completed and marked within laboratory hours. Each member of the team will be awarded the same mark for exercises 1-6. Exercise 7, which is an individual design report, will be completed away from the laboratory. Individual report, exercise 7 You will each be required to submit an individual design report, via Blackboard, that includes a cover page with your name and/or student number. The report must be submitted as a PDF document. It will be marked and the mark will be added to the marks from the team exercise to produce a final individual mark. You will be informed of the deadline for report submission by the course organizer. 3 Preparing the system To familiarize yourself with the system, you have been given two complete projects that you can import into the CCES workspace and run. Before doing so, you must configure the system hardware and software. The evaluation board should be handled with care and only when necessary. Never touch the components on the circuit; always hold the board at its edges. Follow these steps: 1. Using the stereo cable (3.5mm jack plug to 3.5 mm jack plug), connect the audio output of the computer to the input socket of the evaluation board. This MUST be connected to the line-in socket on the board. 2. Using the stereo cable (3.5 mm jack plug to phono plugs) and the phono-to-BNC adapters, connect the output socket of the board to the oscilloscope. 3. Connect the evaluation board to the computer using the mini USB cable. 4. Open the CCES environment. 5. Check with the demonstrator that these stages have been completed correctly. Preliminary task 1 In the programs folder there is a project named flashled. You must import this into CCES, invoke the debugger and run the program. This program will continuously flash one of the LEDS on the board. Follow these steps, which are illustrated in Figures 1 and 2 below. 1. From the main menu, choose File | Import… Now import an existing project into the workspace, Figure 1. 2. The flashled folder will appear in the Project Explorer list on the left of the CCES main page. Open this folder, and find the src folder, which holds the source code named flashled.asm. Double click to see it in the main window. 3. From the main menu select Project | Build Project, or press F7. 4. Select Run | Debug As>Application with CrossCore Debugger. If no processor or .dxe has been selected, choose the BF706, Figure 2a. Next, ensure that the EZ-Kit Lite is selected as the connection type and click Finish, Figure 2b. 5. Finally, load the flashled.dxe by double

💡 Buy the answer for only $12 Get it now →

clicking the “Add” button, as shown below. Make sure that “Load symbols only” is NOT selected, Figures 2c and 2d. 6. Click on Debug. CCES will now show the Debug window. To start the program, click on the “Resume” button from the top tool bar, or press F5 (or choose Run | Resume from the main menu). If you have followed the steps correctly, the yellow LED on the board should start to flash. The sequence is shown in Figure 2e. To become familiar with the compilation and download process, try altering the flash frequency by changing the delay variable in the program. (a) (b) Figure 1. Importing a project into the workspace of CCES. 4 (a) (b) (c) (d) (e) Figure 2. Program debug stages for CCES. 5 Preliminary task 2 The project inout is a simple real-time audio in/out program. It takes in stereo data from the phono inputs and sends them out in real time. Import the project as before. Before running the program, start playing the file named wave 1.wav using a suitable media player. This is a simple sine wave with a frequency of 1 kHz. If you have followed the steps correctly, the sine wave will appear on both channels of the oscilloscope. The program contains a code that comprises three major elements: 1. A codec configuration routine; 2. A SPORT configuration routine; 3. The main in-out loop. In all the exercises below, you will not need to alter the second routine. You will only need to alter the first routine in Exercise 2. Exercise 1 Import the project named gain1. Add the necessary in the missing section to multiply one channel by a gain of 3.7. The other channel should remain unchanged. Use wave 1.wav as the test signal. Exercise 2 Import the project named gain2. Add the necessary code so that the codec reduces the volume on the left channel by 4 dB. This must be a codec command, not an arithmetic operation. Use wave 1.wav as the test signal. You will need to refer to the ADAU1761 codec data sheet. Exercise 3 Import the project named modulate. Add the necessary code so that the right channel output is equal to (left in) × (right in), i.e. pure modulation, and the left channel output is equal to (right in) + ((left in) × (right in)), i.e. double sideband amplitude modulation, or DSBAM. Use wave 2.wav as the test signal. Exercise 4 Import the project named filter1. Add the necessary code so that it operates as a single MAC, 16-bit bandpass FIR filter on one channel only, leaving the other unchanged. It must recover a pure sine wave at 2 kHz embedded in broadband noise, from the test signal wave 3.wav. The filter coefficients should be read in as a file with an assembler directive. Use Signal Wizard to generate this filter file, which must be 2047 coefficients in length. The file should be saved in the src folder of the filter1 project, using the “Export Filter Data” dialogue box of Signal Wizard. Make sure that the “Blackfin+” option is selected. Exercise 5 Import the project named filter2. Add the necessary code so that it operates as a single MAC, 32-bit stopband FIR filter on both channels (note: since the input will be a mono source, you do not need to filter the second channel; just copy the output from the filtered channel). The filter must remove the jamming tones from the music signal wave 4.wav. The filter coefficients should be read in as a file with an assembler directive. Use Signal Wizard to generate this filter file, which must be 2047 coefficients in length. The file should be saved in the src folder of the filter2 project, using the “Export Filter Data” dialogue box of Signal Wizard. Make sure that the “Blackfin+” option is selected. In this case, Signal Wizard must also be used to identify the frequency of the jamming tones. Instead of using the oscilloscope, connect the output of the board to the loudspeakers, and run the system with the test signal. Exercise 6 Import the project named sinegen. Add the necessary code so that it operates as a look-up-table-based sine wave generator. The left channel should output 6 kHz and the right channel should output 12 kHz. Use the oscilloscope to verify that the program operates correctly. Exercise 7: Real-time DSP design project Each individual student must produce a report comprising: Cover page with just the course title, your name and/or student number. Main report body: two pages, font size 10, describing the main components of a DSP system intended for real-time audio digital signal processing. The report must include a diagram of the main components. In addition, the report must identify key features of DSP devices that distinguish them from general-purpose 6 microprocessors, and which optimize them for signal processing operations. The report must be in PDF format and be uploaded to Blackboard within the specified deadline. Under no circumstances exceed the two-page limit. Doing so will incur a penalty of 15%. Overall mark Your overall, individual mark will be the sum of the marks awarded for all sections. It is important that you each engage fully with the program tasks, i.e. exercises 1 to 6, to ensure that the team mark is as high as possible.

💡 Buy the answer for only $12 Get it now →