Você está na página 1de 47

Starting MATLAB Software

From the desktop Double-click the MATLAB icon (called a shortcut) that the installer creates on your desktop.

Cont..

From the Start menu Click the Start button, select Programs, and move the pointer over the MATLAB entry. Select the version of MATLAB you want to start and, on the application menu that appears, click the MATLAB entry.

MATLAB - WINDOWS

Command Window Command History Current Directory Work Space

Cont..

MATLAB- HELP

Opening M-File

M-FILE

Executing M-file

Viewing output

Cont..

Editing figure

Communications Toolbox

Communications Toolbox software extends the MATLAB technical computing environment with functions, plots, and a graphical user interface for exploring, designing, analyzing, and simulating algorithms for the physical layer of communication systems

Key features

Functions for designing the physical layer of communications links, including source coding, channel coding, interleaving, modulation, channel models, and equalization

Plots such as eye diagrams and constellations for visualizing communications signals

Graphical user interface for comparing the bit error rate of your system with a wide variety of proven analytical results

Modulation Features

Channel Features

chan = mimochan(nt, nr, ts, fd) constructs a multiple-input multiple-output (MIMO) Rayleigh fading channel object with a single path link.

nt is the number of transmit antennas.

nr is the number of receive antennas.

nt and nr can be integer values from 1 to 8.

ts is the sample time of the input signal, in seconds.

fd is the maximum Doppler shift, in hertz.

CASE-STUDY

Control System ToolBox

It builds on the foundations of MATLAB to provide functions designed for control engineering. It is a collection of algorithms, written as M-files, that implements common control system design, analysis, and modeling techniques. Convenient graphical user interfaces (GUIs) simplify typical control engineering tasks.

Creating Transfer Function Models

Transfer function (TF) models can be created by specifying

Numerator coefficients and Denominator coefficients.

EXAMPLE:

num = [1 0]; den = [1 2 1]; sys = tf(num,den)

Transfer function: s ------------s^2 + 2 s + 1

Example of Creating Zero-PoleGain Models

To create zero-pole-gain (ZPK) models, specify each of the three components in vector format. sys = zpk(z,p,k) creates a continuous-time zero-pole-gain model with zeros z, poles p, and gain(s)k.

The output sys is a ZPK object storing the model data

Cont..

In the SISO case, the transfer function is represented as:

z and p are the vectors of real- or complex-valued zeros and poles, and k is the real- or complex-valued scalar gain

Example:
sys = zpk([0],[-1 -1],[1])

Zero/pole/gain: s ------(s+1)^2

BODEPLOT

bodeplot(sys,w)

draws the Bode plot for frequencies specified by w.

When w = {wmin,wmax}, the Bode plot is drawn for frequencies between wmin and wmax (in rad/s). sys = tf(1,[1 1]); h = bodeplot(sys)

Cont..

Neural Networks

Neural networks are composed of simple elements operating in parallel. These elements are inspired by biological nervous systems.

One input Neuron:

A one-layer network with R input elements and S neurons

Image Processing ToolBox

To identify the edges in an image

Edge Detectors

Cont..

Cont..

Edge detection

I = imread('circuit.tif'); BW1 = edge(I,'prewitt'); imshow(BW1); figure, imshow(BW2)

Results

Sobel

Canny

Algorithm

Step 1: Acquire Image Step 2: Calculate Sample Colors in L*a*b Color Space for Each Region Step 3: Classify Each Pixel Using the Nearest Neighbor Rule Step 4: Display Results of Nearest Neighbor Classification Step 5: Display 'a' and 'b' Values of the Labeled Colors

Step 1: acquire image

fabric = getsnapshot(vid);

Step 2: Calculate Sample Colors in Color Space for Each Region

colorNames = { 'red','green','purple','blue','yellow' }; nColors = length(colorNames); sample_regions = false([imageHeight imageWidth nColors]);

% Select each sample region. f = figure; for count = 1:nColors set(f, 'name', ['Select sample region for ' colorNames{count}] ); sample_regions(:,:,count) = roipoly(fabric); end close(f);

% Display a sample region. imshow(sample_regions(:,:,1)) title(['sample region for ' colorNames{1}]);

Resluts 1
segmented pictures

Original pictures

Mnp: 30, percent 0.05, cluster number 4

Mnp : 20, percent 0.05, cluster number 7

Signal Processing Toolbox

supports a wide range of signal processing operations, from waveform generation to filter design and implementation, parametric modeling, and spectral analysis. provides two categories of tools

command-line functions and graphical user interfaces

Command-Line Functions

Discrete-time filter design, analysis, and implementation Analog filter design, analysis, and implementation Linear system transformations Windows Spectral analysis Statistical signal processing Parametric modeling Linear prediction Multirate signal processing Waveform generation

Graphical User Interfaces

Filter design and analysis Window design and analysis Signal plotting and analysis, spectral analysis, and filtering

Filter Design and Implementation

To design a fifth-order 30 Hz lowpass Butterworth filter and apply it to the data in vector x: [b,a] = butter(5,30/50); Hd = dfilt.df2t(b,a); % Direct-form II transposed y = filter(Hd,x); % structure

WINDOW DESIGN AND ANALYSIS TOOL

CONVOLUTION & DECONVOLUTION

a = [1 2 3]; b = [4 5 6]; c = conv(a,b) c= 4 13 28 27 18 deconv to deconvolve b from c: [q,r] = deconv(c,a) q= 4 5 6 r= 0 0 0 0 0

Você também pode gostar