i KIGALI INSTITUTE OF SCIENCE AND TECHNOLOGY (KIST) Avenue de l’armée PO BOX 3900 Kigali – Rwanda www.kist.ac.rw FACULTY OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS PROGRAM OF ELECTRONICS AND TELECOMMUNICATION PROJECT REPORT ON Submitted by: GASHEMA Gaspard (GS 20060092) IYAKAREMYE Dieudonné (GS 20060189) Under guidance of: Supervisor: TWIRINGIYIMANA Remy Submitted in partial fulfillment of the requirements for the award of BACHELOR OF SCIENCE DEGREE IN ELECTRICAL AND ELECTRONICS ENGINEERING (EEE) September, 2010 DESIGN OF A COMPUTER-BASED SYSTEM TO PROCESS AN ANALOG SIGNAL
67
Embed
Design of a computer based system to process an analog signal
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
i
KIGALI INSTITUTE OF SCIENCE AND TECHNOLOGY (KIST)
Avenue de l’armée
PO BOX 3900 Kigali – Rwanda
www.kist.ac.rw
FACULTY OF ENGINEERING
DEPARTMENT OF ELECTRICAL AND ELECTRONICS
PROGRAM OF ELECTRONICS AND TELECOMMUNICATION
PROJECT REPORT ON
Submitted by:
GASHEMA Gaspard (GS 20060092)
IYAKAREMYE Dieudonné (GS 20060189)
Under guidance of:
Supervisor: TWIRINGIYIMANA Remy
Submitted in partial fulfillment of the requirements for the award of
This is to certify that the work presented in this report entitled: “DESIGN OF COMPUTER
BASED SYSTEM TO PROCESS AN ANALOG SIGNAL ” is an original work of
GASHEMA Gaspard and IYAKAREMYE Dieudonné; and it has not been submitted to any
university or elsewhere in any form for the award of any degree.
Supervisor Head Of Department of Electrical and Electronic
Engineering:
TWIRINGIYIMANA Remy ZIMULINDA François
Signature: ……………………… Signature:…………………………………………
Date…:………………………… Date …..……………………………………..
iii
DECLARATION
We, GASHEMA Gaspard and IYAKAREMYE Dieudonné, hereby declare that, the work
presented in this report is our own contribution. To the best of our knowledge, this same work
has never been presented or submitted to any other Universities or institutions of higher learning
for the award of any degree.
We therefore declare that, this work is our own contribution for the partial fulfillment of the
award of the degree of Electronics and Telecommunication Engineering in KIST.
GASHEMA Gaspard IYAKAREMYE Dieudonné
REG No.: GS20060092 REG N
o.: GS20060189
Signature: ……………… Signature: ………………
Date: …………………… Date: ……………………
This report has been submitted for examination with the approval of the following supervisor:
TWIRINGIYIMANA Remy
Department of Electrical and Electronics Engineering, KIST
Signature: ………………………………………..
Date: ……………………………………………..
iv
DEDICATION
This project is dedicated:
To the Almighty God
To our families
To our friends
v
ACKNOWLEDGEMENT
We are thankful to the Almighty God for the given gift of life and guidance, especially during
this project. Also we are grateful for members of our families and relatives. Our thanks go to KIST and SFAR for their financial contribution for carrying out our studies. We sincerely thank
Mr. TWIRINGIYIMANA Remy, for his kind guidance and for his provision of necessary
facilities to carry out this project work. Thanks to several former lecturers and classmates who
broadened our knowledge and technical skills to fulfill the requirement to this project. We wish
to extend our deep sense of gratitude to our beloved parents for their encouragement throughout
our studies.
God bless you all.
vi
ABSTRACT
This project has the aim of designing a system that can make decision electronically thereby
speeding up the operations made and improving electronic system by using digital system. The
work to be done was concentrated on acquiring analog signal and processing of this acquired
signal using a personal computer. Digital filters were designed using Matlab programming to
process the acquired signals. This was achieved through the use of electronic equipments such as
signal generator, oscilloscope, computer and interfacing circuit. In fact, the main task to be
carried out in this project is to design a computer-based system to acquire and process an analog
signal generated by front end devices such as function generator. There were two ways to realize
the practice of this project. The first one consisted the use of zelscope software as oscilloscope
which analyzes signal originates from mobile phone. The mobile phone was used to play music
(audio signal) in order to be analyzed by zelscope on PC screen. On other hand, this audio signal
from mobile phone were acquired and analyzed with matlab programming Language. Finally,
the analyzed signal by matlab had to be compared with that obtained when using zelscope. The
second one concerned with acquiring real time signal generated from function generator and
compare the processed signal on PC with the signal displayed on oscilloscope. This work was
carried out in KIST laboratory building (KIST4) in electronics lab (Second Floor- room 33)
vii
TABLE OF CONTENTS
CERTIFICATION ............................................................................................................................................... i
DECLARATION .............................................................................................................................................. iii
DEDICATION ................................................................................................................................................. iv
ACKNOWLEDGEMENT ................................................................................................................................... v
ABSTRACT ..................................................................................................................................................... vi
TABLE OF CONTENTS................................................................................................................................... vii
LIST OF FIGURES AND TABLES ...................................................................................................................... ix
LIST OF TABLES .............................................................................................................................................. x
LIST OF ABBREVIATIONS AND SYMBOLES .................................................................................................... xi
CHAPTER 3: SYSTEM DESIGN ...................................................................................................................... 25
3.1. Example of analyzing data by matlab .............................................................................................. 25
3.1.1. Signal analysis ........................................................................................................................... 25
3.2. Data Acquisition with MATLAB Programming ............................................................................. 27
3.3. Digital Filter Design ........................................................................................................................ 29
3.3.1. FIR digital filter .......................................................................................................................... 31
3.3.2. Band Pass filter Design Specifications ....................................................................................... 32
Figure 3.28: Filtrered Data Acquired using Matlab programming ............................................................. 34
Figure 3.29: Block diagram showing the design using Zelscope ................................................................ 35
Figure 3.30: Photo of signal generator ........................................................................................................ 36
Figure 3.31: Photo of analog oscilloscope .................................................................................................. 37
Figure 3.32: Photo of PC ........................................................................................................................... 37
Figure 3.33: Photo of interface circuit ........................................................................................................ 38
Figure 3.34: Interfacing circuit between PC sound card and signal generator ........................................... 38
Figure 3.35: Block diagram of the design using oscilloscope .................................................................... 39
Figure 3.36: Photo of experiment for complete system .............................................................................. 39
Figure 4.37:Signal analyzed on Zelscope Display ...................................................................................... 41
Figure 4.38: Accquisition of signal “Data” ................................................................................................. 42
Figure 4.39: Power spectral density of data ................................................................................................ 43
Figure 4.40: Filtered signal “data” .............................................................................................................. 44
Figure 4.41: Acquired signal “data” .......................................................................................................... 46
Figure4. 42: Power spectral density of unfiltered signal “data” ................................................................. 47
Figure 4.43: Filtered signal “data”of figure 4.41 ........................................................................................ 48
LIST OF TABLES
Table.1: Results for interface circuit. .......................................................................................................... 45
xi
LIST OF ABBREVIATIONS AND SYMBOLES
: Ohm
A: Ampere
AC: Alternative Current
ADC: Analog to Digital Converter
ADPCM: Adaptive Differential Pulse Code
Modulation
AI: Analog Input
Apass: Attenuation pass band
Astop: attenuation stop band
BPF: Bass Pass Filter
CD: Compact Disc
CH: Channel
CODEC: Coder/Decoder
CRT: Cathode Ray Tube
DAC: Digital to Analog Converter
DC: Direct Current
DSP: Digital Signal Processing
EEE: Electrical and Electronics engineering
ETE: Electronics and Telecommunication
Engineering
FFT: Fast Fourier Transform
Fig:Figure
FIR: Finite Impulse Response
Fpass: Pass band Frequency
FS: Sampling Frequency
Fstop: Stop band Frequency
GS: Government Sponsor
Hz: Hertz
12
I/P: input
IBM: International Business Machines
IEEE: Institute of Electrical and Electronic
Engineers
IIF: Infinite Impulse response
ISA: Industry Standard Architecture
K: Kilo (103)
KIST: Kigali Institute of Science and
Technology
m: meter
m: milli (10-3
)
O/P: Output
PC: Personal Computer
PCI: Peripheral Component Interconnect
RADAR: Radio Detection And Ranging
RMS: Root Mean Square
SFAR: Student Financing Agency for
Rwanda
SONAR: Sound Navigation And Ranging
V: Volt
1
CHAPTER 1: INTRODUCTION
1.1. General introduction
An oscilloscope is one of the equipments needed to perform this research. Therefore, an
understanding of its working principle is required. To better understand the oscilloscope
controls, one need to know a little more about how oscilloscopes display a signal .Although there
are two types of oscilloscopes: analog and digital, in this work only the analog will be used.
Analog oscilloscopes work somewhat differently than digital oscilloscopes. However, several of
the internal systems are similar. Analog oscilloscopes are somewhat simpler in concept and are
described first, followed by a description of digital oscilloscopes. The working principle of these
two types of oscilloscope and the difference between them will be shown clearly in the following
chapters. Computers are used at the heat of almost every electronic system due to the fact that
their ability to quickly process and store large amount of data makes system more versatile and
perform many functions. The filters used here are digital because computers understand only
digital data. The design of these digital filters was done using Matlab software.
1.2. Structure of project report
This project report contains five chapters. The first chapter is introduction which discusses about
overview and motivation of this work .The second chapter is literature review which provides
details about what others have done concerning this research and set a benchmark for the current
as well as justifying the specific solution techniques. The third chapter deals with the system
design. The fourth chapter discusses the obtained result. Finally, the fifth chapter is all about the
conclusion and recommendations giving summary of the main findings statement of the
encountered problem as well as limitations.
1. 3. Statement of the problem
It has been observed that all over the world today’s electronics equipments are all almost of
digital in nature. Before the development of the digital equipments, the use of early devices in
some applications did not give the accurate output especially in Telecommunication due to many
factors including easy attraction of random disturbances or variations introduced in system
leading to the delay and losses for the signal. This problem will be recovered by the use of digital
equipments associated by some software. But nowadays; the arrival of digital equipments makes
the system very suitable and fast. Even due to the flexibility, digital system will lead the low cost
equipments. Due to these advantages of digital system, today and future’s life will become
digitalized.
1.4. Significance and justification
The work to be done helps in understanding and practices the concept of Digital Signal
Processing (DSP) techniques. These achieved by using computer to learn data acquisition
2
applications and Matlab software for designing Digital Filters which will be used to denoise the
acquired signal . Digital filtering is exceptionally flexible and can easily incorporate non-lineal
operations such as clipping or removal of data samples that appear to the incompatible with
neighboring samples, and therefore erroneous indicate the source. Moreover, it is much easier to
determine the response of a digital system than analog system. This is because the digital system
can be described by its difference equation and this is directly amenable to a solution using
computer.
1.5. Objectives
1.5.1. Main objective
Designing a computer-based system to process an analog signal generated from front
ended devices such as function generator.
1.5.2. Specific objectives
Understanding how to install and use Zelscope application software.
Acquiring analog signals using MATLAB Data acquisition toolbox.
Designing digital filters using MATLAB Program.
Denoising the acquired signals using digital filter.
Displaying the processed signals on PC and appreciating the comparison with the signal
displayed on oscilloscope.
1.6. Scope and limitation of the project
This study is about the design of a computer based system to process an analog signal. The study
is concentrated only the analysis of signals generated from end devices such as signal generator
and mobile phone with the frequencies which are audible (i.e. frequencies of the ranges from
20Hz to 20 kHz). The filters used to denoise the acquired signal are FIR low and band-pass filter
with equiripple methods.
1.7. Methodology
The methodologies used to achieve the objectives of this work are books bellowed in different
Libraries including KIST Library and internet documentations. Besides experiment, using
programming languages such as MATLAB carried out in KIST laboratory building (KIST4) in
electronics lab (Second Floor- room 33).
Equipments:
The following are electronic equipments that were used:
Signal generator.
Analog oscilloscope.
Personal Computer.
3
Mobile phone
Buffer circuit used as front end interfacing device(for signal generator).
4
CHAPTER 2: LITERATURE REVIEW
In order to get a clear understanding on the work to be done, it is necessary to make a review on
what was done by other researchers on the same field. This includes a review on some
applications, programs; components used to this research. The review of them is described
below.
2.1. Electrical instrumentation signals
2.1.1. Analog and digital signals
2.1.1.1. Definitions
A signal is any kind of physical quantity that conveys information. Audible speech is certainly a
kind of signal, as it conveys the thoughts (information) of one person to another through the
physical medium of sound. Hand gestures are signals, too, conveying information by means of
light.
2.1.1.2. Types of signal
There are two kind of signal: analog and digital signal. The difference between these signals is
described below. An analog signal is a kind of signal that is continuously variable whereas a
digital signal is one having discrete set of values [9]
. A well-known example of analog versus
digital is that of clocks: analog being the type with pointers that slowly rotate around a circular
scale, and digital being the type with decimal number displays or a "second-hand" that jerks
rather than smoothly rotates. The analog clock has no physical limit to how finely it can display
the time, as its "hands" move in a smooth, pauseless fashion. The digital clock, on the other
hand, cannot convey any unit of time smaller than what its display will allow for [9]
.
2.1.2 Basic analog signal measurements
To measure analog signal, it is better to know the instrumentation and instrument.
Instrumentation is a field of study and work centering on and control of physical processes.
These physical processes include pressure, temperature, flow rate, and chemical consistency. An
instrument is a device that measures and/or acts to control any kind of physical process. Due to
the fact that electrical quantities of voltage and current are easy to measure, manipulate, and
transmit over long distances, they are widely used to represent such physical variables and
transmit the information to remote locations [4][9]
.The most widely used instrument to measure
such electrical quantity is oscilloscope as it being described its working principle below in
fig.2.1.
5
2.1.2.1. Oscilloscope.
How does an oscilloscope work?
To better understand the oscilloscope controls, you need to know a little more about how
oscilloscopes display a signal. Analog oscilloscopes work somewhat differently than digital
oscilloscopes. However, several of the internal systems are similar. Analog oscilloscopes are
somewhat simpler in concept and are described first, followed by a description of digital
oscilloscopes.
2.1.2.1.1. Analog Oscilloscopes
When you connect an oscilloscope probe to a circuit, the voltage signal travels through the probe
to the vertical system of the oscilloscope. Following Figure is a simple block diagram that shows
how an analog oscilloscope displays a measured signal.
Figure2. 1: Analog Oscilloscope Block Diagram[9]
Depending on how you set the vertical scale (volts/div control), an attenuator reduces the signal
voltage or an amplifier increases the signal voltage.
Next, the signal travels directly to the vertical deflection plates of the cathode ray tube (CRT).
Voltage applied to these deflection plates causes a glowing dot to move. (An electron beam
hitting phosphor inside the CRT creates the glowing dot). A positive voltage causes the dot to
move up while a negative voltage causes the dot to move down.
The signal also travels to the trigger system to start or trigger a "horizontal sweep." Horizontal
sweep is a term referring to the action of the horizontal system causing the glowing dot to move
across the screen. Triggering the horizontal system causes the horizontal time base to move the
glowing dot across the screen from left to right within a specific time interval. Many sweeps in
rapid sequence cause the movement of the glowing dot to blend into a solid line. At higher
speeds, the dot may sweep across the screen up to 500,000 times each second.
Together, the horizontal sweeping action and the vertical deflection action trace a graph of the
signal on the screen. The trigger is necessary to stabilize a repeating signal. It ensures that the
6
sweep begins at the same point of a repeating signal, resulting in a clear picture as shown in
following figure [9]
.
Figure2. 2: Triggering Stabilizes a Repeating Waveform[9]
In conclusion, to use an analog oscilloscope, you need to adjust three basic settings to
accommodate an incoming signal:
The attenuation or amplification of the signal. Use the volts/div control to adjust the
amplitude of the signal before it is applied to the vertical deflection plates.
The time base. Use the sec/div control to set the amount of time per division represented
horizontally across the screen.
The triggering of the oscilloscope. Use the trigger level to stabilize a repeating signal, as
well as triggering on a single event.
Also, adjusting the focus and intensity controls enables you to create a sharp, visible display.
2.1.2.1.2. Digital Oscilloscopes
Based on [9]
, some of the systems that make up digital oscilloscopes are the same as those in
analog oscilloscopes; however, digital oscilloscopes contain additional data processing systems.
With the added systems, the digital oscilloscope collects data for the entire waveform and then
displays it. When you attach a digital oscilloscope probe to a circuit, the vertical system adjusts
the amplitude of the signal, just as in the analog oscilloscope. Next, the analog-to-digital
converter (ADC) in the acquisition system samples the signal at discrete points in time and
converts the signal's voltage at these points to digital values called sample points. The horizontal
system's sample clock determines how often the ADC takes a sample. The rate at which the
clock "ticks" is called the sample rate and is measured in samples per second.
The sample points from the ADC are stored in memory as waveform points. More than one
sample point may make up one waveform point. Together, the waveform points make up one
waveform record. The number of waveform points used to make a waveform record is called the
record length. The trigger system determines the start and stop points of the record. The display
receives these record points after being stored in memory. Depending on the capabilities of your
oscilloscope, additional processing of the sample points may take place, enhancing the display.
7
Pretrigger may be available, allowing you to see events before the trigger point as shown in
fig.2.3.
Figure 2.3: Digital Oscilloscope Block Diagram[9]
Fundamentally, with a digital oscilloscope as with an analog oscilloscope, you need to adjust the
vertical, horizontal, and trigger settings to take a measurement.
Sampling Methods
The sampling method tells the digital oscilloscope how to collect sample points. For slowly
changing signals, a digital oscilloscope easily collects more than enough sample points to
construct an accurate picture. However, for faster signals, (how fast depends on the
oscilloscope's maximum sample rate) the oscilloscope cannot collect enough samples. The
digital oscilloscope can do two things:
It can collect a few sample points of the signal in a single pass (in real-time sampling
mode) and then use interpolation. Interpolation is a processing technique to estimate what
the waveform looks like based on a few points.
It can build a picture of the waveform over time, as long as the signal repeats itself
(equivalent-time sampling mode).
i. Real-Time Sampling with Interpolation
8
Digital oscilloscopes use real-time sampling as the standard sampling method. In real-time
sampling, the oscilloscope collects as many samples as it can as the signal occurs. See following
figure for single-shot or transient signals you must use real time sampling [9]
.
Figure 2.4: Real Time Sampling Diagram
[9]
Digital oscilloscopes use interpolation to display signals that are so fast that the oscilloscope can
only collect a few sample points. Interpolation "connects the dots." Linear interpolation simply
connects sample points with straight lines. Sine interpolation (or sin x over x interpolation)
connects sample points with curves. (See Following Figure2.5) Sin x over x interpolation is a
mathematical process similar to the "oversampling" used in compact disc players. With sine
interpolation, points are calculated to fill in the time between the real samples. Using this
process, a signal that is sampled only a few times in each cycle can be accurately displayed or, in
the case of the compact disc player, accurately played back.
Figure 2.5: Linear and Sine Interpolation Diagram
[9]
Equivalent-Time Sampling
Some digital oscilloscopes can use equivalent-time sampling to capture very fast repeating
signals. Equivalent-time sampling constructs a picture of a repetitive signal by capturing a little
bit of information from each repetition. (See Following Figure2.6) You see the waveform slowly
build up like a string of lights going on one-by-one. With sequential sampling the points appear
from left to right in sequence; with random sampling the points appear randomly along the
waveform [9]
.
9
Figure 2.6: Equivalent-time Sampling Diagram[9]
2.1.2.2. Zelscope review
2.1.2.2.1 What is Zelscope?
Zelscope is Windows software that converts PC into a dual-trace storage oscilloscope and
spectrum analyzer. It uses computer's sound card as analog-to-digital converter, presenting a
real-time waveform or spectrum of the signal - which can be music, speech, or output from an
electronic circuit. Zelscope features the interface of a traditional oscilloscope, with conventional
gain, offset, time base, and trigger controls. As a real-time spectrum analyzer, Zelscope can
display the amplitude and phase components of the spectrum.
Figure2. 7: Zelscope with two analyzing signal [14]
10
Figure 2.8: Normal mode, with both channels displayed[14]
2.1.2.2.2. What can Zelscope use for?
Zelscope is low-frequency oscilloscope and spectrum analyzer software. It can be useful in
tuning music instruments, adjusting audio circuits, or doing physics experiments. Acoustics is
the most evident area; Zelscope also allows for an easy measurement of short time intervals in
mechanics experiments.Zelscope has proven useful in debugging music and sound processing
software [14].
Note: All known sound cards contain a capacitor which provides AC coupling and prevents DC
from reaching the card's analog to digital converter. Low-frequency oscillations (below 15-
20Hz) usually get through, but may be distorted.
According to Nigel P. Cook, Digital Signal Processor (DSP) is concerned with the digital
representation of signals and the use of signal processors to analyze, modify, or extract
information from signals. Similarly, From Wikipedia, the free encyclopedia, DSP is concerned
with the representation of signal by a sequence of numbers or symbols and the processing of
these signals. In addition, we conclude that: Digital signal processing is the technique used to
analyze various digital signals and obtain information from the same. It is also used for transfer
of information from one place to another and also involves conversion in between analogue and
digital signals. Although, DSP represents signal digitally, the signal used in most popular form of
DSP is delivered from analog signals which have been sampled at rectangular intervals and
converted into digital form. The specific reason for processing a digital signal may be, for
example to remove interference or noise from signal, to obtain the spectrum of data, or to
transform the signal into a more suitable form. DSP is now used in many areas where analog
methods were previously used and in entirely new applications which were difficult or
impossible with analog methods for example, linear phase response can be achieved, and
complex adaptative filtering algorithms can be implemented using DSP [2]
.
In addition the applications of DSP and its basic operations such as convolution correlation,
filtering, transformation and modulation in detail are also very important [1]