project

Upload: rohitparjapat

Post on 01-Nov-2015

7 views

Category:

Documents


0 download

DESCRIPTION

PROJECT REPORT

TRANSCRIPT

CHAPTER-1

INTRODUCTIONThe project is aimed at calculating and simplifying the concepts and terms of various subjects of electronics and communication engineering including basics of electronic calculator. The project is based on MATLAB GUI(Graphical User Interface).This will cover the syntax and semantics of MATLAB. The project aspires to introduce the essential and practicalities of programming through the MATLAB environment to us.1.1 Introduction to MATLAB

MATLAB is a high-performance language for technical computing. It integrates computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. Typical uses include: Math and computation

Algorithm development

Modeling, simulation, and prototyping

Data analysis, exploration, and visualization

Scientific and engineering graphics

Application development, including Graphical User Interface building

MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. This allows you to solve many technical computing problems, especially those with matrix and vector formulations, in a fraction of the time it would take to write a program in a scalar noninteractive language such as C or Fortran.The name MATLAB stands for matrix laboratory. MATLAB was originally written to provide easy access to matrix software developed by the LINPACK and EISPACK projects, which together represent the state-of-the-art in software for matrix computation.MATLAB has evolved over a period of years with input from many users. In university environments, it is the standard instructional tool for introductory and advanced courses in mathematics, engineering, and science. In industry, MATLAB is the tool of choice for high-productivity research, development, and analysis.MATLAB features a family of application-specific solutions called toolboxes. Very important to most users of MATLAB, toolboxes allow you tolearnandapplyspecialized technology. Toolboxes are comprehensive collections of MATLAB functions (M-files) that extend the MATLAB environment to solve particular classes of problems. Areas in which toolboxes are available include signal processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and many others.1.2 History

Cleve Moler, the chairman of thecomputer-sciencedepartment at theUniversity of New Mexico, started developing MATLAB in the late 1970s. He designed it to give his students access toLINPACKandEISPACKwithout them having to learnFortran. It soon spread to other universities and found a strong audience within theapplied mathematicscommunity.Jack Little, an engineer, was exposed to it during a visit Moler made toStanford Universityin 1983. Recognizing its commercial potential, he joined with Moler and Steve Bangert. They rewrote MATLAB inCand foundedMath Worksin 1984 to continue its development. These rewritten libraries were known as JACKPAC. In 2000, MATLAB was rewritten to use a newer set of libraries for matrix manipulation,LAPACK. MATLAB was first adopted by researchers and practitioners incontrol engineering, Little's specialty, but quickly spread to many other domains. It is now also used in education, in particular the teaching oflinear algebraandnumerical analysis, and is popular amongst scientists involved inimage processing. 1.3 The MATLAB System

The MATLAB system consists of four main parts:1.3.1 The MATLAB language

This is a high-level matrix/array language with control flow statements, functions, data structures, input/output, and object-oriented programming features. It allows both "programming in the small" to rapidly create quick and dirty throw-away programs, and "programming in the large" to create complete large and complex application programs.1.3.2 The MATLAB working environment

This is the set of tools and facilities that you work with as the MATLAB user or programmer. It includes facilities for managing the variables in your workspace and importing and exporting data. It also includes tools for developing, managing, debugging, and profiling M-files, MATLAB's applications.1.3.3 Handle Graphics

This is the MATLAB graphics system. It includes high-level commands for two-dimensional and three-dimensional data visualization, image processing, animation, and presentation graphics. It also includes low-level commands that allow you to fully customize the appearance of graphics as well as to build complete Graphical User Interfaces on your MATLAB applications.1.3.4 The MATLAB mathematical function library

This is a vast collection of computational algorithms ranging from elementary functions like sum, sine, cosine, and complex arithmetic, to more sophisticated functions like matrix inverse, matrix eigenvalues, Bessel functions, and fast Fourier transforms.

1.4 About GUI1.4.1 Introduction

A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent appearance and with intuitive controls like pushbuttons, list boxes, sliders, menus, and so forth. The GUI should behave in an understandable and predictable manner, so that a user knows what to

expect when he or she performs an action. For example, when a mouse click occurs on a

pushbutton, the GUI should initiate the action described on the label of the button. This chapter introduces the basic elements of the MATLAB GUIs. The chapter does not contain a complete description of components or GUI features, but it does provide the basics required to create functional GUIs for your programs.

