Monday, 3 October 2016

DSP - basic introduction

In the coming few days I shall upload MATLAB codes of basic DSP implementations. But before getting started, I will explain what exactly is DSP and why it is so important, especially in the realm of music technology.

DSP is an abbreviation for Digital Signal Processing. Let us decode it. 

What is a signal?

Signal is anything carrying information. You say your name, that is a signal. The noise produced by a moving fan is a signal. So, signals can be useful or not useful/undesirable/unwanted/useless. In the terms of DSP, noise is an unwanted signal, and it needs to be attenuated to the extent that it is completely removed, so, we can get the desired signal.

Noise interferes with the original, desired signal.

In order to extract the original signal, we need to 'process' it in such a way that we can get it in a desired manner. Consider the following scenario:



In order to reach the audience, the meek lady's voice alone won't suffice. So, she uses a microphone to be audible to everyone in the auditorium. What does the microphone do? It takes a signal, processes it (amplifies) and sends signals to the speakers in the auditorium. It is a basic form of signal processing.

There are two types of signals: Analog and digital. Analog signals vary continuously in amplitude with time. There is no least time frame that you can identify and isolate in it. Figure shows an analog sinusoidal signal. Find MATLAB code here.


Digital signals, or discrete time signals take one of the finite number of values at specific points in time. Thus, they can be stored in the form of bits of information (streams of zero or 1). Consider a digital signal consisting of first 10 natural numbers, incrementing every second starting from zero. Figure shows a plot for the signal. Find MATLAB code here.


There is little flexibility in processing analog signals. The equipment is expensive, and passive components, whose properties vary with time, such as capacitors, transistors are used. 

So, now it can be understood that we need to convert an analog signal to a digital signal, process it, and convert it back to analog signal to get the desired signal. How does this take place? Steps:
  1. Input an analog signal to the processor.
  2. The first step in the processor is an anti-aliasing filter. What is aliasing? It is the distortion of the signal if it is sampled at a frequency less than twice the sampling frequency. The filter conditions the analog signal to prevent aliasing. So, what it does is that it restricts the bandwidth of the signal to satisfy the condition of sampling frequency being more than twice the sampling frequency (sampling theorem). The filter is used before sample-r, or the Analog to Digital converter.
  3. ADC discretizes the analog input.
  4. This digital signal is then processed, in a computer/microprocessor. The processing is primarily either analysis or filtering (removing noise, etc.).
  5. A digital to analog convertor, or a DAC converts the signal to an analog signal (the signal is in the form of a staircase now).
  6. The signal is then fed into a post-filter to smoothen the DAC output.

No comments:

Post a Comment