
































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

































First assignment ā read all of Chapter 1. Introduces the concepts that we will be studying this semester along with application areas. Bring your textbook to class to refer to the graphics. Ch. 1 Introduction Some information in this section was obtained from other university DSP class web sites including those from Stanford, University of Manchester, McGill, and University of British Columbia First we explain the concept of a signal : a signal can be broadly defined as any physical quantity that varies as a function of time and / or space, and has the ability to convey information. Signals are everywhere in science and engineering. Examples include: Electrical signals: currents and voltages in AC circuits, radio communications signals, video signals. Mechanical signals: sound or pressure waves, vibrations in a structure, earthquakes. Biomedical signals: electro-encephalogram, lung and heart monitoring, X-ray and other types of images. Finance: time variations of a stock value or a market index. Block diagram of signal and system Input Signal -> System -> Output Signal The system āoperatesā in some manner on the input signal and produces an output signal. The system can amplify, filter, add noise or convert an analog signal to a digital one (focus of this class). Key point ā a signal is a carrier of information within the system but is fragile - must treat it carefully to preserve the information it contains. So now look at the components that make up the phrase digital signal processing (DSP): Digital - sampling or quantization in time or quantization in amplitude (less frequently used). Analog to digital converters (ADC) play a key role in converting signals from analog to digital so that we can use digital computers to analyze or to process. Signal - a measurement from a physical system e.g. music, speech, video, electrocardiogram, sonar, radar, seismic, radio astronomy. A signal can also involve some type of transducer (e.g. microphone or antenna). Processing - extract information from the signal e.g. target detection, range measurement, transmitted message extraction, speech recognition, or image formation. Condition the signal for subsequent use e.g. filtering for noise reduction, shaping of signal spectrum. Transform the signal e.g. spectral (to separate
frequency bands), spatial (to fit image to a map projection). Alter the structure of the signal e.g. bandshifting, baseband conversion (complex output). So why do we use DSP?
Noise cancellation aircraft, cars, air conditioning Vision analysis Security, robotics, user interfaces Spread spectrum Security, communications Pulse compression Radar, sonar, seismic, GPS Image processing Medical imaging ā CAT scans, ultrasound, MRI Image analysis Digital photography, video, multimedia, games Data compression MP3 audio, JPEG images Beamforming Radar, sonar, medical imaging Echo cancellation Analog phone lines, speakerphones, modems Medical signal analysis EEGs, ECGs Spectral estimation Signal analysis, sonar, professional audio In Section 1.3 the author introduces some of the key DSP operations we will be covering this semester: convolution, correlation, digital filtering, discrete transformations, and modulation. Read about them but donāt worry about the details because we will be going over them later.
Chapter 2. Analog I/O Interface for Real-Time DSP Systems Assignment read Chapter 2. Begin with a block diagram of a typical real-time DSP system: Figure 2.1 p. 38 The analog input filter is used to band-limit the analog input signal prior to digitization in order to reduce aliasing (discuss later). The ADC converts the analog input signal into digital form. A Sample and hold is used to āfreezeā the analog input signal so that the converter can work properly (it needs a finite amount of time in which to acquire and convert the signal). Often this component is built into the ADC chip. The digital processor āoperatesā on the digitized signal in some way (filter, change frequency etc. discuss more in class). If the signal is to be used back in the analog world, it needs to be converted back to analog using a DAC. The last stage is generally an output filter where we remove unwanted high frequency components. The heart of this system is the DSP, which can be a general purpose uP (Intel, AMD etc.) or a special purpose DSP chip (TI, Motorola / Freescale etc.). Remember that for a uP or DSP to operate on the signal, it must be in digital form.
Now we will discuss a key sampling theorem: if the highest frequency component in an analog signal is fmax, then the signal must be sampled a minimum rate of at least 2 * fmax in order to preserve the information contained in the original signal (called the Nyquist theorem). For example if we are sampling a 4 KHz signal, we need to sample at least at 8 KHz or higher. If we sample at a slower rate, we lose some of the signal information due to aliasing. In telephone applications, the highest frequency of general interest is around 3.4 KHz but speech signals can extend beyond 10 KHz (thatās one reason why voices donāt sound āquite rightā on the telephone). We will need to filter out signals beyond 3.4 KHz prior to using DSP techniques (anti-aliasing filter). Figure 2.4 below shows an example of aliasing.
Note that our signal (actual) is being sampled at intervals of T seconds which is NOT fast enough according to our frequency sampling theorem. What the DSP assumes is that the actual signal looks like the aliased one in the figure. This is the lowest frequency signal that fits all the sampled points. Aliasing is basically the mistaken assumption that a signal is made up of lower frequency components than in reality. We can see this visually by looking at westerns when the camera shows wagon wheel spokes appearing to rotate at a different speed then the wagon itself. We now demonstrate aliasing with a simple example. We have two sinusoids present in a signal at 1 and 4 Hz but we are only sampling at 5 Hz instead of a minimum of 8 Hz. Our Nyquist frequency is therefore 2.5 Hz and our 4 Hz signal is āfoldedā over our 2.5 Hz signal and ends up on top of our 1 Hz signal erroneously increasing its apparent signal power. ( 4 ā 2.5 = 1.5 so 4 folds over to 2.5 ā 1.5 = 1 Hz). This process continues at higher and higher frequencies e.g. 1, 4, 6, 9, 11, 14, 16 Hz, etc. all end up with energy at 1 Hz. Aliasing occurs when f 2 is related to f 1 by f (^) 2 ļ½ 2 kfn ļ± f 1 fork ļ³ 1 When k = 1 and 2 for our previous example where the Nyquist frequency is 2.5 Hz then the frequencies that fold over onto 1 are
The web has some demos of aliasing to look at;
The result of this multiplication is shown in part d of the figure. On the right side of this figure we also see what is happening in the frequency domain. What is important here is that multiplication in the time domain is mathematically equivalent to convolution in the frequency domain. We will discuss convolution in more detail later. The key thing to note in the sampled frequency plot is that the spectrum looks the same as in our original input signal but repeated at multiples of the sampling frequency. Note that each block is separated from all others ā in other words we were sampling at a sufficiently high enough rate in order to eliminate aliasing. Now compare this frequency distribution with the one shown in
Figure 2.6 p. 43 Note here we have an overlap in the frequency content at each sampling interval, which means we are aliasing our signal. We lose the frequency information contained in the overlapping regions. Overlap or aliasing occurs about the point FN in this figure, which is half the sampling frequency point and is known as the folding or Nyquist frequency. In practice, aliasing is always present because of noise and the existence of high frequency signal components. The engineering problem is to decide what level of aliasing is acceptable and design the appropriate filter and sampling frequency for your DSP system. Now look at a short anti-aliasing example in Figure 2.7 on p. 44
30dB is 1 / 1000 etc.with respect to power). If we look at voltage then multiply these by 2 i.e. if the voltage drops by a factor of 2 this represents a -6dB drop in voltage. Therefore in Fig 2.7b our signal voltage has dropped 60 dB which represents a reduction in voltage by a factor of 1000. We see that we have reduced our voltage signal by a factor of 1000 from the cut-off frequency to the stop-band frequency. This anti-aliasing filter should provide sufficient attenuation of the signal above the Nyquist frequency (which is generally specified as fN or fs). It is also useful to take the ADC resolution requirements into account in your design. A filter should be designed to attenuate frequencies above the Nyquist to a level not detectable by the ADC (i.e. less than the quantization noise level
Table 2.1 below shows estimates of the minimum low-pass filter stopband attenuation (Amin) for various ADC resolutions; B Amin (dB) 8 50 10 62 12 74 16 98 As we mentioned before, this analog filter design has introduced phase distortion into the signal. Any signal varying in amplitude with time can be understood as component sinusoids of different frequencies (e.g. Fourier Transformation). If one of these frequency components is time delayed by any amount other than zero, then we say the original signal has phase distortion. All non-ideal filters introduce a time delay between the filter input and output terminals. This delay can be represented as a phase shift if a sine wave is passed through the filter. The extent of phase shift depends on the filter's transfer function. For most filter shapes, the amount of phase shift changes with the input signal frequency. Phase delay is convenient because it expresses the phase response of a system (or
the phase of a signal), which ranges from zero to 360 degrees, as a time delay. So the units of phase delay are seconds, and it tells us how many seconds a sinusoid will be delayed when it goes through a LTI system. For some filter applications it is desirable to preserve a transient waveform while removing higher frequency noise components from the signal. If each of the frequency components of the input waveform (from the Fourier series or the Fourier transform) is phase shifted an amount linearly proportional to frequency, then they remain in the correct time relationship and sum together to create, at the output, the original waveform that was present at the input of the filter, with the higher frequencies components having been removed by the filter. When a filter has phase delay that varies linearly with frequency it is called a linear phase filter. The expression "linear phase" refers to a frequency response where the phase q( f ) increases linearly with frequency f. We see that linear phase is a pure time delay d, independent of frequency. A linear phase system, therefore, can adjust the amplitudes of the signal's frequency components without changing their relative time alignment. Phase distortion is audible under the right circumstances to certain people, but the consensus is it is rather subtle at best, especially in relation to other forms of distortion. Phase is chaotic in reverberant environments, but the direct sound is not affected by reverberation. In some situations such as choral music in a cathedral at the back of the audience, phase is totally messed up. The following is from http://www.ocf.berkeley.edu/~ashon/audio/phase/phaseaud2.htm To measure the phase performance of a loudspeaker, we look at step response instead of the impulse response for cleaner data. A step function would be a voltage which instantaneously rises from zero to a positive value and stays there (figure 3). The following diagrams use MLSSA: Maximum-Length Sequence, averaging across a number of samples trained at random periods.
A typical phase-inaccurate loudspeaker response is shown in figure 5. ( figure 5 ) Typical Loudspeaker Step Response In this phase-inaccurate loudspeaker step response that is a measurement summing tweeter and woofer response, we see the tweeter initially rising with the input voltage (figure 6), but the woofer that is lagging by 180 degrees contributes the rapid falling immediately afterwards (figure 7), resulting in a distorted step response.
Section 2.4 Uniform and Non-uniform Quantization After sampling, the amplitudes of the analog samples are generally quantized and encoded using either uniform or non-uniform techniques. Audio and medical apps generally use uniform techniques, while communication systems often use non-uniform techniques because of the need to compress speech signals. In uniform quanitization and encoding, each analog sample is assigned to one of 2B^ values where B is the number of ADC bits. This process ALWAYS introduces an error which CANNOT be removed. The amount of error is dependent on the number of ADC bits and is approximately equal to ½ of the LSB (Least Significant Bit). For example if you have a 12-bit ADC and are measuring an analog voltage range between ā10 and 10V then your LSB is 20 / 2^12 = 0.004883 = 4.883 mV. This means your error is about ½ that = 2.441 mV. The LSB represents the interval between each quantization level. Cost increases with increasing number of bits in your ADC and remember it is unnecessary to use an ADC that yields an accuracy better than the signal-to-noise (SNR) of your original analog signal. The dynamic range is the ratio of the maximum to minimum signal levels that an ADC can handle and is often expressed in dB. Equation 2.19 p. 67 D = 20 log 2B From Example 2.9 if we want a dynamic range greater than 70 dB, using Eq. 2.19 we see that B = 11.62. We therefore pick our ADC to be a minimum of 12 bits. Next we look at the ADC aperture time which is the conversion time of the ADC and refers to the period of time over which the analog input signal must remain stable. The maximum allowed aperture time is given by
So if our analog signal contains frequencies up to 20 KHz, our maximum aperture time is 1.94 ns. This short amount of time would mean you would probably need a S/H prior to your ADC. Uniform quantization is useful when the signal amplitudes are āreasonablyā uniformly distributed (not the case for speech). In speech, we find both small and large amplitudes, with small being more likely. A uniform quantization would require a lot of ADC bits to cover the full range. So instead speech is sampled at 8 KHz and each sample quantized into 8 bits. Then the amplitude of the speech samples are log compressed
into 8 bits before transmission. See more details on p. 68-71. Remember what the log does (compresses large numbers more than small numbers). Section 2.5 Oversampling in A/D Conversion The trend in many areas of DSP is to oversample to exploit the practical implications of the sampling theorem. Oversampling simplifies the anti-aliasing filter, helps support a system with variable cut-off frequencies and reduces the ADC noise floor by spreading the quantization noise over a wider bandwidth (fewer bits required in your ADC). Look at Example 2.10 in your text and read the rest of this section ā the details are not critical but see how they are designing DSP systems. Section 2.7 The DAC The basic DAC accepts parallel digital data and produces an analog output signal. A register is used to buffer the DAC to ensure that its output remains the same until the DAC is fed the next digital input. Again read this section on your own and donāt worry about the details. Also read the rest of the sections in Chapter 2 on your own.