1.4.2 How a Graphical User Interface Works

A graphical user interface provides the user with a familiar environment in which to work. This environment contains pushbuttons, toggle buttons, lists, menus, text boxes, and so forth, all of which are already familiar to the user, so that he or she can concentrate on using the application rather than on the mechanics involved in doing things. However, GUIs are harder for the programmer because a GUI-based program must be prepared for mouse clicks (or possibly keyboard input) for any GUI element at any time. Such inputs are known as events, and a program that responds to events is said to be event driven. The three principal elements required to create a MATLAB Graphical

User Interface are

1. Components: Each item on a MATLAB GUI (pushbuttons, labels, edit boxes, etc.) is a graphical component. The types of components include graphical controls (pushbuttons, dit boxes, lists, sliders, etc.), static elements (frames and text strings), menus, and axes. Graphical controls and static elements are created by the function uicontrol, and menus are created by the functions uimenu and uicontextmenu. Axes, which are used to display

graphical data, are created by the function axes.

2. Figures: The components of a GUI must be arranged within a figure, which is a window on the computer screen. In the past, figures have been created automatically whenever we have plotted data. However, empty figures can be created with the function figure and can be used to hold any combination of components.

3. Callbacks: Finally, there must be some way to perform an action if a user clicks a mouse on a button or types information on a keyboard. A mouse click or a key press is an

event, and the MATLAB program must respond to each event if the program is to perform its function. For example, if a user clicks on a button, that event must cause the MATLAB code that implements the function of the button to be executed. The code executed in response to an event is known as a call back. There must be a callback to implement the function of each graphical component on the GUI. The basic GUI elements are summarized in Table 1.1, and sample elements are shown in Figure 1.1. We

will be studying examples of these elements and then build working GUIs from them.

1.4.3 Creating and Displaying a Graphical User Interface

MATLAB GUIs are created using a tool called guide, the GUI Development Environment. This tool allows a programmer to layout the GUI, selecting and aligning the GUI components to be placed in it. Once the components are in place, the programmer can edit their properties: name, color, size, font, text to display, and so forth. When guide saves the GUI, it creates working program including skeleton functions that the programmer can modify to implement the behavior of the GUI. When guide is executed, it creates the Layout Editor, shown in Figure 1.2. The large white area with grid lines is the layout area, where a programmer can layout the GUI. The Layout Editor window has a palate of GUI components along the left side of the layout area. A user can

create any number of GUI components by first clicking on the desired component, and then dragging its outline in the layout area. The top of the window has a toolbar with a series of useful tools that allow the user to distribute and align GUI components, modify the properties of GUI components, add menus to GUIs, and so on.

The basic steps required to create a MATLAB GUI are:

1. Decide what elements are required for the GUI and what the function of each element will be. Make a rough layout of the components by hand on a piece of paper.

Table 1.1 Some Basic GUI Components

Figure 1.1 Figure WindowFigure 1.1 A Figure Window showing examples of MA TLAB GUI elements. From top to bottom and left to right, the elements are: (1) a pushbutton; (2) a toggle button in the 'on' state; (3) two radio buttons surrounded by a frame; (4) a check box; (5) a text field and an edit box; (6) a slider; (7) a set of axes; and (8) a list box. 2. Use a MATLAB tool called guide (GUI Development Environment) to layout the Components on a figure. The size of the figure and the alignment and spacing of components on the figure can be adjusted using the tools built into guide.

3. Use a MATLAB tool called the Property Inspector (built into guide) to give each component a name (a "tag") and to set the characteristics of each component, such as its

color, the text it displays, and so on.

4. Save the figure to a file. When the figure is saved, two files will be created on disk with the same name but different extents. The fig file contains the actual GUI that you have created, and the M-file contains the code to load the figure and skeleton call backs

for each GUI element.

5. Write code to implement the behavior associated with each callback function.

As an example of these steps, let's consider a simple GUI that contains a single pushbutton and a single text string. Each time that the pushbutton is clicked, the text string will be updated to show the total number of clicks since the GUI started.

Figure 1.2 The guide tool window

Figure 1.3 Rough layout

Figure 1.3 Rough layout for a GUI containing a single pushbutton and a single label field.

Step 1: The design of this Gm is very simple. It contains a single pushbutton and a single text field. The callback from the pushbutton will cause the number displayed in the text field to increase by one each time that the button is pressed. A rough sketch of the GUI is

