ECE 3551: Microcomputer Systems 1 Final Project: Audio Effects Engine Nick Karl 12/11/09 Objective: To use the Analog Devices BF533 board, and VisualDSP++, to create an audio effects engine demo. This project displays aptitude using many of the boards functions, including LED’s, switches, timers, filters, audio effects, and other concepts that we have talked about in the labs and in the course lectures. Hardware/Software Used: 1) ADSP-BF533 EZ-KIT LITE Board 2) Analog Devices VisualDSP++ ver5.0 3) Speakers and Audio Source (Computer) 4) Assorted Cables and Adapters Operation: 1) PF8 is the output selection button/flag. a) 1st state, initial, is muted, no output, no LEDs. b) 2nd state, one press, original input is output, LED 5 is medium. c) 3rd state, two presses, filtered output is output, LED 4 is medium. d) 4th state, three presses, effected output is output, LED 4&5 are medium. e) 5th state, four presses, total output is output, LED 4&5 are solid. 2) PF9 is the filter selection button/flag. a) 1st state, initial, is no filter, LED 7 is off. b) 2nd state, one press, is a low-pass filter, LED 7 is medium. c) 3rd state, two presses, is a high-pass filter, LED 7 is solid. 3) PF10 is the effect input selection button/flag. a) 1st state, initial, sets effect input to none, LED 8 is off. b) 2nd state, one press, sets effect input to original input, LED 8 is low. c) 3rd state, two presses, sets effect input to filtered output, LED 8 is high. d) 4th state, three presses, sets effect input to a combination, LED 8 is solid. 4) PF11 is the effect type selection button/flag. a) 1st state, initial, sets effect to none, LED 9 is off. b) 2nd state, one press, sets effect type to chorus, LED 9 is low. c) 3rd state, two presses, sets effect type to flanger, LED 9 is high. d) 4th state, three presses, sets effect type to echo, LED 9 is solid. Final.c Additions: In Final.c I added multiple variable that are necessary for my project, both the filters, effects, and the control systems needed multiple additional variables. I also removed unneeded variables that were in my Lab5 code. Otherwise everything remained the same as the talkthrough sample program. Talkthrough.h Additions: In Talkthrough.h I prototyped my functions, and initialized all of the global variables that I used, I also removed a few unused variables, but it remained mostly unchanged from Lab 5. Initialize.c Additions: All switches were used along with a timer. The functions set up the push button interrupt generation/register handling. I made major changes to this code while I was attempting to use a second timer, I never got it to work, and instead opted to use just one timer to control all of the LED intensity values, which was the better option. As it is my Initialize.c code is almost unchanged from the talkthough sample program. ISR.c Additions: ISR.c is basically the hub for my entire program. This is because all of the hardware interrupts converge in this code. Pushbuttons, sport0 audio sampling, and the timer have their roots here. For these reasons it made sense to base my code in this section. I have most of my code inside the interrupt handler for Sport0_RX_ISR. The code directly inside this interrupt uses the system status (based on the four push-button controlled var_ variables), to run the appropriate processing function, it also directly controls the LEDs which visually output the system status. The push buttons are also controlled here, each one controls one of the four var_ variables, which entirely describe the systems status. The timer is here, it simply counts up on a variable, and is used to cycle the LEDs on and off very quickly, giving a dimming effect. Process_data.c Additions: This file contains the four process data functions which process the data in different ways, the specific function run is dependent on the systems status, and the var_ variables are used by the functions during processing to apply the processing to the correct samples. These functions are run in ISR.c by the Sport0_RX_ISR interrupt. effects.c Additions: This file contains the four effects functions which operate on the iChannelLReffIN samples. These functions are called by the process data functions in ISR.c by the Sport0_RX_ISR interrupt. iir.c Additions: This file contains the three filtering functions which filter the input samples, and produce filtered samples. These functions are called by the process data functions in ISR.c by the Sport0_RX_ISR interrupt. The Infinite Impulse Response (IIR) filters were created in Matlab using fdatool and incorporating these filters in the signal path. Infinite Impulse Response (IIR) filters are one of the primary types of filters used in Digital Signal Processing. IIR filters are said to be infinite because they have feedback. Therefore, if you send an impulse through the system the output will never be quite zero. Discussion: My goal was to create a simple audio effects engine demo using the information communicated to me through the class lectures, and the laboratory exercises. In order to come to the final solution I began with my finished Lab 5 code, for the IIR filters, in fact the filters used in this project are the same as those designed in Lab 5. I decided to create an audio effects engine that mixes an input signal with a processed signal. It allows you to apply an audio effect not only to a stream of music, but also to a filtered version of the music, or a combination of the filtered input and the original. And moreover in the end it combines the processed signal, and the original signal to create an output. There were a couple of main task of the code were the effects, the filters, and tying it all together in the end. The effects were difficult to come up with, but not terrible. I unsuccessfully tried to implement chorus, and echo effects from the lecture presentations, but it didn’t come together until I looked up a project from a previous student, and found their implementation, after reviewing it I successfully implemented it into my project. The filters were not difficult to create, because I had already developed them in Lab 5. Tying it all together, adding in the control framework via push buttons, coding the LED indicators to reflect the status of the project, and using the timer to change the LED brightness all took time but came together in the end. In fact I had the most problems trying to implement a second timer, which turned out to be unnecessary, and figuring out how to mix the two signals together. The signal mixing had even Xerxes confused; we were getting static when we tried to play the average of the two signals. In the end I solved it by casting each signal into a float, and then casting the sum back into a int. Results: Overall I was able to perform the intended operations with the ADSP-BF533 processor and I acquired the desired goal while utilizing many of the topics we covered in lecture and lab. Therefore I conclude that my project was a success. The code works how I’d expect it to; all of the design features were successfully implemented.