Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Готов_ПТИ англ.docx
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
2 Мб
Скачать
☆
  1. The Procedure.

Signal we will name the data ordered concerning some argument (for example, time, frequency, spatial coordinate). If as argument time equivalent concepts will be time process, time realization is chosen.

For generation of signals Matlab environment functions, including function of package Signal Processing are used.

In package Signal Processing following functions of generation of signals are realized:

Function

Action

chirp

Generates cosinusoid with variable frequency

diric

Calculates function of Dirihle

gauspuls

Generates a sinusoid modulated by function of Gauss

gmonopuls

Generates a monoimpulse of Gauss

pulstran

Generates impulses

rectpuls

Generates aperiodic rectangular impulses

sawtooth

Generates sawtooth fluctuations

sinc

Function sinc

square

Generates rectangular impulses

tripuls

Generates a periodic triangular impulses

vco

Operated source of pressure

The detailed description of functions and their parameters can be received from help system Matlab or using a command help <a function name>.

Let's consider examples of signals generation.

1. It is required to receive a signal a sinusoidal signal with the set frequency f=0,2 Hz and various frequencies of discretization fD=1 Hz, 3 Hz, 10 Hz. Length of a signal 20 sec.

Since Matlab environment work is focused on matrix representation of signals, we will set at first three vectors of time t which will correspond to various frequencies of removal given (to frequencies of discretization).

>> fs1=1; fs2=3; fs3=10;

>> T=20; f=0.2;

>> t1=0:1/fs1:T;

>> t2=0:1/fs2:T;

>> t3=0:1/fs3:T;

%fs1 – sampling frequency – frequency of discretization

% T – length of a signal; f - frequency of a signal

For generation of a sinusoidal signal (function evaluations sin in set the vector ti points uses function Matlab – sin. We will specify, demanded by the given function, arguments:

>> help sin

SIN Sine.

SIN (X) is the sine of the elements of X

Overloaded methods

help sym/sin.m

Further we will set a vector of signals:

>> y1=sin (f*t1);

>> y2=sin (f*t2);

>> y3=sin (f*t3);

For visualization of signals we will use function plot:

>> plot (t1, y1, ' - ro ', t2, y2, ' - g> ', t3, y3, ' - b ')

>> grid on

>> xlabel (' Time ');

>> ylabel (' Amplitude ');

>> title (' SIGNAL ');

% grid Display

% the Signature of an axis X

% the Signature of axis Y

% drawing Heading

The result of work is represented on Figure 1

Figure 1

All above operations can be decorated in the form of m - file in the editor of m - files (Figure 2).

Figure 2.

2. It is required to receive function MATLAB generating a signal duration 10 with, removed with step 1/f and representing

The parameter f is argument of function.

Function appears a reserved word function after which expression [output_value_function] = the name of function [( arguments - functions)] follows.

One possible variants of the decision of the given problem it is resulted more low

function A = example1_2 (f)

t=0:1/f:10;

t1=0:1/f:3;

A (1:length (t1)) =sin (7*pi*t1);

t2 = (3+1/f):1/f:6;

A (length (t1) +1:length (t1) +length (t2)) =2+sin (7*pi*t2);

t3 = (6+1/f):1/f:10;

A ((length (t1) +length (t2) +1) :( length (t1) +length (t2) +length (t3))) =sin (2*pi*t3);

plot (t, A);

grid on;

The given function can be caused from other functions or is started from Command Window:

>> example1_2 (128);

The result of performance of function is resulted more low

Figure 3

Convolution

Convolution plays the main role in COS theory (look the lectures ).

Discrete resultant of two signals g and h is discrete convolution of two signals g и h называют one - dimensional mass

In the environment of MATLAB convolution is realized by the following function conv (And, B).

As a result the vector in length LENGTH (A) +LENGTH (B) - 1 turns out