shown in Figure 1.3.

Step 2: To layout the components on the GUI, run the MATLAB function guide. When

guide is executed, it creates the window shown in Figure 1.4.

Figure 1.4 The completed GUI layout within the guide window

First, we must set the size of the layout area, which will become the size the final GUI. We do this by dragging the small square on the lower right corner of the layout area until it has the desired size and shape. Then, click on the "pushbutton" button in the list of GUI components, and create the shape of the pushbutton in the layout area. Finally, click on the "text" button in the list GUI components, and create the shape of the text field in the layout area. The resulting figure after these steps is shown in Figure 1.4. We could now adjust the alignment of these two elements using the Alignment Tool, if desired. Step 3: To set the properties of the pushbutton, click on the button in the layout area and then select "Property Inspector" from the toolbar. Alternatively, right-click on the button and select "Inspect Properties" from the popup menu. The Property Inspector window shown in Figure 1.5 will appear. Note this window lists every property available for the pushbutton and allows us set each value using a GUI interface. The Property Inspector performs the same function as the get and set functions, but in a much more convenient form.

Figure 1.5 The Property Inspector

Figure 1.5 The Property Inspector showing the properties of the pushbutton. Note that the

String is set to 'Click Here', and the Tag is set to 'MyFirstButton'. For the pushbutton, we may set many properties such as color, size, font, text alignment, and so on. However, we must set two properties: the String property, which contains the text to be displayed, and the Tag property, which is the name of the pushbutton. In this case, the String property will be set to 'click Here', and the Tag property will be set to MyFirstButton. For the text field, we must set two properties: the String property, which contains the text to be displayed, and the Tag property, which is the name of the text field. This name will be needed by the callback function to locate and update the text field. In this case, the String property will be set to 'Total clicks: 0', and the Tag property defaulted to 'MyFirstText'. The layout area after these steps is shown in Figure 1.6. It is possible to set the properties of the figure itself by clicking on a clear spot in the Layout Editor, and then using the Property Inspector to examine and set the figure's properties. Although not required, it is a good idea to set the figure's Name property. The string in the Name property will be displayed in the title bar of the resulting GUI when it is executed.

Figure 1.6 The design

Figure 1.6 The design area after the properties of the pushbutton and the text field have

been modified.

Step 4: We will now save the layout area under the name MyFirstGUI. Select the File/SaveAs" menu item, type the name MyFirstGUI as the file name, and click "Save". This action will automatically create two files, MyFirstGUI.fig and MyFirstGUI.m. The figure file contains the actual GUI that we have created. The M-file contains code that loads the figure file and creates the GUI, plus a skeleton callback function for each active

GUI component.

At this point, we have a complete Gm, but one that does not yet do the job it was designed to do. You can start this Gm by typing MyFirstGUI in the Command Window, as shown in Figure 1.7. If the button is clicked on this GUI, the following message will appear in the Command Window: MyFirstButton Callback not implemented yet. A portion of the M-file automatically created by guide is shown in Figure 1.8. This file contains function MyFirstGUI, plus dummy sub functions implementing the callbacks for

each active GUI component. If function MyFirstGUI is called without arguments, thenthe function displays the Gm contained in file

Figure 1.7 Typing MyFirstGUI

Figure 1.7 Typing MyFirstGUI in the Command Window starts the GUI.

MyFirstGUI.fig. If function MyFirstGUI is called with arguments, then the function assumes that the first arguments the name of a sub function, and it calls that function using feval, passing the other arguments on to that function. Each callback function handles events from a single GUI component. If a mouse click (or keyboard input for Edit Fields) occurs on the GUI component, then the component's callback function will be automatically called by MATLAB. The name of the callback function will be the value in the Tag property of the GUI component plus the characters "_Callback". Thus, the callback function for MyFirstButton will be named MyFirstButton_Callback. M-files

created by guide contain callbacks for each active GUI component, but these callbacks simply display a message saying that the function of the callback has not been implemented yet.

Step 5: Now, we need to implement the callback sub function for the pushbutton. This function will include a persistent variable that can be used to count the number of clicks that have occurred. When a click occurs on the pushbutton, MATLAB will call the function My First GUI with My First Button callback as the first argument. Then function MyFirstGUI will call sub function My First Button callback, as shown in Figure. This function should increase the count of clicks by one, create a new text string containing

Figure 1.8 Typing MyFirstGUI

