step is the preprocessing step, which involves applying the Hamming window
function for each segment to suppress high frequencies at the boundaries of the
segment. These frequencies are the result of truncating the signal and
adversely affect the recognition accuracy. Then we need to calculate the
Fourier transform for each input interval. In this paper was used a fast
Fourier transform (Fast Fourier Transformation).
In the process of developing functions it was decided to
take as a basis an architectural solution that would separate the graphic
interface from the business logic, and business logic from the data. Thus,
among the patterns, the best solution was the MVC pattern, which consists of
three parts: model, view, controller.
Model – is a
part that contains the application’s business logic. The model classes are
designed to model the entities the application is dealing with. The objects of
the model do not know anything about the user interface, their sole purpose is
to store and manage the data.
includes the display of data received from the Model. However, the view can’t
directly affect the model. The view has read-only access to the data.
controllers connect objects of representation and models, they contain
“application logic”. Controllers respond to various events triggered
by view objects, and manage data flows between model objects and the
application can become functional until it becomes too complicated to
understand. Separation of code into classes simplifies the design and
understanding of the application as a whole. Similarly, splitting the classes
into model, view, and controller levels simplifies the design and understanding
of the application.
To store the
array-lists of POST codes, sound signals and others lists, a singlet
(singleton) class will be used. Such classes allow the creation of only one
of the singlet class exists as long as the application remains in memory, so
that when the list is stored in the singlet object, the data remains available,
whatever happens to the activities, fragments, and their life cycles.
the lists, the RecyclerView widget will be used. The RecyclerView widget is an
extended and more flexible version of the ListView. It is a container for
displaying large datasets that can be scrolled efficiently while preserving a
limited number of views. The RecyclerView class is a subclass of the ViewGroup.
It displays a list of child View objects, one for each element. It is much more
efficient to create view objects only when they are really needed. The
RecyclerView widget does just that. Instead of creating 100 View views, it
creates an amount sufficient to fill the screen. And when the View widget goes
beyond the screen, RecyclerView uses it again, thus saving the amount of
RecyclerView widget never creates View objects. It always creates ViewHolder
objects that bring the itemView with them (Figure 9.6).
RecyclerView widget does not create the ViewHolder independently. Instead, it
makes a request to the adapter, the controller object that is between the
RecyclerView and the data set with the information that RecyclerView should
is responsible for:
· creating the necessary
· link ViewHolder to the data
from the model level.
RecyclerView widget requires a view object to display, it enters into a dialog
with its adapter. In Figure 9.7 shows an example of a possible dialog that can
be initiated by the RecyclerView. First, RecyclerView asks for the total number
of objects in the list, for which it calls the adapter’s getItemCount() method.
Then, RecyclerView calls the createViewHolder(ViewGroup, int) method on the
adapter to create a new ViewHolder object.
RecyclerView calls onBindViewHolder(ViewHolder, int). RecyclerView passes this
method a ViewHolder object and a position. The adapter retrieves the model data
for the specified position and associates it with the View View of the
ViewHolder object. To perform the binding, the adapter fills View according to
the data from the model object. After this process is complete, the
RecyclerView puts the list item on the screen. Note: the createViewHolder
(ViewGroup, int) method is called much less often than onBindViewHolder
(ViewHolder, int). After enough ViewHolder objects have been created,
RecyclerView ceases to call createViewHolder (…). Instead, it saves time and
memory by reworking old ViewHolder objects.