Professional Documents
Culture Documents
Altera Dspbook
Altera Dspbook
Introduction
This book is intended for those who work in or provide components for industries that use digital signal processing (DSP). There is a wide variety of industries that utilize this technology. While the engineers who implement applications using DSP must be very familiar with the technology, there are many others who can benefit from a basic knowledge of its fundamental principals, which is the goal of this book - to provide a basic tutorial on DSP. Mathematics will be minimized and intuitive understanding maximized. This book will demistify many difficult concepts like sampling, aliasing, imaginary numbers, frequency response, etc., using easy to understand examples, while providing an overview of the functions and implementation used in several DSP intensive applications. This is not a blackboard offering of equations as an explanation on DSP. The reader need only be comfortable with high school level math skills. Key concepts will be emphasized. After a complete reading you will likely be able to talk intelligently with others involved in DSP centric industries and understand many of its fundamental concepts.
1
www.newnespress.com
A complex number has a real and imaginary part, and the imaginary part is the square root of a negative number, which is really a non-existent number. Sound weird, well its technically true, so it will be examined in a much more intuitive way in the book. Complex numbers are needed to define a two dimensional number plane to understand DSP. The traditional number line extends from plus infinity to minus infinity, along a single line. To represent many of the concepts in DSP, two dimensions are needed. This requires two orthogonal axes (i.e. the horizontal line is the real number line, the vertical line is the imaginary line). All imaginary numbers are prefaced by j, which are defined as the -1. This is the essence of this whole chapter as shown in Figure 1.
Any complex number Z has a real and imaginary part, and is expressed as X + j Y, or just X + jY. The value of X and Y for any point is determined by the distance one must travel in the direction of each axis to arrive at the point. It can also be visualized as a point on the complex number plane, or as a vector originating at the origin and terminating at the point. There has to be a way to keep track the vertical and horizontal components. Thats where the j comes in. Complex Addition, Subtraction and Multiplication explanations and examples will be given in the book, as well as in-depth overviews of Polar Representation and Complex Multiplication using Polar Representation examples. Two points will be defined, Z1 and Z2. Z1 = R1 angle (1) Z2 = R2 angle (2)
3
www.newnespress.com
What this means is that with any two complex numbers, the magnitude, or distance from the origin to the radius, gets multiplied together to form the new magnitude. Examples will be given in the book. Complex Conjugate This is the last example that will be covered in the book. This is a special case and will be explained why. Imaginary numbers are used to form complex numbers. They are really not so complex, and imaginary is really a very misleading description. What will be explained is to how to create a two dimensional number plane and define a set of expanded arithmetic rules to manipulate the numbers in it. Next the complex exponential which is simply the unit circle (radius = 1) on the complex number plane will be explained. The last part of this chapter involves measuring angles in radians, which is seen everywhere in DSP. The angle measurement in radians is based upon , which is a number defined to have a value of about 3.141592 (it actually is an irrational number, with infinite number of digits, like 1/3 = 0.3333.). It takes exactly 2 radians to describe a full circle. This same concept will be examined later in sampling theory, where everything tends to wrap around or behave periodically. We can visualize this as traveling either clockwise (negative rotation) or counter clockwise (positive rotation) around the circle. There is one more DSP convention to be aware of. The real component (X was used earlier) it is usually called the I or in-phasecomponent, and the imaginary component (used Y) is usually referred to as the Q or quadrature component. In many DSP algorithms, the digital signal processing must be performed simultaneously on both I and Q data streams, which simply represents the signals movement, over time, within the two dimensions of the complex number plane.
4
www.newnespress.com
The dashed blue line shows how the sampled signal will appear if the sample dots and smooth out the signal are connected. Notice that since the actual (red solid line) signal is changing so rapidly between sampling instants, this movement is not apparent in the sampled version of the signal. The sampled version actually appears to be a lower frequency signal than the actual signal. This effect is known as aliasing. Quantifying how fast to sample accurately represents a given signal. Understanding exactly what is happening when aliasing occurs is also needed. A detailed description of how aliasing can be useful is covered in the book. Nyquist Sampling Rule To prevent mistaking a fast changing signal for a slow moving signal, always sample at least twice as fast as the frequency of the signal that is of interest. Some margin is needed to assure that sampling is done at a rate that is more than twice as fast as the signal. Looking at the example in the book provides an interesting scenario. 5
www.newnespress.com
To summarize, whenever there is a sampled signal, you cannot really be sure of its frequency. But if the rule was followed - that the signal was sampled at more than twice the frequency of the signal, then the sampled signal will really represent the same frequency as the actual signal prior to sampling. The critical frequency, which is the signal must not ever exceed, is one half of the sampling frequency. This is called the Nyquist frequency. This rule is fully explained in the book, if the rule is followed, then the aliasing phenomenon can be avoided. In the next chapter, signals and sampling in the frequency (or spectral) domain will be represented by plotting the signal spectrum, the X axis will represent increasing frequency as shown in Figure 4.
Figure 4. Plotting the Signal Spectrum along the X axis Represents Increasing Frequency
Thus far, the most important effects of sampling have been covered, but there is one remaining issue related to sampling that is quantization, which deals with the noiseintroduced by the limits of the numerical precision being worked with. This is where quantization comes into play and it is explained in detail in the book.
frequency of the complex exponential reaches the Nyquist frequency, the maximum frequency which can be represented for a given sampling rate has been reached. A complex exponential signal is fully explained in the book as well as re-examing the frequency response. **************************************************************************
Chapters 5 8 of Digital Signal Processing: A Practical Guide covering Finite Impulse Response (FIR) Filters, Windowing, Decimation and Interpolation and Infinite Impulse Response (IIR) Filters will be covered in the next installment of this book here in DSP DesignLine in late November or sign up for the RSS Feed on DSP DesignLine. Digital Signal Processing: A Practical Guide is being published by Elsevier Science & Technology Books - Newnes Press and will be available for purchase at ESC Silicon Valley, being held at the San Jose Convention Center on April 26 - 29, 2010. Order on line at: www.elsevierdirect.com/9781856179218 You can also save 20% when pre-ordering this book by entering the following promotional code at checkout- 97521.
7
www.newnespress.com