Figure Typing MyFirstGUI in the Command Window starts the GUI.

MyFirstGUI.fig. If function MyFirstGUI is called with arguments, then the function assumes that the first arguments the name of a sub function, and it calls that function using feval, passing the other arguments on to that function. Each callback function handles events from a single GUI component. If a mouse click (or keyboard input for Edit Fields) occurs on the GUI component, then the component's callback function will be automatically called by MATLAB. The name of the callback function will be the value in the Tag property of the GUI component plus the characters "_Callback". Thus, the callback function for MyFirstButton will be named MyFirstButton_Callback. M-files created by guide contain callbacks for each active GUI component, but these callbacks simply display a message saying that the function of the callback has not been implemented yet.

Step 5: Now, we need to implement the callback sub function for the pushbutton. This function will include a persistent variable that can be used to count the number of clicks that have occurred. When a click occurs on the pushbutton, MATLAB will call the function MyFirstGUI with MyFirstButton_callback as the first argument. Then function MyFirstGUI will call sub function MyFirstButton_callback, as shownin Figure 1.9. This function should increase the count of clicks by one, create a new text string containing the count, and store the new string in the String property of the text field MyFirstText.

Figure 1.9 The M-file for MyFirst GUI, automatically created by guide

Event handling in program MyFirstGUI. When a user clicks on the button with

the mouse, the function MyFirstGUI is cal1ed automatically with the argument MyFirstButton_callback. Function MyFirstGUI in turn calls sub function

CHAPTER-2LITERATURE REVIEWGraphical User Interface (GUI) for Signal Generator is a project MATLAB software base. Its objective is to generate signal using MATLAB and then can be verify using oscilloscope. MATLAB includes high-level commands for two-dimensional and three-dimensional data visualization, image processing, animation, and presentation graphics. GUIDE is the tools in MATLAB graphical user interface development environment, provides a set of tools for creating GUIs. The fundamental power of GUIs is that they provide a means through which individuals can communicate with the computer without programming commands. This project divides in two phase, software phase and hardware phase. Software phase, develop Graphical User Interface using MATLAB, interface boxes, syntax for user application to generate and display desired graphical signal. This MATLAB GUI-based program offer user only using mouse clicks (or possibly keyboard input) for any GUI element to display programmed wave form and generate signal. Hardware phase, develop hardware using MAX232 as an interface to pass information between output from computer to oscilloscope for measurement and comparison purpose. Output port is serial port using DB9 interface.Graphical User Interfaces are a common sight in the digital age. They have become ubiquitous to the point of being invisible. They are used every day without being noticed, on ATMs, websites and PCs. GUIs provide a pictorial faceplate that allows users to call various functions and edit their parameters without ever touching a programs actual code. GUIs are the bridge that connects computer code to something everyday users can utilize.MATLAB, a product of The MathWorks, Inc., is a program widely used throughout the target community. MATLAB, or Matrix Laboratory, is used for mathematical computation, analysis, visualization, and algorithm development. [2-www.mathworks.com/products]. The use of MATLAB to develop the GUI will allow its use on multiple operating platforms, including Windows and Linux, thereby increasing its versatility.

The GUI will provide an interface between the MATLAB user and the application of the soft function generator. Thus, the user will not need to have a complete knowledge of command-line level MATLAB programming to effectively utilize the graphical user interface MATLAB. In this way, knowledge and use of these ECE calculator using MATLAB is aimed at calculating and simplifying the concepts and terms of various subjects of electronics and communication engineering including basics of electronic calculator. The project is based on MATLAB GUI(Graphical User Interface).this will cover the syntax and semantics of MATLAB. the project aspires to introduce the essential and practicalities of programming through the MATLAB environment to us.

CHAPTER-3

PROJECT WORKThe project is aimed at calculating and simplifying the concepts and terms of various subjects of electronics and communication engineering including basics of electronic calculator. The project is based on MATLAB GUI(Graphical User Interface).this will cover the syntax and semantics of MATLAB. the project aspires to introduce the essential and practicalities of programming through the MATLAB environment to us.3.1 Block diagram

Figure 3.1 Block Diagram3.2 The user friendly interface of the project

Figure 3.2 user friendly interface

3.3 Various tools used in the project

3.3.1 Pushbuttons

