• Increase font size
  • Default font size
  • Decrease font size

DSP tutorial

E-mail Print PDF
This basic DSP tutorial will help you understand what is Digital Signal Processing, what a Digital Signal Processing System is made of and some theoretical matters like sampling theorem aliasing etc.. The DSP system components like Analog to Digital Converter, Digital to Analog Converter are also is introduced. remember this is for beginners..! not for veterans


What is signal processing ?

        Signal processing is the action of changing one or more features (parameters) of a signal according to a predetermined requirement. The parameters that is to be changed may be , amplitude, frequency, phase etc... of the signal . The signal which undergoes such a process is known as input signal. And the entity which performs this processing is known as "Signal processing system" or simply system. ie; the input signal is fed to the system and the appropriately processed signal is coming out of the system. This signal is known as the "Output signal". This process is illustrated below.

DSP system

Some of the signal processing tasks are Amplification, Attenuation, Filtering, Modulation, etc... . To accomplish the required task, the "system" is designed with appropriate behavior and features. ie; for an amplifier, the "system" is designed such that any input signal going to the "system" will be amplified. In actual circuit, such a behavior can be realized using transistors , FET or Op-Amps. This sort of signal processing is known as analog signal processing. Well !, then what is Digital Signal Processing ....?

Analog signal processing Vs Digital Signal Processing

        In analog processing system the information is represented as an analog quantity. ie; something that varies continuously with time. This "something" can be voltage , current etc.. . for example, the signal that comes out of a microphone is analog in nature. The varying voltage from the microphone is processed using an analog signal processing system known as "amplifier" , and reproduced through a speaker.

        Where in Digital Signal Processing system , the information is represented in digital format. The signals that are to be processed is converted into numerical form before any processing. This conversion is known as sampling. The information contained in an analog signal is first converted to digital samples which are equally spaced in time. The figure below shows an analog signal and its sampled version.


Each of these samples are converted in to a numerical value and stored in the computer's memory. Processing is then done on these samples. The sampling in a Digital Signal Processing system is governed by a theorem known as sampling theorem.

Sampling theorem

        According to sampling theorem, an analog signal can be exactly reconstructed from its samples if the sampling rate is at least twice the highest frequency component present in the signal. This means, if the signal contains the highest frequency component of 1KHz, the sampling rate must be at least 2 Kilo Samples/ Second. This sampling rate is also known as Nyquist rate.         What if sampling theorem is not satisfied..? violation of sampling theorem means , sampling the signal at a sample rate less than Nyquist rate. This leads to unacceptable distortion in the signal . this distortion is known as aliasing. Due to aliasing , the components present in the input signal whose frequency is higher Nyquist frequency will be sampled as a signal of lower frequency. And this aliased samples in turn corrupts the original signal which is lower than Nyquist frequency. Due to the presence of aliasing , a signal that contains frequency components higher than Nyquist frequency can not be reconstructed from it's samples. The effect of aliasing is shown in the figure below.


The signal shown in black color is the original signal. While the signal shown in violate color is the aliased signal because of improper sampling. From the figure it is obvious that the aliased signal will be present in the sampled data as a lower frequency signal. And this will affect the original content at that frequency.

        It should be noted that the information in between two consecutive samples is lost forever. But still the entire signal can be reconstructed from the samples as long as Sampling theorem is satisfied.

Sampling and quantization

       Sampling can be viewed theoretically as multiplying the original signal with a train of pulses with unit amplitude. This leaves the original signal with information at descrete points with magnitude of signal present in the original signal at that position. This is illustrated in the figure below.


This can be implemented using an AND gate as shown below.


Now samples of the input signal is taken at discrete points. But in order to manipulate the signal with a microprocessor or micro controller, these pulses has to be converted in to numbers. Before this conversion, the pulses are quantized to some finite number of quantization levels. For example, if the quantization levels are 0,1,2,3, etc... , a pulse with magnitude between 1 and 2 will be quantized to either 1 or 2. This in fact introduces a noise in the sampled signal. Such noise in known as quantization noise.


       In practical applications, all these steps including sampling, quantization and converting to numerical format are done in single step. And this process altogether is known as "sampling" itself. Further in this document, the term "sampling" means all these steps together. In practical circuits, the device which is used for sampling is known as ADC (Analog to Digital Converter). ADC takes analog signal as input and spits out digital data corresponding to the analog signal. Different types of ADCs works on different principles. some of the popularly used types of ADCs are,

  • Flash ADC
  • Successive approximation ADC
  • Sigma - Delta ADC

        Of these Flash ADC provides fastest sampling, but it is much costly and seldom used in normal applications. Successive Approximation ADC is the most popularly used as it gives the best trade-off between cost and speed.

        After processing the samples has to be converted back to analog voltage. This is done by using a device known as DAC (Digital to Analog Converter). DAC does exactly opposite to what ADC has done. The DAC takes digital data as input and produces corresponding analog voltage. DACs are less expensive compared to ADCs.

        Taking all these in account, we can now come to the idea of physical realization of a Digital Signal Processing system. As we know, in a DSP system, the signal has to be first converted in to digital format , process it and then convert back to analog format. All theses things can be achieved by using a system shown below.

DSP System

Digital Signal Processor

        Since the DSP system represents the signal as numbers , the digital signal processor must be capable of manipulating numbers. As we know, it is nothing but a computer. A general purpose computer or a dedicated digital signal processor can be used for signal processing. The dedicated signal processors are specially designed for DSP applications, and which outperforms the general purpose computers in processing efficiency. this is because the instructions, memory and other features of a dedicated Digital Signal Processor is optimized for DSP applications. Many companies like Texas Instruments, Analog Devices ,Motorola etc.. has dedicated Signal Processors optimized for different applications.

Digital Signal Processing techniques

        The applications of DSP are numerous, simple toys to satellites... DSP is well suited for any application since it can do almost all processing that can be done using analog circuitry. The major drawbacks of DSP are comparatively high cost and distortion because of finite word length used in signal processors. Since in DSP applications , most of the hardware can be replaced with software, eventually DSP will become cost effective in most of the applications. The Digital Signal Processor mimics the behavior of analog circuitry using some DSP techniques and algorithms. The techniques that are commonly used in DSP are convolution, spectral analysis and manipulation, filtering etc.... .

DSP sample programs

        Here you can download some DSP sample programs written in visual basic.
click here for DSP samples