Book Image

Rapid BeagleBoard Prototyping with MATLAB and Simulink

Book Image

Rapid BeagleBoard Prototyping with MATLAB and Simulink

Overview of this book

As an open source embedded single-board computer with many standard interfaces, Beagleboard is ideal for building embedded audio/video systems to realize your practical ideas. The challenge is how to design and implement a good digital processing algorithm on Beagleboard quickly and easily without intensive low-level coding. Rapid BeagleBoard Prototyping with MATLAB and Simulink is a practical, hands-on guide providing you with a number of clear, step-by-step exercises which will help you take advantage of the power of Beagleboard and give you a good grounding in rapid prototyping techniques for your audio/video applications. Rapid BeagleBoard Prototyping with MATLAB and Simulink looks at rapid prototyping and how to apply these techniques to your audio/video applications with Beagleboard quickly and painlessly without intensive manual low-level coding. It will take you through a number of clear, practical recipes that will help you to take advantage of both the Beagleboard hardware platform and Matlab/Simulink signal processing. We will also take a look at building S-function blocks that work as hardware drivers and interfaces for Matlab/Simulink. This gives you more freedom to explore the full range of advantages provided by Beagleboard. By the end of this book, you will have a clear idea about Beagleboard and Matlab/Simulink rapid prototyping as well as how to develop voice recognition systems, motion detection systems with I/O access, and serial communication for your own applications such as a smart home.
Table of Contents (15 chapters)
Rapid BeagleBoard Prototyping with MATLAB and Simulink
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

The world of embedded system development has been evolving over the past few years with many emerging technologies in both the hardware and software fields. As an open source embedded single-board computer with many standard interfaces, BeagleBoard is an ideal embedded system development kit. Integrated with both an ARM 1GHz microprocessor and an IT's C6000 DSP processor, BeagleBoard's hardware is powerful enough to meet most demands of audio/video processing. The challenge now is how to design and implement a good digital processing algorithm on BeagleBoard quickly and easily, without intensive low-level coding. This book addresses this with the rapid prototyping tools of MATLAB/Simulink, including automatic embedded code generation and visual programming techniques, in a friendly Windows development environment.

This book is a hands-on guide for those interested in learning more about MATLAB/Simulink rapid prototyping techniques and practicing these techniques on a BeagleBoard.

Combing the power of BeagleBoard and MATLAB/Simulink, this book will walk you through a number of step-by-step exercises to give you a good grounding in rapid prototyping, and help you build your audio/video applications on a BeagleBoard. You can enjoy your ideas and algorithm development and let the big dog run your fancy inspiration.

What this book covers

Chapter 1, Introducing BeagleBoard, starts with an introduction to the BeagleBoard, followed by the concept of BeagleBoard-based rapid prototyping with MATLAB/Simulink. By the end of this chapter, the user will have a clear idea about the BeagleBoard and rapid prototyping on the Microsoft Windows platform.

Chapter 2, Installing Linux on the BeagleBoard, serves as a quick installation reference for new users and will look at setting up the BeagleBoard for rapid prototyping. We will then set up the development environment at a Windows 7 PC by installing some software and tools. Finally, we will connect the hardware and configure the BeagleBoard for rapid prototyping. By the end of this chapter, we will be ready to get started with our rapid prototyping and developing our applications.

Chapter 3, C/C++ Development with Eclipse on Windows, covers how to build our first program, a simple Hello World, at the Windows 7 host PC, and run it on the Linux BeagleBoard. We will be installing Eclipse Integrated Development Environment (IDE) and CodeBench Lite, a pure Windows-based cross-platform compiler on a Windows 7 host PC. Compared with setting up a cross-platform toolchain on a Linux host PC, the installation of a Windows-based toolchain is relatively straightforward, in which the configuration and path variable management are simplified with one click. Upon completion of this chapter, we will have a fully functional cross-development environment on Windows 7 and have a taste of the work flow of cross-platform embedded system development.

Chapter 4, Automatic Code Generation, looks at automatic code generation by MATLAB/Simulink for rapid prototyping. In this chapter, instead of typing lines of C code manually, we will develop our applications either in high-level MATLAB scripts or in a Simulink graphical programming environment, and generate executable standalone applications for the BeagleBoard. Two projects will be demonstrated: a program for average operation and a music player, where the techniques of tuning parameters on the fly will be used for performance optimization.

Chapter 5, Digital I/O and Serial Communication, discusses how to utilize digital I/O and serial communication ports on the BeagleBoard to drive external sensors, for example, an IR sensor for motion detection in smart home applications. We will talk in detail about voltage shifting, digital I/O operation, serial communication, and the data processing of motion detection via an IR sensor.

Chapter 6, Voice Recognition, demonstrates the rapid prototyping of a voice recognition system on a BeagleBoard, including RMS voice detection, feature extraction, pattern matching, and decision making. The demo is designed to operate for single users, and may be used in multiuser applications. The program in the demo can be further extended for various applications, such as voice control and speaker authorization in smart home applications.

Chapter 7, Digital Video-Based Motion Detector, is a step-by-step tutorial on converting a low-cost USB web-camera and a BeagleBoard into a motion detector. We will move into the rapid prototyping of video processing and develop an algorithm for capturing video frames and tracking of a moving object in the sequence of video frames. With the video processing algorithm being validated, you will be able to easily integrate it into your own embedded system and build various advanced applications, such as home security, vision analysis, and traffic monitoring.

Appendix, Wrapping Up, reviews what we have learned and looks at other interesting projects and techniques that you may use to prototype your own BeagleBoard project. It also provides a collection of links pointing you towards the resources used in this book and other information and projects you may be interested in.

What you need for this book

Some basic skills in programming and experiences in MATLAB/Simulink are preferred. No prior knowledge of the Linux operating system or the BeagleBoard is needed, although exposure to these technologies will certainly be helpful. An in-depth knowledge of electronics is not required, and the book provides a step-by-step guide to setting up components and software in each chapter.

What you really need is a great idea about your applications and developing your algorithm in a user-friendly environment.

Who this book is for

This book is aimed towards the amateur embedded system enthusiasts, DIYs, students, academic researchers, and R&D engineers who have some basic skills in programming and are looking for a better solution to embedded software development to implement and validate their audio/video processing algorithms on hardware.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Here, nbFrame is the number of possible frames for an audio signal u with length lenSig."

A block of code is set as follows:

real_T calcavg(const real_T a[10])
{
  real_T y;
  int32_T k;
  /* UNTITLED2 Summary of this function goes here */
  /* Detailed explanation goes here */
  y = a[0];
  for (k = 0; k < 9; k++) {
    y += a[k + 1];
  }
  return y / 10.0;
}

Any command-line input or output is written as follows:

set_param(bdroot,'SimulationCommand','update');

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Click on the Build button to generate the C code."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.