A pushbutton is a component that a user can click on to trigger a specific action. The pushbutton generates a callback when the user clicks the mouse on it. A pushbutton is created by creating a uicontrol whose style property is 'pushbutton'. A pushbutton may be added to a GUI by using the pushbutton tool in the Layout Editor. Function MyFirstGUI in illustrated the use of pushbuttons.

3.3.2 Text Fields

A text-field is a graphical object that displays a text string. You can specify how the text is aligned in the display area by setting the horizontal alignment property. By default, text fields are horizontally centered. A text field is created by creating a uicontrol whose style property is 'edit'. A text field may be added to a GUI by using the text tool in the Layout Editor. Text fields do not create callbacks, but the value displayed in the text field can be updated in a callback function by changing the text field's String property3.3.3 Dialog Boxes

A dialog box is a special type of figure that is used to display information or to get input from a user. Dialog boxes are used to display errors, provide warnings, ask questions, or get user input. They are also used to select files or printer properties. Dialog boxes may be modal or non-modal. A modal dialog box does not allow any other window in the application to be accessed until it is dismissed, whereas a non-modal dialog box does not block access to other windows. Modal dialog boxes are typically used for warning and error messages that need urgent attention and cannot be ignored. By default, most dialog boxes are non-modal. MATLAB includes many types of dialog boxes.

3.3.3.1 Input Dialog Boxes

Input dialog boxes prompt a user to enter one or more values that may be used by a program. Input dialog boxes may be created with one of the following calling sequences.

answer = inputdlg(prompt)

answer = inputdlg(prompt,title)

answer = inputdlg(prompt,title,line_no)

answer = inputdlg(promPt,title,line_no,default_answer)

Here, prompt is a cell array of strings, with each element of the array corresponding to one value that the user will be asked to enter. The parameter title specifies the title of the dialog box, and line_no specifies the number of lines to be allowed for each answer. Finally, default_answer is a cell array containing the default answers that will be used if

the user fails to enter data for a particular item. Note that there must be as many default

answers as there are prompts.

Figure 3.4 An input dialog boxWhen the user clicks the OK button on the dialog box, his or her answers will be returned

as a cell array of strings in variable answer. As an example of an input dialog box, suppose that we wanted to allow a user to specify the position of a figure using an input

dialog. The code to perform this function would be

prompt{l} = 'Starting x position:';

prompt{2} = 'Starting y position: ';

prompt(3} = 'Width:';

prompt{4} = 'Height: ';

title = 'Set Figure Position';

default_ans = {'50','50','180','l00'};

answer = inputdlg(promPt,title,l,default_ans};visibility of push buttons:

we can make the the push buttons visible or invisible as per suitability through the following command.set(handles.pushbutton1,'Visible','off')

3.4 Scientific Calculator

Figure 3.5 Scientific Calculator 3.5 Electronics and Communication subjects

Figure 3.6 Matlab output window

3.5.1 Digital signal processing(DSP) is the mathematical manipulation of an information signal to modify or improve it in some way. It is characterized by the representation of discrete time, discrete frequency, or other discrete domainsignalsby a sequence of numbers or symbols and the processing of these signals.

Figure 3.7 Digital signal processing3.5.1.1 Standard signals

1 Unit step

The unit step function, usually denoted byH(but sometimesuor), is a discontinuousfunction whose value iszerofor negative argument andonefor positive argument.

The function is used in the mathematics ofcontrol theoryandsignal processingto represent a signal that switches on at a specified time and stays switched on indefinitely.

Matlab Input dialog box:

Figure 3.8 Matlab Input dialog box

Matlab output:

Figure 3.9 Matlab output

2. Unit impulse

Used as building blocks to construct and represent other signals.

It is (informally) ageneralized functionon the real number line that is zero everywhere except at zero, with anintegralof one over the entire real line.

Matlab output:

Figure 3.10 Matlab output

3. Unit ramp

the Unit Ramp Function r(t) can be obtained by integrating the unit impulse function twice or integrating the unit step function once

Input dialog box

Figure 3.11 Input dialog box

Figure 3.12 Matlab output window

4. Sinusoidal signals

Sinusoidal signals are perhaps the most important type of signal that we will encounter in signal processing.

x(t)=Acos(t)

and thesine:

x(t)=Asin(t)

whereAis a real constant. Plots of the sine and cosine signals are shown.

Sinusoidal signals are periodic signals. The period of the cosine and sine signals shown above is given byT=2/. The frequency of the signals is=2/Twhich has units ofrad/sec. Equivalently, the frequency can be expressed as1/T, which has units ofsec1,cycles/sec, orHz.

