Biomedical Engineering Reference
In-Depth Information
Finally, a word of caution when building this arb. High-frequency clocks and signals
demand proper layout techniques [Prutchi, 1994]. Preferably, use a multiple-layer printed
circuit board. Separate the analog ground from the digital ground and join them at a sin-
gle point at the power source. Maintain interconnection over the buses short and of equal
length. In addition, use good-quality high-frequency capacitors to decouple the power rails
in close proximity to the power input pins of each IC.
Creating Arbitrary Waveforms
Signal creation for reproduction by an arb is usually accomplished in one of two ways:
(1) capturing an analog signal using a digital storage oscilloscope (DSO), or (2) creating
the waveform on a PC by generating a numerical representation of the waveform's math-
ematical formulation. One of the most popular and useful packages used in the develop-
ment of signal-processing algorithms is Matlab by The MathWorks Inc. Complex
waveforms can be generated by this package's enormous library of mathematical func-
tions. With an arb, test signals synthesized within Matlab or any other scienti
c pro-
gramming environment can be used to excite the real hardware of a medical instrument,
not just its algorithms.
The following Matlab function (mat2arb.m) is capable of saving two vector variables
from its environment in a format that can be loaded into the PC-programmable arb
described earlier.
fi
function v mat2arb(x, filename);
%MAT2ARB saves 2 vectors as a file that can be loaded into the
%2-channel Arbitrary Waveform Generator
% x input matrix [vector 1 ; vector 2] sample value range 0 to 4095
% filename filename where arb file is to be saved entered as 'filename.ext'
%
%
%
if min(min(x)) 0;
disp('minimum sample value found')
disp(min(min(x)))
error('sample value range must be between 0 and 4095')
end
if max(max(x))>4095;
disp('maximum sample value found')
disp(max(max(x)))
error('sample value range must be between 0 and 4095')
end
n length(x);
% n is the length of the vectors
zer zeros(1, n);
% generate vector of zeros for
% marker channels
y 1:n;
% generate vector of sample
% indexes
v [x(1, y);x(2, y);zer(y);zer(y)]; % marker channels always low
fid fopen(filename, 'w');
% open file for output
fprintf(fid,' %1g , %1g ,
% write file in format suitable
%1g , %1g \r', v);
% for ARB
fclose(fid)
% close file
Search WWH ::




Custom Search