Anda di halaman 1dari 3

2010 3rd International Conference on Information Management, Innovation Management and Industrial Engineering

MATLAB COM Component In Radar Signal Processing Application Development

Bian Xiaolin

Wang Jinbo

Department of Electronic Engineering


Naval University of Engineering
Wuhan, China
xlbian@126.com

Department of Electronic Engineering


Naval University of Engineering
Wuhan, China
wjbnavy@126.com

AbstractThere are amount of calculations come down to


arithmetic when we develop programs of radar signal processing.
These programs are developed under higher languages. These
languages are inefficient on calculations and their arithmetic are
not enough well-rounded. MATLAB is used for calculations and
arithmetic, and the arithmetic in it is well-rounded and steady, so
the development is efficient. But it must be under the MATLAB
environment. The "All-purpose Function" method is introduced
according to the existing COM-based MATLAB and Delphi mixed
programming. This method not only increases programming
efficiency but also enhances readability of code.

II.

Literature [1] discusses the realization of Delphi 5 and


MATLAB programming mixed, but the methods have some
limitations, and some can not operate independently from the
MATLAB environment, although some can be independent
of MATLAB, but the conversion problems, inefficient,
inflexible.
Literature [2], [3] using the Component Object Model
COM to achieve mixed Delphi and MATLAB programming,
the method overcomes the limitations of other methods, can
greatly reduce the development effort and shorten the
development time.
COM-based Delphi and MATLAB programming mix
each step of the general process and see the concrete
realization literature [2], [3].

Keywords- COM Delphi MATLAB Mixed Programming


Radar Signal processingUniversal function

I.

INTRODUCTION

In radar signal processing program, involving large


amounts of computing, it is necessary to compile a large
number of mathematical algorithms. Most of the application
developments using Delphi and other high-level language to
carry out. Delphi is a new visual programming language,
usually use it to write applications that enable interactive
interface, data acquisition and port operations and other
functions, but the Delphi method in numerical analysis and
tools to deal with in terms of its efficiency is very low, in the
accurate easily draw the graphic aspects of the data more
difficult. MATLAB is a high-performance numerical
computation and visualization software, which combines
numerical computation, signal processing and graphical
analysis functions into one, known as the calculus-style
language paper. It features powerful applications in various
areas of the foundation has grown from the original "Matrix
Laboratory" to infiltrate the various scientific and
engineering computing areas, such as signal processing,
automatic control. MATLAB as a high-level language, with
very high programming efficiency, but it is to explain the run,
the performance of programs is relatively low, the ability to
access the hardware is relatively weak, graphical user
interface is not flexible enough. Thus, if the combination of
Delphi and MATLAB use of complementary advantages will
be a great benefit. Therefore, this article in the literature [1],
[2], [3] basis, through the preparation of "universal function",
the MATLAB statement embedded in Delphi program, both
the effective implementation of mixed programming, but
also improves the programming efficiency.

978-0-7695-4279-9/10 $26.00 2010 IEEE


DOI 10.1109/ICIII.2010.576

DELPHI PROGRAMMING WITH MATLAB MIXED

III.

"UNIVERSAL FUNCTION" DESIGN

COM-based Delphi and MATLAB Mixed Programming


program debugging process, if the revised COM components,
even a function, so almost all of the above steps have to rerun, and some steps to take a longer time, so the efficiency of
debugging is sometimes very low. Solved this problem can
improve debugging efficiency.
To do this, you can define a "universal function" of the
COM component. The so-called "universal function" is used
in the MATLAB code embedded in function; the debugger
may directly modify the code, without modifying the COM
component.
Used to execute MATLAB code, you can use string
functions eval, this function to MATLAB provides macro
ability, provides the user created function name passed to
other functions capacity to evaluation. eval (x)
implementation of the expression x, if eval ('a = sqrt (2)'), the
implementation of the expression a = sqrt (2), results: a =
1.4142. In some cases, taking into account the exchange of
data, compiled in MATLAB, "common function", the code is:
function Output = Exec(Input,x)
DataIn = Input;
eval(x);
Output = DataOut;
Input and Output, respectively, input parameters and
output parameters, using the expression DataIn = Input to
input data passed to the variable DataIn, with expressions
Output = DataOut DataOut variable passed to the output data,
to
data
exchange
purposes.
397

In accordance with the steps listed earlier to generate COM


components "universal function" of the form:
procedure TMatDelclass.Exec(nargout: Integer; var
Output: OleVariant; Input: OleVariant;
x: OleVariant);
begin
DefaultInterface.Exec(nargout, Output, Input, x);
end;
nargout that the number of output variables,
programming is a constant, that is, all the data to be output
into a variable; Output, said output variable; Input represents
the input variables, the number 1, it also requires that all To
output the data into a variable; x for the character variable,
the contents of the corresponding MATLAB code.
IV.

'den11 = 1. + k(1,1)^2;' +
'den12 = (2. * k(1,1)) .* cos(arg);' +
'den1 = den11 - den12;' +
'resp1 = nume ./ den1;' +
// resp2resp3Code slightly
'plot(fofr,resp1,''k'',fofr,resp2,''k-.'',fofr,resp3,''k--

'');' +

IN RADAR SIGNAL PROCESSING APPLICATION

'xlabel(''Normalized frequency'');' +
'ylabel(''Amplitude response'');' +
'legend1 = [''K='' num2str(k(1,1))];' +
//legend 2legend 3Code slightly
'legend(legend1,legend2,legend3);' +
'grid on;' +
'axis tight;' +
'DataOut = resp1;'

);
end;
// The output variant array of data copied to the
outgoing data, the code slightly, see [2]
end;