Figure 3.13 Sinusoidal Signal5. Exponential signal

An exponential signal is an energy signal, as illustrated by an example in the previous page. The base of natural logarithm is the irrational number called e and it is equal to 2.718281..,

input dialog box Figure 3.14 input dialog box

Matlab output window

Figure 3.15 Matlab output window

3.5.2 Digital communication

Digital communications is the transfer of discrete messages. Digital communicationsis the physical transfer ofdata(adigitalbit stream) over a point-to-point orpoint-to-multipoint communicationchannel. Examples of such channels arecopper wires,optical fibres,wirelesscommunication channels, andstorage media. The data are represented as anelectromagneticsignal, such as anelectrical voltage,radiowave,microwave, orinfraredsignal. The messages are either represented by a sequence of pulses by means of aline code(basebandtransmission), or by a limited set of continuously varying wave forms (passbandtransmission), using a digitalmodulationmethod.3.5.2.1 Digital modulation techniques1. Amplitude shift keying - ASK - in the context of digital communications is a modulation process, which imparts to a sinusoid two or more discrete amplitude levels. These are related to the number of levels adopted by the digital message.

For a binary message sequence there are two levels, one of which is typically zero.

Thus the modulated waveform consists of bursts of a sinusoid.

illustrates a binary ASK signal (lower), together with the binary sequence which initiated it (upper). Neither signal has been bandlimited.

There are sharp discontinuities shown at the transition points. These result in the signal having an unnecessarily wide bandwidth. Bandlimiting is generally introduced before transmission, in which case these discontinuities would be rounded off. The bandlimiting may be applied to the digital message, or the modulated signal itself.

The data rate is often made a sub-multiple of the carrier frequency. This has been done in the waveform..

One of the disadvantages of ASK, compared with FSK and PSK, for example, is that it has not got a constant envelope. This makes its processing (eg, power amplification) more difficult, since linearity becomes an important factor. However, it does make for ease of demodulation with an envelope detector.

Input dialog box:

Figure 3.16 Input dialog box

Matlab output window:

Figure 3.17 Matlab output window

2.Frequency shift keying

If frequency is the parameter chosen to be a function of the information signal, the modulation method is calledfrequency-shift keying(FSK). In the simplest form of FSK signaling, digital data is transmitted using one of two frequencies, whereby one frequency is used to transmit a 1 and the other frequency to transmit a

Frequency-shift keying (FSK)is afrequency modulationscheme in which digital information is transmitted through discrete frequency changes of acarrier wave.[1]The simplest FSK isbinaryFSK(BFSK). BFSK uses a pair of discrete frequencies to transmit binary (0s and 1s) information. With this scheme, the "1" is called the mark frequency and the "0" is called the space frequency. The time domain of an FSK modulated carrier is illustrated in the figure

Input dialog box:

Figure 3.18 Input dialog box

Matlab output:

Figure 3.19 Matlab output

3.Binary phase shift keying

Phase-shift keying (PSK)is adigitalmodulationscheme that conveysdataby changing, or modulating, thephaseof a referencesignal(thecarrier wave). To use the data streams 1s and 0s to switch the carrier between two phases.This is called Binary Phase Shift Keying (BPSK). Figure below shows what a BPSK signal Notice that, when the change in logic level causes the BPSK signals phase to change, it does so by 180. For example, where the signal is travelling towards a positive peak the change in logic

level causes it to reverse direction and head back toward the negative peak (and vice versa).

input dialog box:

Figure 3.20 input dialog box

Matlab output:

Figure 3.21 Matlab output

4. Pn code

Inspread-spectrumsystems, the receivercorrelatesa locally generated signal with the receivedsignal. Such spread-spectrum systems require a set of one or more "codes" or "sequences" such that

Like random noise, the local sequence has a very low correlation with any other sequence in the set, or with the same sequence at a significantly different time offset, or with narrow band interference, or with thermal noise.

Unlike random noise, it must be easy to generate exactly the same sequence at both the transmitter and the receiver, so the receiver's locally generated sequence has a very high correlation with the transmitted sequence.

A pseudo-noise (PN) sequence is a periodic binary sequence

with a noiselike waveform that is usually generated by means of

a feedback shift register

