Design and Application of Software for Generating Simulated Signal Data
838
each sample by regarding each column as one sample,
and the average position of black pixels in each column
as one value of corresponding sample or column in digi-
tal signal. In the actual conversion, taking into account
the graphics that may be scanning, we can obtain three
data for every column in an image: the top one which is
the minimum coordinate value of Y axis of black pixels
in the column; the bottom one which is the maximum
coordinate value of Y axis of black pixels in the column;
the average one which is the average of the top and the
bottom of each column. Moreover, we looked upon the
average value of each column as the digital data of cor-
responding column or sample. In addition, because the
coordinate value of Y axis gradually enlarge from top to
bottom in an image while the valu e of digital data in sig-
nal waveform lessen little by little from top to bottom,
value of the real digital data should equal to the subtrac-
tion of height of the image and the value of the digital
data. The equation can be defined as
DHM (1)
where D presents the real digital data, H is the height of
the image and M presents the value of the digital data.
To each column, we can get real digital data, th erefo re,
a group of digital data sequences (DDS), which may be
presented by D [n] and in which n means the total num-
ber of data, can be obtained from the whole image.
2.2.5. Di gital Da ta Processing
The DDS, which are produced directly through wave
pattern image often can’t meet given conditions; there-
fore, it is necessary for the digital filtering and changing
to stimulate signal data. In this software, we design an
average digital filter, and it’s equation is:
1
0
1m
l
DkDk l
m
(2)
where k presents the order of digital data in sequences, m
is the number of averaging data, which can set by input
dialogue box. By this processing, the total number of the
data (TMD) is equal to n-m, the unexpected sharp transi-
tions can be reduced or eliminated, and an ideal wave
pattern digital data may be obtained.
For meeting the user’s requirements, we apply the fol-
lowing two steps conversion:
1) Converting the number of DDS to the needed sam-
ples
Because the number of DDS usually can’t meet user’s
demand, we must covert the number of that to meet the
need by the following algorithm. It is
1jiTMD NN 1 (3)
where NN is the number of needed data which are equal
to samples, it is the order of needed data, which can
change from 0 to NN – 1, TMD presents the total number
of the data obtained after digital filtering, j is a float
value.
Then, if the value of j isn’t eq ual to an integer, we can
get an integer J, which meets inequality: J < j < J + 1.
We can get the value of TD [i] by using Lagrange’s
interpolation formula for four neighbor data, whose order
is J – 1, J, J + 1, J + 2. Lagrange’s interpolation formula
is
112
6
[] 11
2112
2211
6
DJ
TDij Jj Jj J
DJ jJ jJ jJ
DJ jJjJ jJ
DJ jJjJ jJ
2
(4)
if the value of J is equa l to an integer,we can get TD [i]
by the following equation:
TD iDj (5)
Finally, the number in sequence of TD [i] is equal to
samples.
2) Converting the DDS to the needed ones
The data of meeting g iven cond itions can b e gained by
the following equ ation:
Min 2
MaxMin2
r
TD iA
NDS i
2
(6)
where NDS [i] is DDS, Max is the maximum value in TD
[i] and Min is the minimum value in TD [i], r presents
the number of bits, A is the amplitude of needed data.
Through this digital data processing, we can get all
needed data, which meet user’s demand, and save to a
file for using.
3. Application
In order to show how to apply the software, we gave
examples of generating simulated physiological signal
data. The processing generally consists of the following
three steps:
1) By scanning from a book, we obtained a gray image
and saved to a file named avr_1.bmp.
2) The file was loaded to this software by using “Op en
Bitmap” in menu, and then we could see the wave pattern
shown in the main window and some unexpected small
areas, lines and dots (Figure 4(a)). By using some opera-
tions in order of spatial filter with 5 × 5 averaging filter
mask, image binarization, morphonological binary image
processing of erosion and opening, we got the image
shown in Figure 4(b). Finally, unexpected areas, lines,
dots were wiped out and only the needed wave pattern
was kept in an image. Of course, we can erase manually
Copyright © 2012 SciRes. JSEA