DEVELOPMENT

Radar Signal Processing covers a wide range, the


following cancellation MTI only a single recursive filter as
an example, COM components using MATLAB generate a
"generic function" to achieve recursive filter frequency
response curve of the draw.
Single cancellation recursive MTI filter transfer function
[7,8]
as:

2.5

K=0.25
K=0.7
K=0.9

Amplitude response

1 z 1
H ( z) =
1 Kz 1
1
j T
, available expression for the
Then, from z = e
frequency response curve:

2(1 cos(T ))
H (e jT ) =
(1 + K 2 ) 2 K cos(T )
2

1.5

0.5

2
In Delphi create a project file, place in the Form of a
COM control (named MatDelclass) and a button control.
Double-click the Button control, and then add the button to
respond to the event code.
procedure TForm1.Button1Click(Sender: TObject);
var
TransData: array[1..1024] of double;// Outgoing array
data
x,y: OleVariant;// Incoming, outgoing COM variant
P: Pointer;
DataLenIn. DataLenOut: Integer;
begin
DataLenIn := 4; DataLenOut := 100;
x := VarArrayCreate([1,DataLenIn],varDouble); // The
establishment of input variations
y := VarArrayCreate([1,DataLenOut],varDouble); //
The establishment of output variation
x[1] := 0.25; x[2] := 0.7; x[3] := 0.9; x[4] :=
DataLenOut;
with MatDelclass do
begin
Exec( 1, y, x,
'k = DataIn;' + // Assigned to the input parameter k
'fofr = 0:1/k(1,4):1;' +
'arg = 2.*pi.*fofr;' +
'nume = 2.*(1.-cos(arg));' +

0.1

0.2

0.3

0.4
0.5
0.6
Normalized frequency

0.7

0.8

0.9

Figure 1. Interface of Program Running

Program TransData array is saved from the COM control


outgoing data, this can achieve data applications and COM
interfaces. The code to pass data through the variable x COM
control, treatment control for drawing, and the data transfer
out. Run the program, click the button, run the interface
shown in Figure 1, with exactly the same in the MATLAB
environment.
V.

CALLED "UNIVERSAL FUNCTION" OF THE ATTENTION


POINTS

1. "Universal function" of the "universal" is achieved by


calling the eval function, because eval is too flexible,
MATLAB compiler compiler sometimes can not be effective,
such as the chirp function, the author can not be compiled on
a computer conversion, which awaits the MATLAB
Compiler improvement;
2. DataIn, DataOut variables stored in the input and
output data, such as do not need to exchange data, you can
not, but the corresponding variables must be defined, and the
last string must DataOut assignment;

398

users PC in MATLAB is unrealistic "universal function" can


solve these problems.

3. Do not write notes written in the string, such as' k =


DataIn;% assigned to the input parameter k '+, but should be
written as k = DataIn;' + / / assign the input parameter k, or
after the% MATLAB code are not implemented;
4. Note the use of single quotes, such as MATLAB code
legend1 = ['K =' num2str (k (1,1))]; embedding to write for
the 'legend1 = [''K =''num2str (k (1,1 ))];'
5. In order to improve programming efficiency, in terms
of the license, you can debug in the MATLAB development
environment after a successful transplant.
VI.

[1]
[2]

[3]

[4]

CONCLUSION
[5]

Call MATLAB COM components using Delphi, through


"universal function" of the radar signal processing
application development, you can take full advantage of
MATLAB in the algorithm's efficiency and stability, greatly
reduces development effort, reduce development time. In
practical applications, software systems often requires more
than collaboration, if not every developer has installed a
computer MATLAB, a need for a component to be reused, if
not directly to other machines installed MATLAB error
when used on the registration, if not directly in the other's
machine to install MATLAB registration error when used on
the other, requires the use of the software are installed on

[6]
[7]
[8]
[9]

399

WANG Yan-li. Five Methods of Programming with Delphi and


Matlab[J]. Journal of Heze Teachers College, 2006,28(2) :100-102.
HU Jing-song, ZHOU Fang-jie. Study of COM-based MATLAB and
Delphi Mixed Programming[J]. Application Research of
Computers,2005(1) :165-166.
ZHOU Yuan, ZHANG Ying-chao, YE Xiao-ling. Study of Delphi
and Matlab Mixed-programming [J].Computer Knowledge and
Technology(Academic Exchange) ,2007(9):779-780.
TANG Fei, LU Ze-cheng, HANG Nai-shan. Application of Matlab
Group in the Development of Program for Electric Power
System[J].Guangxi Electric Power2005(1):58-60
ZHAO Min, JIANG Fan. The Design of Software Interface between
Delphi and MatLab[J].Computer Automated Measurement & Control,
2000,8(4):26-28.
Yang Gao-Bo, Ji Bo. Proficient in MATLAB 7.0 hybrid
programming [M]. Beijing: Electronic Industry Press, 2006.
Ding Lu Fei, Geng Fu-lu. Radar Principles (third edition) [M]. Xi'an:
Xidian University Press, 2006.
Bassem R. Mahafza, Ph.D. Radar Systems Analysis and Design
Using MatLab[M]. Huntsville, Alabama:COLSA Corporation,2000.
MathWorks. What Is the EVAL Function, When Should I Use It, and
How
Can
I
Avoid
It?
[EB/OL].
http://www.mathworks.com/support/tech-notes/1100/1103.html,
1994-2008/2008-01-04.

Anda mungkin juga menyukai