A feedback shift register consists of an ordinary shift register made up of m flip-flop (two-state memory stages) and a logic circuit that are interconnected to form a feedback circuit. With a total number of m flip-flops, the number of possible state of the shift register is at most 2m. A feedback shift register is said to be linear when the feedback logic consists entirely of modulo-2 adders. The all-zero state is not permitted. As a result, the period of a PN sequence produced by a linear feedback shift register with m flip-flops cant exceed 2m-1. When the period is exactly 2m-1, the PN sequence is called a maximal-length-sequence or simply m-sequence.

Properties

1 In each period of a maximal-length sequence, the number of

1s is always one more than the number of 0s.

2 Among the runs of 1s and of 0s in each period of a maximallength

sequence, one-half the runs of each kind are of length

one, one-fourth are of length two, one-eighth are of length three, and so on as long as these fractions represent meaningful numbers of runs.

This property is called the run property. By a run, we mean a subsequence of identical symbols (1s or 0s) within one period of the sequence. 3Autocorrelation property: the autocorrelation function of a maximum-length sequence is periodic and binary-valued.

Input dialog box:

Figure 3.22 Input dialog box

3.5.3 Analog communication

Analog Communication is a data transmitting technique in a format that utilizes continuous signals to transmit data including voice, image, video, electrons etc.

Analog circuits do not involve quantisation of information unlike the digital circuits and consequently have a primary disadvantage of random variation and signal degradation, particularly resulting in adding noise to the audio or video quality over a distance.

Gui interface:

Figure 3.23 Gui interface

1. SAMPLING: A message signal may originate from a digital or analog source. If the message signal is analog in nature, then it has to be converted into digital form before it can transmitted by digital means. The process by which the continuous-time signal is converted into a discretetime signal is called Sampling.

2. Quantization:

The process of transforming Sampled amplitude values of a message signal into a discrete amplitude value is referred to as Quantization.

The quantization Process has a two-fold effect:

1. the peak-to-peak range of the input sample values is subdivided into a finite set of decision levels or decision thresholds that are aligned with the risers of the staircase, and

2. the output is assigned a discrete value selected from a finite set o

Sampling matlab output

Figure 3.24 Sampling matlab output

Quantization matlab output:

Figure 3.25 Quantization matlab output

3. Pulse modulation

PWM or Pulse Width Modulation refers to the concept of rapidly pulsing the digital signal of a wire to simulate a varying voltage on the wire. This method is commonly used for driving motors, heaters, or lights in varying intensities or speeds.

A few terms are associated with PWM:

Period - how long each complete pulse cycle takes

Frequency - how often the pulses are generated. This value is typically specified in Hz (cycles per second).

Duty Cycle - refers to the amount of time in the period that the pulse is active or high. Duty Cycle is typically specified as a percentage of the full period.In the diagram below the duty cycle is shown at 50%.

A simple method of obtaining the characteristics of the PWM signal is to split the analogue signal into a number of discrete segments equal to the length of the PWM period. Then, the PWM cycle for this period can be set equal to the average of the analogue signal over this same interval.Whats the main advantageEfficiency. PWM amplifiers run coolerthan standard linear power amps,

requiring substantially less heat sinkmass. At about 90% efficiency, PWMmakes electromagnetic motion feasible

at power levels where hydraulics used tobe the only option.

Matlab output:

Figure 3.26 PWM4. Frequency modulation

frequency modulation(FM) conveysinformationover acarrier waveby varying its instantaneous frequency. This contrasts withamplitude modulation, in which theamplitudeof the carrier is varied while its frequency remains constant.Frequency modulation is known asphase modulationwhen the carrier phase modulation is the timeintegralof the FM signal. FM is widely used forbroadcastingmusic and speech,two-way radiosystems, magnetic tape-recording systems and some video-transmission systems. In radio systems, frequency modulation with sufficientbandwidthprovides an advantage in cancelling naturally-occurring noise.

Matlab output window:

Figure 3.27 Matlab output window

5. Amplitude modulation

This is defined as the modulation, in which amplitude of carrier is changed in accordance to the amplitude of the modulating signal.

Amplitude modulation(AM) is a technique used in electronic communication, most commonly for transmitting information via aradiocarrier wave. AM works by varying the strength of the transmitted signal in relation to the information being sent. For example, changes in signal strength may be used to specify the sounds to be reproduced by aloudspeaker, or the light intensity of television pixels. Contrast this withfrequency modulation, in which thefrequencyis varied, andphase modulation, in which thephaseis varied.

