Bian Xiaolin
Wang Jinbo
II.
I.
INTRODUCTION
III.
'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--
'');' +
'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
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
398
[1]
[2]
[3]
[4]
CONCLUSION
[5]
[6]
[7]
[8]
[9]
399