Digital Signal Processing VO Embedded Systems Engineering Armin Wasicek WS 2009/10
Overview Signals and Systems Processing of Signals Display of Signals Digital Signal Processors Common Signal Processing Tasks Summary and Outlook 2
Definition Signals and Systems A (discrete real-time) Signal is a sequence of integers representing the amplitude value of a physical variable over time or another physical variable. A System is which can record, replay, display, or transmit a signal. Systems produce new signals of representations of signals. 3
Characteristics of a Signal Amplitude A : Magnitude of change in the oscillating variable Frequency f : Number of oscillations per unit of time Phase θ : Offset in the displacement from a specified reference point 4
Transmission of Signals A carrier signal is a transmitted electromagnetic pulse or wave at a steady base frequency of alternation on which information can be imposed by increasing signal strength, varying the base frequency, varying the wave phase, or other means. Modulation: Amplitude modulation involves altering the amplitude of a sinusoidal voltage waveform by the source information, Frequency modulation changes the frequency. Phase modulation changes the phase of the carrier signal. 5
Amplitude modulation Amplitude modulation varies the strength of the transmitted signal in relation to the information being sent. Applications: Audio, radio 6
Frequency modulation Frequency modulation varies the sine-wave carrier by an amount proportional to the magnitude of the modulating wave. Applications: Audio, radio 7
Phase modulation Phase modulation changes the phase of a periodic carrier signal is changed in accordance with the information signal Applications: remote control 8
Noise Noise is a disturbance, especially a random and persistent disturbance, that obscures or reduces the clarity of a signal. The effects of noise create signal loss and distortion. This is impossible to recover, since amplifying the signal to recover attenuated parts of the signal amplifies the noise (distortion/interference) as well. In digital technology, noise is meaningless for the generation, duplication and storage of information. 9
Overview Signals and Systems Processing of Signals Display of Signals Digital Signal Processors Common Signal Processing Tasks Summary and Outlook 10
Signal Processing Tasks System Analysis Known: System and Input Unknown: Output System Synthesis Known: Input and Output Unknown: System Measurement Known: System and output Unknown: Input 11
Filter Any device (system) used to reject signals or certain frequencies within a signal while allowing others to pass. Low pass filter: passes low-frequency signals but attenuates (reduces the amplitude of) signals with frequencies higher than the cutoff frequency. High pass filter: passes high-frequency signals but attenuates signals with frequencies lower than the cutoff frequency. Band pass filter: is a combination of both. 12
Finite-Impulse Response Filter (FIR) The impulse response of an Nth order FIR filter lasts for N+1 samples, and then dies to zero x[n] is the input signal, y[n] is the output signal, b i are the filter coefficients, and N is the filter order an Nth-order filter has (N + 1) terms on the right-hand side; these are commonly referred to as taps. 2nd order moving average FIR 13
Infinite-Impulse Response Filter IIR systems have an impulse response function that is non zero over an infinite length of time Internal feedback and may continue to respond indefinitely In actual practice, no more than about a dozen recursion coefficients can be used or the filter becomes unstable (i.e., the output continually increases or oscillates) 14
Overview Signals and Systems Processing of Signals Display of Signals Digital Signal Processors Common Signal Processing Tasks Summary and Outlook 15
Fourier Transform Creates a frequency domain representation of a section of an input signal Fourier transform decomposes a function into oscillatory functions Discrete Fourier transform (DFT) simpler Fast Fourier Transform (FFT) more efficient Result of FT are magnitude and phase of each frequency component; represented as a 2-dimensional vector or a complex number Inversion is the ifft; algorithms the same, but with other coefficients 16
Frequency Spectrum 17
Overview Signals and Systems Processing of Signals Display of Signals Digital Signal Processors Common Signal Processing Tasks Summary and Outlook 18
Advantages of Digital Technology Long-time and temperature stability High exactness with big data word sizes Reproducibility, similarly assembled hardware systems will have similar properties Adjustments made easily High reliability Low interference liability 19
Disadvantages of Digital Technology Number of circuit elements is higher Finite number of states can be represented Loss of information due to A/D conversion Analog user interfaces are better human readable 20
Digital Signal Processors (DSP) Digital signal processing algorithms typically require a large number of mathematical operations to be performed quickly on a set of data. DSP operation must complete within some time constraint. General-purpose microprocessors are not suitable for application of mobile telephone and pocket PDA systems etc. because of power supply and space limit. Specialized DSPs provide a lower-cost solution and better performance 21
DSP Architecture features Processor architecture optimized for data throughput Mostly Harvard (separate instruction and data memory) or Dual Harvard (1 instruction, 2 data memories) architectures Caches have minor relevance (they push peak performance) Very Large Instruction Word (VLIW) instruction encodes multiple operations Can address, e.g., 2 mac, 2 alu, 2 load store units Zero overhead loops / hardware counted loops for(i=0;i<n;i++) type loops increment is computed in processor Modulo addressing (for circular buffers) 22
Coding filter algorithms Generic implementations of all kinds of filter algorithms exist Code is parameterized by means of coefficients Coefficients can be computed by software function lowpass(real[0..n] x, real dt, real RC) var real[0..n] y var real a:= dt / (RC + dt) y[0] := x[0] for i from 1 to n y[i] := a* x[i] + (1 a) * y[i 1] return y 23
Generated Filter Code Signal values relevant for filter (window) are stored in xv Coefficients are stored in an array (xcoeffs) First loop slides window and inserts new input value Second loop computes FIR filter function Sum is the output value #define NZEROS 2 #define GAIN 1.984375000e+00 static float xv[nzeros+1]; static float xcoeffs[] = { +0.9921875000, +0.0000000000, 0.9921875000, }; static void filterloop() { for (;;) { float sum; for (int i = 0; i < NZEROS; i++) xv[i] = xv[i+1]; xv[nzeros] = next input value / GAIN; sum = 0.0; for (i = 0; i<= NZEROS; i++) sum += (xcoeffs[i] * xv[i]); next output value = sum; } } 24
Overview Signals and Systems Processing of Signals Display of Signals Digital Signal Processors Common Signal Processing Tasks Summary and Outlook 25
Application overview Statistical signal processing: analyzing and extracting information from signals based on their statistical properties Audio signal processing: for electrical signals representing sound, such as speech or music Speech signal processing: for processing and interpreting spoken words Image processing: in digital cameras, computers, and various imaging systems Video processing: for interpreting moving pictures Array processing: for processing signals from arrays of sensors Filtering: used in many fields to process signals 26
Digital Signal Processing in ESE LU Example 3: Signal Analysis with TTP/A 27
Overview Signals and Systems Processing of Signals Display of Signals Digital Signal Processors Common Signal Processing Tasks Summary and Outlook 28
Summary Signal, system, modulation Filters (FIR, IIR) Fourier Transform Advantages and disadvantages of digital technology Coding filter algorithms 29
References AVR223: Digital Filters with AVR http://www.atmel.com/dyn/resources/prod_documents/doc2527.pdf http://www.atmel.com/dyn/resources/prod_documents/avr223.zip Filter design coefficients http://www-users.cs.york.ac.uk/~fisher/mkfilter/ Presentation pictures most at http://www.wikipedia.org 30
THE END Thanks for your attention! 31
Frequency Filters Filters are frequency-dependent frequency response stopband 32