3.1. A General Approach to the Analysis of Rotating Images Using Spectra in Binary Galois Fields
The principle of reducing rotating images to still images is based on the following property of the Fourier–Galois transformation. Let us consider the following expression, which, among other things, corresponds to the study of a rotating image.
This formula reflects the following fact: the analysed image rotates, yet it remains unchanged. Therefore, it is described by the same function
as the stationary image, with the only difference being the appearance of a phase-shift analogue that depends on time. Let us now take into account the key property of the function
, which follows from Equation (6).
Then Formula (9) can be written in the following form.
Moving on to the summation index
, we get
This means, in particular, that in order to determine the rotation speed of an image, it is permissible to record changes in the phase multiplier over time. In addition, by excluding time-dependent phase multipliers from the spectrum, you can reveal a “frozen” picture. The exclusion of phase multipliers, which depend on time, can, in turn, be carried out using a digital logarithm operation.
Indeed, any non-zero element of the Galois field under consideration is representable in the following form.
The representation (2) used above is a special case of this formula. The operation referred to as digital logarithm can be understood as the mapping of a field element
to the exponent
in the given formula. Applying this operation to Formula (12) yields an evident result.
where through
is the digital logarithm operation.
It can be seen that the first term on the right side of Formula (14) is the same for all spectral components (with an accuracy of up to a factor of ). The second term, if the image is indeed rotating, does not depend on time.
Consequently, it is possible to set the task of excluding the term by using a computational algorithm, which, among other things, is implemented by circuitry. A specific example of solving such a problem is in this work. This example, among other things, shows that it is convenient to solve the problem of analysing rotating images of any type (provided that they are reduced to a discrete form) through the use of Fourier–Galois transformations.
3.3. The Set of Basic Functions Used
In this work, a field is used, the number of non-zero elements of which is 7, which corresponds to the design of a viscometer considered above, which is also intended for the study of mechanochemical processes in solutions in which hydrophobic–hydrophilic or hydrophilic associates are formed.
A specific type of field
element is obtained using the following irreducible equation given over the field
:
A direct verification shows that Equation (15) has no solutions in the field GF(2), which contains only two elements: 0 and 1. At the same time, Equation (15) is of third order, which allows for the construction of an algebraic extension of the field GF(2) of the following form:
where
is a formal root of the irreducible Equation (15), which can also be interpreted as a logical imaginary unit [
48], and
are coefficients from the field GF(2).
This construction fully corresponds to the classical method of building algebraic extensions of the base Galois field, which are widely used in modern information technologies [
49,
50]. The element
is primitive, which can be demonstrated directly, while simultaneously obtaining the explicit form of the remaining elements of the field GF(2).
Since the extension is of degree 3, the elements
and
are linearly independent. The third power of
can be expressed in terms of lower-order powers in accordance with Equation (15) as:
By raising the element
to integer powers, we get all the non-zero elements of the field under consideration (
Table 1).
As follows from Formula (2), any element of the sequences
coincides with one of the elements listed in
Table 1. More precisely, these sequences are composed of powers of
, arranged in an order determined by Formula (2) and relation (8), i.e., the product
nm appearing in Formula (2) is computed modulo 7. The corresponding exponent values are given in
Table 2.
Table 2 also takes into account the following nuance. By virtue of the relation (8), there is a
This means that one of the sequences forming the orthogonal basis consists entirely of elements equal to 1.
Based on
Table 2,
Table 3 has been constructed to display the basis sequences
in binary representation. This representation corresponds to Formula (16), i.e., the rows of
Table 3 show the values of the coefficients
for each element of the basis sequence. Each segment of the table corresponds to a sequence with a specific number
n (indicated in
Table 3).
Each row in this table can be regarded as a discrete function
. Analysis of the results presented in
Table 3 shows that the basis sequences
generate exactly eight functions corresponding to
. Formally, there are 18 such functions, but some of them are identical, as indicated in
Table 3 by colour highlighting. These eight functions can be numbered, and the assigned numbers
are shown in the last column of
Table 3.
Functions
are generated by sequences that form an orthogonal basis. Therefore, it makes sense to check these functions themselves for the fulfilment of orthogonality relations in the sense of calculations in the main Galois field. The results of such a check are presented in
Table 4.
The resulting table shows that if rows and columns numbered 4 and 8 are excluded, the remaining part corresponds to six out of the eight functions
that exhibit mutual orthogonality. This implies that the functions with indices 1, 2, 3, 5, 6, and 7 (as indicated in the last column of
Table 3) form a complete basis over a segment containing seven cycles, provided that this set is supplemented by the function corresponding to the all-ones sequence. In this case, the seven cycles are represented by exactly seven basis functions that are mutually orthogonal.
The specific characteristics of the functions taking values in the base field GF(2), corresponding to the above-mentioned indices, are illustrated in
Figure 2. The vertices of the heptagons marked with red circles correspond to values of 1; otherwise, the value is 0.
Hereafter, we will denote the functions corresponding to
Figure 2 as
, where
. In addition to these, there also exist functions
and
; however, according to the results presented in
Table 4, they are linearly dependent on the others.
In these notations, the basic functions that take values in the field can be represented as
There is one more basis function,
, all of whose elements are equal to 1. The Fourier–Galois spectrum of the values
, recorded from the viscometer sensors, is thus given by the following formula:
where the summation is carried out by the values of
.
The coefficients
essentially represent the elements of a matrix that relates the basis
to the basis
, while
represent the convolution of the basis functions
with the sequence of binary variables describing the image under consideration (in the case of the viscometer example—the sequence of binary variables read from the outputs of the optoelectronic pairs). The explicit expressions for these quantities are as follows:
The values of the coefficients
are presented in
Table 5.
Table 5, among other things, emphasizes that the values of each spectral component can be presented in a form similar to (16)
where
are expressed in terms of
and
in accordance with Formula (26).
Rather
where the summation is also carried out over the values
, and the values of the coefficients
, where
, are presented in
Table 6.
The values
are binary variables and can be obtained by electronic means. The functional diagram of the Fourier–Galois spectrum analyser built on this basis is shown in
Figure 3. The circuit also includes a digital logarithm unit, as discussed below. This scheme also serves as an electronic unit that ensures the operation of the viscometer of the proposed type.
The system includes a set of components that generate binary signals corresponding to the image registration using optoelectronic pairs (1); a block (2) for primary spectrum computation (i.e., a unit that computes the binary values ); a block (3) that calculates the values for all indices ; a switch (4); a digital logarithm block (5); and a Bluetooth module (6).
Block (2) has six inputs and six outputs, while block (3) has six inputs and eighteen outputs. The design of these blocks is relatively simple, as they are entirely based on logic elements that perform modulo-2 addition. Their overall circuit diagram is shown in
Figure 4; this circuit essentially implements the Fourier–Galois spectrum computation in the field under consideration.
The inputs of elements U21, U22, U13, U2, U23, and U24—which are logic gates implementing the “exclusive OR” operation—are connected to the outputs of the optoelectronic pairs, corresponding to the binary values U1–U7. At the outputs of these elements, binary values Ak are generated, in accordance with Formulas (27)–(32). Subsequently, the obtained binary values Ak are fed into the inputs of elements U11, U12, U17, U18, U19, and U20, which perform the logical AND operation, as well as element U3, which also performs the “exclusive OR” operation. These components together carry out the computation of the elements .
The switch sequentially transmits signals corresponding to the three values of for each spectral component to the digital logarithm block. The use of a switch is justified, as the operating speed of the employed logic elements significantly exceeds the typical rotation speeds of the images—at least in the case of the viscometer under consideration.
The rationale for applying the digital logarithm operation—which corresponds to mapping to the powers of the primitive element representing the elements of the given Galois field—is based on the following considerations. First, representing spectral components in terms of elements obtained via algebraic field extension (i.e., involving
and its square) is not always convenient. Second, as follows from Formula (14), it is more appropriate to analyse a rotating image by converting to the powers of the primitive element. In the case under consideration, the digital logarithm operation can be defined explicitly, as shown in
Table 7.
Let us obtain in an explicit form algebraic formulas that allow us to perform a digital logarithm operation corresponding to
Table 7. For this purpose, it is advisable to use the Zhegalkin polynomial, which for the special case under consideration is convenient to represent in the following form.
Here,
is a function that is non-zero only for the specific combination of binary variables
corresponding to the integer
; the coefficients
correspond to the operation represented in
Table 6. Formula (35) allows the value of the binary variable
to be expressed as an algebraic function of all three values
.
In particular, for the coefficient
, this formula takes the following form (in this and subsequent formulas, calculations are performed modulo 2):
This formula contains three terms:
,
,
. As can be seen from
Table 7,
is non-zero only for these specific values of
.
Through simple transformations, Formula (36) can be rewritten in a form that is convenient for implementation as an electronic circuit.
The schematic diagram of the unit that implements these operations is shown in
Figure 5. This scheme has been worked out in the Proteus 8.17 software environment (
Figure 6). The test results confirmed the performance of this scheme. It should be noted that this block is key to the implementation of the proposed approach as a whole, since it is the operation of digital logarithm in accordance with Formula (14) that makes it possible to move from a rotating image to a still one. To accomplish this, it is enough to provide the calculation of the difference of the form
where
is the amplitude of the
-th spectral component at time
.
According to Formula (14), this value is expressed as
The expression in the right-hand side of Formula (41) is time-independent, which is proved by the above statement.
To verify the functionality of the hardware implementation of computational blocks 1–5 (
Figure 3), a dedicated testbench was developed in VHDL using Quartus Prime and executed in the ModelSim simulation environment. Unlike manual selective testing, the virtual testbench performs an exhaustive enumeration of all possible input conditions. A total of 128 combinations of bits U
1…U
7, are sequentially applied to the sensor ports, and the computation results are sets of values b2b1b0, corresponding to the execution of the digital logarithm operation, which is a key element in implementing the proposed approach.
Within the testbench, a numerical model is implemented that fully corresponds to Formulas (27) through (39) presented above.
The timing diagram in
Figure 7 illustrates the operational characteristics of the test bench. For each new set of values
Ui, the registered bits
A1…
A7 appear first, followed by the formation of the coefficients
. As a result, the entire set of output values
b2b1b0, corresponding to the digital logarithm operation, is produced within a single clock cycle. A direct comparison of the results obtained using the presented test and those derived from tabular computations confirms the adequacy of the hardware implementation. The utilized software code is provided in
Supplementary Materials.
This demonstrates that the described hardware algorithm produces results consistent with the original analytical expressions across the entire set of possible input states.
It should also be emphasized that the developed code can be directly utilized for the fabrication of any device based on the analysis of a rotating digital image of the specified type. In particular, field-programmable gate arrays (FPGAs) are now widely used. These chips are programmed using tools such as Quartus Prime 24.1std. The software code employed for testing can be converted into code suitable for FPGA operation using ModelSim. Thus, the developed software effectively replaces the need for designing most of the electronic components of devices of the proposed type.