In radio communication, acontinuous waveradio-frequency signal (asinusoidalcarrier wave) has its amplitude modulated by an audio waveform before transmission. The audio waveform modifies the amplitude of the carrier wave and determines theenvelopeof the waveform. In thefrequency domain, amplitude modulation produces a signal with power concentrated at the carrier frequency and two adjacentsidebands. Each sideband is equal inbandwidthto that of the modulating signal, and is a mirror image of the other. Amplitude modulation resulting in two sidebands and a carrier is called "double-sideband amplitude modulation" (DSB-AM).

Matlab output window:

Figure 3.28 Matlab output window

3.5.4 Signals and systems:

This is about the study of engineering signals and systems, from a discipline-neutral approach. It is a fundamental starting point in the field of engineering, and serves as the basic material that other advanced concepts in the engineering subject area are based. This subject looks at the concepts of systems, serving as an introduction to systems theory. Also, this subject examines signals, and the way that signals interact with physical systems.

Figure 3.29 Signals and systems1.Laplace transform:The Laplace transform is anintegral transformperhaps second only to theFourier transformin its utility in solving physical problems. The Laplace transform is particularly useful in solving linearordinary differential equationssuch as those arising in the analysis of electronic circuits.

The (unilateral) Laplace transform(not to be confused with theLie derivative, also commonly denoted) is defined by

(1)

whereis defined for(Abramowitz and Stegun 1972). The unilateral Laplace transform is almost always what is meant by "the" Laplace transform, although abilateral Laplace transformis sometimes also defined as

A table of several important one-sided Laplace transforms is given below. Table 2 one sided laplace transformConditions

1

2.Z transform:

Inmathematicsandsignal processing, theZ-transformconverts adiscretetime-zdomainsignal, which is asequenceofrealorcomplex numbers, into a complexfrequency-domainrepresentation.

It can be considered as a discrete-time equivalent of theLaplace transform.

Command window output:

Figure 3.30 Command window output

Bilateral Z-transform

Thebilateralortwo-sidedZ-transform of a discrete-time signalx[n]is theformal power seriesX(z)defined as

wherenis an integer andzis, in general, acomplex number:

whereAis the magnitude ofz,jis theimaginary unit, andis thecomplex argument(also referred to asangleorphase) inradians.

Unilateral Z-transform

Alternatively, in cases wherex[n] is defined only forn 0, thesingle-sidedorunilateralZ-transform is defined as

Insignal processing, this definition can be used to evaluate the Z-transform of theunit impulse responseof a discrete-timecausal system.

An important example of the unilateral Z-transform is theprobability-generating function, where the componentis the probability that a discrete random variable takes the value, and the functionis usually written as, in terms of. The properties of Z-transforms (below) have useful interpretations in the context of probability theory.

Matlab command window output:

Figure 3.31 Command window output

3 .Fourier transform:

TheFourier transform, named afterJoseph Fourier, is a mathematicaltransformwith many applications inphysicsandengineering. Very commonly it transforms a mathematicalfunctionof time, into a new function, sometimes denoted by or whose argument isfrequencywith units of cycles or radians per second. The new function is then known as theFourier transformand/or thefrequency spectrumof the function The Fourier transform is also a reversible operation. Thus, given the function one can determine the original function, (SeeFourier inversion theorem.) and are also respectively known astime domainandfrequency domainrepresentations of the same "event". Most often perhaps, is a real-valued function, and iscomplex valued, where a complex number describes both the amplitude and phase of a corresponding frequency component. In general, is also complex, such as theanalytic representationof a real-valued function. The term "Fourier transform" refers to both the transform operation and to the complex-valued function it produces.

, for everyreal number.

When the independent variablexrepresentstime(withSIunit ofseconds), the transform variable representsfrequency(inhertz). Under suitable conditions, is determined by via theinverse transform:

for every real numberx.

Matlab command window output: Figure 3.32 Matlab command window output

4.Inverse laplace transform:

An integral formula for the inverseLaplace transform, called theBromwich integral, theFourierMellin integral, andMellin's inverse formula, is given by theline integral:

where the integration is done along the vertical linein thecomplex planesuch thatis greater than the real part of allsingularitiesofF(s). This ensures that the contour path is in theregion of convergence. If all singularities are in the left half-plane, orF(s) is asmooth functionon -