Reconfigurable Filtering of Neuro-Spike Communications Using Synthetically Engineered Logic Circuits

High-frequency firing activity can be induced either naturally in a healthy brain as a result of the processing of sensory stimuli or as an uncontrolled synchronous activity characterizing epileptic seizures. As part of this work, we investigate how logic circuits that are engineered in neurons can be used to design spike filters, attenuating high-frequency activity in a neuronal network that can be used to minimize the effects of neurodegenerative disorders such as epilepsy. We propose a reconfigurable filter design built from small neuronal networks that behave as digital logic circuits. We developed a mathematical framework to obtain a transfer function derived from a linearization process of the Hodgkin-Huxley model. Our results suggest that individual gates working as the output of the logic circuits can be used as a reconfigurable filtering technique. Also, as part of the analysis, the analytical model showed similar levels of attenuation in the frequency domain when compared to computational simulations by fine-tuning the synaptic weight. The proposed approach can potentially lead to precise and tunable treatments for neurological conditions that are inspired by communication theory.

High-frequency firing activity can be induced either naturally in a healthy brain as a result of the processing of sensory stimuli or as an uncontrolled synchronous activity characterizing epileptic seizures. As part of this work, we investigate how logic circuits that are engineered in neurons can be used to design spike filters, attenuating high-frequency activity in a neuronal network that can be used to minimize the effects of neurodegenerative disorders such as epilepsy. We propose a reconfigurable filter design built from small neuronal networks that behave as digital logic circuits. We developed a mathematical framework to obtain a transfer function derived from a linearization process of the Hodgkin-Huxley model. Our results suggest that individual gates working as the output of the logic circuits can be used as a reconfigurable filtering technique. Also, as part of the analysis, the analytical model showed similar levels of attenuation in the frequency domain when compared to computational simulations by fine-tuning the synaptic weight. The proposed approach can potentially lead to precise and tunable treatments for neurological conditions that are inspired by communication theory.

INTRODUCTION
Seizure dynamics with either spontaneous and recurrent profiles can occur even in healthy patients during the processing of sensory stimuli or it could manifest itself as an uncontrolled synchronous neural activity in large areas of the brain (Jirsa et al., 2014). Any disruption to the mechanisms that inhibit action potential initiation or the stimulation of processes that facilitate membrane excitation, can prompt seizures. Tackling this disease efficiently is an existing clinical issue where new approaches are constantly being investigated in order to provide precise and reliable strategies in inhibiting or disrupting seizure-triggering populations of neurons. For example, controlling neuron firing threshold can most likely prevent seizure activity, which can often be achieved at a single neuron level (Scharfman, 2007).
The development of techniques for the treatment of this type of neurodegenerative disorder is challenging not only due to the complexity of the brain function and structure but also as a result of the invasiveness and discomfort caused by today's most common neurostimulation or surgery approaches (Rolston et al., 2012). However, due to the lack of success in non-invasive approaches, the immediate future epilepsy treatment will still see invasive methods. This approach must achieve population-level control with state-of-the-art technology in not only neuroengineering but must also integrate other disciplines. Recent advancements in nanotechnology, for instance, have been enabling the development of novel devices at the nano-scale that are capable of improving bio-compatibility. Nanotechnology-based treatment also includes advantages in the treatment precision, patient comfort as well as longer treatment lifetime. However, there still remain numerous challenges in the use of nanotechnology. For example, the passage of chemicals through the blood-brain barrier (BBB) is among the many challenges that disrupt the efficiency of nanoparticles-mediated drug delivery functioning. Challenges still remain as to how nanoparticles that pass through the BBB will diffuse toward specific neural populations. However, if the drug-loaded nanoparticles can be delivered at sufficient concentrations and accurately to a specific location, this can influence neural activities (Bennewitz and Saltzman, 2009;Veletić et al., 2019). As an example, drug delivery targets specific neurodegeneration promoting factors (Feng et al., 2019) by performing a drug-induced control over intracellular, extracellular and synaptic properties that regulate spiking activity (Blier and De Montigny, 1987).
Previous studies on the firing response of neurons have investigated the filtering capabilities either due to realistic synaptic dynamics (Brunel et al., 2001;Moreno-Bote and Parga, 2004) or by naturally manipulating the resting potential of voltage-dependent active conductances of a neuron enhancing its temporal filtering properties (Fortune and Rose, 1997;Motanis et al., 2018). On the other hand, existing analyses do not account for the many molecular control mechanisms that may influence the synaptic activity, e.g., drug. In the case of seizures, the understanding of the drug-induced firing response may allow further analysis on the impact of high-frequency firing on the neural tissue as well as how to desynchronize or slow it down. Frequency-domain analysis has been performed on top of linear models of the Hodgkin-Huxley (HH) formalism to investigate not only the transmission of information through the use of subthreshold electrical stimulation (Khodaei and Pierobon, 2016) but also the influence of axonal demyelination on the propagation of action potentials (Chaubey and Goodwin, 2016). Although Hodgkin-Huxley is not the only neuron model available in the literature, it is one of the most plausible models for computational neuroscience (Long and Fang, 2010). Other proposed models are, for example, integrate-and-fire, Izhikevich and Fitzhugh-Nagumo models (Mishra and Majhi, 2019). The manipulation of cellular activity, such as neuronal spiking activity, using molecules complexes to mimic logic gates and transistors has also been proposed in the literature. One example is the work of Vogels and Abbott (2005), in which the propagation of neuronal signals in networks of integrate-and-fire models of neurons was investigated and they found that different types of logic gates may arise within the network by either strengthening or weakening specific synapses. Goldental et al. (2014) used identical neurons to propose dynamic logic gates that work based on their historical activities, interconnection profiles, as well as the frequency of stimulation at their input terminals. In our previous works (Adonias et al., 2019;Adonias et al., 2020), we developed several logic gates arranged in groups of three heterogeneous models of neurons, with two working as inputs and one as the output, and performed a queueing-theoretical analysis aiming at the study of such a complex network as a single element behaving as the collective of those cells. Irrespective of the tremendous efforts from the scientific community, these works do not provide a framework of reconfigurable circuits that could pave the way for more sophisticated approaches for neuron control. Further investigation of novel neuronal electronic components constructions is needed to develop bio-compatible and reliable solutions that can address defective neuronal networks. While the scientific community has been witnessing remarkable progress in the manipulation and engineering of the behavior of mammalian cells (Lienert et al., 2014), the existing models do not yield analytical expressions that could be used to model drug-induced filtering capabilities of a neuron and, in particular, incorporating computing paradigms. The main focus of this work is to lay the ground-work of analytical models for digital filters that are designed and engineered into neurons, potentially leading to the development of novel epilepsy treatments.
In this work, we propose a mathematical framework aiming at the interpretation of the filtering capabilities in small populations of neurons that are engineered into a logic circuit (Figure 1). The circuit aims to reduce the firing rates from its inputs by performing the binary logic as well as integrating reconfigurability, where the different logic circuit arrangements, as well as logic gate types, can be tuned to change the filtering properties. To achieve that in our mathematical framework, we modify parameters on the logic circuit transfer function, derived from the linear interpretation of the Hodgkin-Huxley neuronal model. These parameters are related to neuronal and synaptic properties of a neuro-spike communication, such as conductances and weight, and can potentially be achieved through the sustained administration of a specific drug. Our mathematical framework is, from an application point-of-view, a design platform for neuroscientists in creating filtering solutions for smoothing out the effects of neurological diseases that require the minimization of firing activity. The framework models the effects of drug-induced molecular changes in models of neurons aiming to control the neuronal activity of a synthetic engineered cell, however, the fabrication and specifications of such a drug are out of the scope of this paper. The contributions of this paper are as follows: • Neuronal logic circuits are built using computational models of neurons and this arrangement is expected to be capable of acting as digital filters, converging four inputs into one output with a shift in attenuation driven by modifications to the synaptic weight. • A mathematical framework is proposed paving the way for the design of neuronal digital filters to help suppress the destructive effects of neurodegenerative diseases. This framework should enable the relationship between biophysical models and drug design, facilitating scientists control over the behavior of the filters. • Analysis of the performance of the neuronal filters in terms of accuracy and of signal power attenuated by the circuit. This analysis gives an insight into how parameters such as weight or frequency at the input would affect the performance of such filters.
The remainder of this paper is as follows, section 2.1 briefly describes how neurons differ between each other and how they communicate with one another. In section 2.2, we explain how neurons can function as non-linear electronic circuits based on the seminal work of Hodgkin and Huxley (1952) and we also describe the process of linearization aiming to derive a transfer function of the filter model. The filter design is explained in section 2.3 which also covers how neurons are represented as compartments and connected to form logic gates and, consequently, to form logic circuits. In section 3, we present the results that are discussed in section 4 and, finally, the conclusions are presented in section 5.

Neuronal Communication
To be able to synthetically implement complex functions inside the brain, we must control how the neurons exchange information using the propagation of action potentials inside a network of neurons. The number of excitatory and inhibitory connections between neurons determines the spatio-temporal dynamics of the action potentials propagation (Zhou et al., 2018). Efficient coding and modulation of neuronal information have been used to implement bio-computational approaches in our previous work (Adonias et al., 2020). Bio-computing can be created from neuronal networks that are engineered to function as logic circuits through controlling the neuro-spike communication and curbing the signal propagation dynamics between the neurons.
We aim to investigate the neuronal and synaptic properties in constructing logic circuits that perform the filtering of spikes in small populations from the somatosensory cortex. The cortex is responsible for most of the signal processing performed by the brain and comprises a rich variety of morpho-electrical types of neuronal and non-neuronal cells. We will take into account these characteristics in the construction of our mathematical framework that is used to design the circuits.

Properties of a Neuron
Neurons are divided into three main parts: dendrites, soma, and axon. Dendrites receive stimuli from other cells and the way these dendritic trees are projected onto neighboring neurons in a network helps to classify neuron morphological types. The axon passes stimuli forward to cells connected down the network through its axon terminals and the soma is the main body of the neuron. Each neuron's response to a stimulus will dictate the electrophysiological neuron type. The soma is where most proteins and genes are produced and where stimuli are generated and fired down the axon.
Besides the way dendrites are projected, the proteins and genes that neurons express and their morphological and electrophysiological characteristics are important for the classification of different types of neurons. One of the most comprehensive works on neuronal modeling, by Markram et al. (2015), classifies the neurons from the rat's somatosensory cortex based on their morpho-electrical properties (morphological and electrical characteristics) as well as the cortical layer they belong (columnar and laminar organization).

Morpho-electrical characteristics
Even though all neurons used in this work can assume different morphological structure, it is exactly by analyzing their axonal and dendritic ramification that we can have a good enough categorization of their respective morphological types. Regardless of their types, neurons in the cortical layer are considered of small sizes (8 -16 µm). Furthermore, inhibitory neurons can be better identified by their axonal features while excitatory neurons can be more easily classified based on their dendritic features (Markram et al., 2015). Each morphological type (m-type) can fire different spiking patterns and this may affect the gating capabilities of neurons due to the fluctuations on precise spike timing. Markram et al. (2015) categorized 11 different electrical types (e-types) of neurons, hence, 11 different ways of firing a spike train generated in response to an injected step current.

Cortical organization
The cerebral cortex comprises six distinguished horizontal layers of neurons, with each layer having particular characteristics such as cell density and type, layer size, and thickness. This horizontal configuration is also known as a "laminar" organization, where the layers are identified as (1) Molecular layer, which contains only a few scattered neurons and consists mostly of glial cells and axonal and dendritic connections of neurons from other layers; (2) External granular layer, containing several stellate and small pyramidal neurons; (3) Pyramidal layer, contains non-pyramidal and pyramidal cells of small and medium sizes; (4) Inner granular layer, predominantly populated with stellate and pyramidal cells, this is the target of thalamic inputs; (5) Ganglionic layer, containing large pyramidal cells that establish connections with subcortical structures; and (6) Multiform layer, populated by just a few large pyramidal neurons and a good amount of multiform neurons, which sends information back to the thalamus. All layers may contain inter-neurons bridging two different brain regions.
The neurons are not just stacked one on top of another suggesting a horizontal organization, indeed vertical connections are also found in between the neurons from either the same or different layers. This allows another type of classification known as mini-columns (also called, micro-columns) with a diameter of 30-50 µm and when activated by peripheral stimuli, they are seen as macro-columns, with a diameter of 0.4-0.5 mm (Peters, 2010). This will create network topologies with intrinsic characteristics, e.g., connection probabilities between neurons, that influence the signal propagation to converge into either a specific pattern or flow.

Neuron-to-Neuron Communication
The communication between a pair of neurons is done through the diffusion of neurotransmitters in the synaptic cleft; this process is triggered by an electrical impulse reaching the axon terminals of the transmitting cell characterizing an electrochemical signaling process known as the synapse. Action potentials propagate down the axon of the pre-synaptic cell, which is the sender cell, and when reaching the axon terminals also known as pre-synaptic terminals, it triggers the release of vesicles containing neurotransmitters into the synaptic cleft, which is the gap between a pre-and a post-synaptic terminal, as illustrated in Figure 2. Those neurotransmitters FIGURE 2 | Schematic of a synapse; action potentials traveling down the axon trigger the release of neurotransmitters into the cleft between pre-and post-synaptic terminals, traveling toward neuroreceptors on the other end leading to changes on membrane conductance that can either excite or inhibit the post-synaptic neuron.
Frontiers in Computational Neuroscience | www.frontiersin.org will probabilistically bind to neuro-receptors located at the post-synaptic terminals, i.e., dendrites (Balevi and Akan, 2013), triggering the exchange of ions through the membrane that can either excite or inhibit the cell, depending on the type of neurotransmitters that were received. In our work, we focus on the synaptic weight between the pre-and post-synaptic terminals. The synaptic weight is a measure of how much influence the pre-synaptic stimuli have on the post-synaptic cell and it is known to have its value best approximated to the time integral of the synaptic conductance (Gardner, 1989). Furthermore, the value of synaptic conductance in the postsynaptic terminal is driven by the number of neurotransmitters bound to neuroreceptors (Guillamon et al., 2006). We illustrate the synaptic weight, in Figure 2, as red neurotransmitters which should have their release from the pre-synaptic terminals induced by the administration of a specific drug.
In an excitatory synapse, the membrane potential of the post-synaptic cell, which rests at approximately −65 mV, will start depolarizing itself until it reaches a threshold, th, for action potential initiation. On the other hand, if the synapse is inhibitory, the membrane should get even more polarized making it nearly impossible for the cell to fire a spike and not allowing the propagation of any signal down the network from the inhibited cell. After reaching th, the membrane potential should increase toward a maximum peak of depolarization, and then the cell will start the process of repolarization toward its resting potential. For a brief moment, the potential inside the cell will cross the level of potential when at rest making the membrane hyperpolarized, which is a period known as the refractory period and it can be further subdivided as absolute and relative. The absolute refractory period (ARP) lasts around 1-2 ms during which the neuron is unable to fire again regardless of the strength of the stimuli; then, it is followed by the relative refractory period (RRP) during which a response in the potential of the cell may be evoked depending on the strength of the stimuli (Mishra and Majhi, 2019).

Electronic Interpretation of a Neuron Model
The main structures of a neuron, previously mentioned in section 2.1.1, can assume different shapes and spatial structures that play an important role in determining its input and output relationship. By sectioning the neuron into several compartment models, we are able to account for the influence that individual compartments have on the communication process of the neuron. Even though we consider the same value of resting potential for all compartments of the cell, there is some discussion on whether different compartments have different potentials when at rest (Hu and Bean, 2018).
We aim to develop a transfer function for the neuronspike response, or output [V(s)], to a particular spike input [I(s)]. Using a transfer function for each neuron which is represented as a single compartment, we are able to efficiently associate the configuration of the filters with the structure of the neural network as well as the individual characteristics of each neuron. On top of that, we also are able to focus on frequency domain for an effective spike firing filtering. We rely on the electronic interpretation of the Hodgkin-Huxley model of neuron action potentials, which is made based on the neuronal cable theory assumptions on the static ionic channels conductance. In this section, we provide the details of the development of the transfer function, which is built on the linearization process of the Hodgkin-Huxley neuron model.

Hodgkin-Huxley Formalism
As aforementioned in section 1, neurons can perform spike filtering tasks either by manipulating ionic conductances, such as sodium and potassium conductances, from within the cell (Fortune and Rose, 1997) or by working on the extracellular environment where the synapse occurs (Brunel et al., 2001;Moreno-Bote and Parga, 2004). Furthermore, filtering capabilities may vary according to the non-linearities of the neuron's activity and action potential propagation. In order to design an efficient filtering process, we will need to eliminate the non-linearities so we can directly link neurons properties to the filtering behavior and adjust these properties according to a desired filtering performance level. We consider the Hodgkin and Huxley non-linear model (Pospischil et al., 2008) as our basic model since it perfectly describes the influence of ionic conductance and synaptic conductance in the propagation of the action potentials. We assume that parts of the neuron will constitute a compartment, which results in the electric  Figure 3A when applying the conventional neural cable theory. Figure 3 depicts C as the membrane capacitance, each voltagegated ionic channel represented by its respective conductances g Na and g K and the leak channel by the linear conductance g l . The membrane capacitance is proportional to the surface area of the neuron and, along with its resistance, dictates how fast its potential responds to the ionic flow. The ratio between intra-and extra-cellular ions define the reversal potentials E Na, K, l establishing a gradient that will drive the flow of ions (Barreto and Cressman, 2011).

circuit in
When an external stimulus, I ext , is presented, it triggers either the activation or inactivation of the ionic channels that allow the exchange of ions that result in depolarization (or hyperpolarization when inhibitory) of the membrane of the cell. These dynamics are modeled as where V is the membrane potential and I x are the ionic currents where x represents either a specific ion (Na, K) or the leak channel (l). Those currents are described as where m and h are the activation and inactivation variables of the sodium channel, respectively, and n is the activation variable of the potassium channel, following the conventional approach described by Hodgkin and Huxley (1952) and stated as in which the values of the rate constants α i and β i for the i-th ionic channel can be defined as The membrane capacitance is proportional to the size of the cell, and on the other hand, the bigger the cell diameter, the lower the spontaneous firing rate (Sengupta et al., 2013). Furthermore, each ionic channel can be studied as containing one or more physical gates which can assume either a permissive or a non-permissive state when controlling the flow of ions. The channel is open when all gates are in the permissive state, and it is closed when all of them are in the non-permissive state (Baxter and Byrne, 2014).

Hodgkin-Huxley Linear Model
In order to derive a transfer function for the Hodgkin-Huxley model, we must consider each neuron as a system that is linear and time-invariant (LTI). If the system is non-linear, then a linearization process should be done before any frequency analysis is performed. For a more detailed analysis on the procedures for linearization of the Hodgkin-Huxley model, the reader is referred to Koch (2004), Mauro et al. (1970), Sabah and Leibovic (1969), and Chandler et al. (1962).
The linearization process requires that we reconsider the electronic components in each neuron compartment to adequately eliminate trivial relationships. Membranes with specific types of voltage-and time-dependent conductances can behave as if they had inductances even though neurobiology does not possess any coil-like elements. This modification will transform the behavior of non-linear components toward linearization, resulting in a proportional relationship between the voltage and current changes (Koch, 2004).
Every linearization process is performed for small variations around a fixed point, hereafter denominated by δ, and in the case of the Hodgkin-Huxley model, this fixed point should be the steady-state (resting state) of the system. Because the sodium activation generates a current component that flows in an opposite direction compared to that of a passive current, the branch concerning the sodium activation should have components with negative values while the branches regarding potassium activation and sodium inactivation should have components with positive values (Sabah and Leibovic, 1969). The linear version of the circuit of Figure 3A is illustrated in Figure 4, where C is the membrane capacitance, g n , g m , and g h are the conductances of the inductive branches connected in series with Frontiers in Computational Neuroscience | www.frontiersin.org their respective inductances L n , L m , and L h derived from the linearization process and G T = G L + G K + G Na is the total pure membrane conductance.
Let us consider the membrane potential deviation, δV, around some fixed potential. Thus, we can express the response of the circuit to small-signal inputs as where δI l,Na,K are current variations at any given steady-state and can be defined as where G K,Na are pure conductances of potassium and sodium and G L the pure leak conductance expressed as whereḡ K,Na are the maximum attainable conductances, and δn, δm, and δh are small variations around the steady-state of the activation and inactivation variables n, m, and h which are written as as a function of the derivative of the rate constants α n,m,h and β n,m,h , and n ∞ , m ∞ , and h ∞ are the steady-state values of m, n, and h defined as and the conductances, g n,m,h , and inductances, L n,m,h , of the inductive branches are defined as Each channel has a probability of being open which represents the fraction of gates in that channel that are in the permissive state (Gerstner et al., 2014). The gating variables are described by the coupling of the conductances g n,m,h and their respective inductances L n,m,h which are functions of the rate constants representing the transition from permissive to non-permissive state, α(V), and vice-versa, β(V) which should take a short period of time, τ = [α(V) + β(V)] −1 , to eventually reach a steady-state value, α ∞ and β ∞ (Koslow and Subramaniam, 2005). Borrowing concepts from systems theory such as frequency analysis of LTI systems, as a standard procedure for the analysis of linear differential equations as simpler algebraic expressions (see Nise, 2015), and the linearization of non-linear systems for the reason previously mentioned at the beginning of this section, we derived a transfer function in the Laplace domain for the linear system from Figure 4. The relationship between the different elements of the circuit and their respective impedance and admittance values from the Laplace transforms are depicted in Table 1.
Therefore, the relationship between the output and the input of the system in the frequency domain is expressed as where s = σ + jω is a complex variable; j = √ −1 and ω = 2πf , where f is the frequency in Hertz. Let us rewrite Equation (33) as Now, denoting γ = G T +g n +g m +g h and λ −1 = L −1 n +L −1 m +L −1 h and performing a few algebraic manipulations, we end up with the following transfer function for the filter model For frequency response analysis, we observe the behavior of W(jω), i.e., substitute s = jω. For ω → 0, W(jω) behaves like ω; for ω → ∞ it behaves like 1 ω+1 , i.e., in both cases it tends to zero, and hence demonstrates the behavior of a secondorder band-pass filter (BPF). It corresponds to the canonical form the selectivity and ω 0 = √ λ −1 C −1 is the peak frequency of the filter. This agrees with findings from previous literature on the matter (Plesser and Geisel, 1999) that concluded the periodicity of a stimulus is optimally encoded by a neuron only in a specific spectral window.

Transfer Function Filter Design
Given the transfer function for a neural compartment in the previous section, we now progress toward a transfer function for the spike filter. The filter is comprised of neurons that are particularly chosen to have a network that will behave as a digital gate and a small population that will behave as a circuit that implements the filter. Our aim is to capture the relationship between compartments as well as neuron connections so we can build a transfer function for the filter while considering neuron connection variables (synaptic conductance and synaptic weight) that allow easy reconfiguration of the filtering process. The linearization process combined with the analysis of the neuron communications is the driver of the filtering process, which also allows the derivation of a filter transfer function which is detailed below.

Biological Logic Gates and Circuits
Synthetic biology is the technology that allows the control of the neurons' internal process in order to construct non-natural activity and functioning of neurons, e.g., logic gates (Larouche and Aguilar, 2018). Synthetic logic operations inspire scientists to address the challenges posed by novel synthetic biomedical systems, such as biocompatibility and long-term use. Figure 5A shows the three types of the circuit we have built and analyzed in this work. From circuits A to C, the number of OR gates is decreased; when compared to AND gates, OR gates are quite permissive. In our previous study (Adonias et al., 2020), we present an analysis on how signals from two input neurons will need to be close to each other to amplify the action potential of the output neuron in order to achieve maximum AND-gating accuracy. The transformation from a purely ORformed logic circuit to a purely AND-formed one leads to the confirmation of what the truth-tables suggest, i.e., fewer states evoke spikes in the output and, consequently, the attenuation of higher frequencies in the inputs. Figure 5B shows the connection of AND gates in cascade, and this analysis is further discussed in the section 4. Each of the circuits was analyzed with one and two AND's in cascade, hence the nomenclature of a letter followed by a number, the letter refers to the type of circuit and the number accounts for how many AND gates are connected in cascade. Only two types of logic gates were used to build the circuits, an AND composed of the cells L23-MC (Layer 2/3 Martinotti Cell), L23-NBC (Layer 2/3 Nest Basket Cell), and L1-HAC (Layer 1 Horizontal Axon Cell); and an OR composed of the cells L23-MC, L23-NBC, and L1-DAC (Layer 1 Descending Axon Cell). These cells were picked because they showed the best performance in our previous analysis on their individual gating capabilities.
Given that several factors such as connection probability, type of cell, and different numbers of compartments (as discussed in section 2.3.2) among different types of neurons may influence its gating capabilities. This variation on the quantity of compartments could also lead to variations on periods for the action potential to reach the post-synaptic terminals and start the synapse process. Furthermore, cells with bigger sizes of soma may take more time and amount of stimuli to reach threshold for action potential initiation (Sengupta et al., 2013), thus, also FIGURE 5 | (A) Schematic of circuits A, B, and C and (B) The connection of AND gates in cascade to circuit A. A1 refers to the arrangement described by a single AND gate connected to the output of the circuit A and A2 refers to another AND gate connected to the output of A1 arrangement, i.e., two AND gates in cascade with circuit A. Analogous nomenclature is employed for both circuits B, as in B1/B2 and C, as in C1/C2. affecting the way a neuronal logic gate would work regarding a specific morphological neuronal type. For that reason, it is safe to keep two cells fixed as inputs (as illustrated in Figure 1) and then deploy an arrangement with which its performance has been previously assessed, allowing us to be fairly certain about how the synthetic gate or circuit should behave. Each neuron is represented by a block, W i (s) for the i-th neuron, and its representation in the frequency domain is proposed in Equation (35) and further detailed in section 2.3.2.

Compartmental Modeling
Neurons are very complex structures with numerous ramifications and several factors that contribute to their highly non-linear dynamism. Aiming to make the comprehension of such a complex electrical behavior easier, one employs a widely used technique called "compartmental modeling." Since different neurons have different morphologies, the mechanism of determining the number of compartments will be based on estimating the length of a specific neuronal structure. For instance, a varying length of axon, which will reflect in different quantities of compartment in series, where we will have a fixed size for each segment of the axon representing one compartment. This is a very natural and elegant way to model dynamic systems as multiple interconnected compartments where each compartment is described by its own set of equations, carrying the influence of one compartment to the next reproducing the behavior of the whole neuron.
Observing the neuron as a set of compartments described by transfer functions equivalent to that of (35), the neuronal morphology of a pyramidal cell, as illustrated in Figure 6A, (or any cell for that matter) can be modeled as an electrical circuit as shown in the topology of Figure 6B; the dendritic ramifications are modeled as a combination of serial and parallel connections terminating in the soma which is connected to the axon modeled as a series of compartments; its interpretation in terms of filtering is given in Figure 6C. The effect of a serial connection of two compartments is one of set-intersection when observed in the frequency domain: two bandpass filters in series pass only the frequencies that exist in both of their passbands. On the other hand, a parallel connection has a set-union effect, a parallel connection of filters will pass all the frequencies in both their passbands. As such, a large network (tree) of such compartments with similar bands combined in a cell, and cells combined in a group of cells will exhibit asymptotic bandpass behavior as well.
Every single compartment, each represented by one transfer function, is grouped in trees of three cells (Figure 1) forming a logic gate; the three gates are connected into a tree of their own, as illustrated in Figure 5A, forming a logic circuit. All of the cells are represented with the same form of the transfer function, . . . , 9 (36) with symbols defined previously, and a new parameter ζ i describing the synaptic weight for the ith cell; ζ i acts as a tunable gain for the neurons. Using the parameters from (Mauro et al., 1970) aiming to keep them within the physically sensible orders of magnitude, we obtain the reference values ofγ = 0.0024,λ = 119,C = 1 andζ = 1, and the values for 9 cells were generated multiplying these reference values by a uniformly distributed random variable in the range (0, 1). This kind of distribution is widely used to describe experiments where an arbitrary result should lie between certain boundaries, and in our case boundaries are defined by reasonable orders of magnitude around values made available by previous studies; keeping exactly the same parameters for all cells in the cascade is not realistic. The total transfer function of this system is and its frequency response (Bode plot) for the relevant range of frequencies in our applications (Wilson et al., 2004) is shown in Figure 7B.
Let us now observe three cases concerning the choice of ζ i values. In the first case, we keep all of them at unity and consider it our base case for this part of the analysis (and to keep it aligned with the rest of the paper, we call it Circuit B). In the second case, we double the values of ζ 3 and ζ 6 , which corresponds to the manipulation of the output cell for the two input gates in Circuit A. In our linear model, this is equivalent to doubling ζ 9 and leaving everything else intact. Finally, in the third case, we manipulate the output cell of the last gate by halving its synaptic conductance (Circuit C). This effectively means that the three cases are ζ 9B = 1, ζ 9A = 2, and ζ 9C = 1/2, respectively. Since the tunable gain ζ 9 of the gate W 9 , is the tunable gain of the whole system W according to (37), its change would offset the frequency response along the ordinate axis, i.e., lower gains (lower conductance) would suppress the unwanted frequencies in a better way, while higher gains would do the opposite. This is demonstrated in Figure 7A. The process of the analysis is summarized in Algorithm 1 and a summary with all elements from both the original and linearized versions of the Hodgkin-Huxley as well as the transfer function model is presented in Table 2.
Alternatively, as we suggested earlier, a single transfer function of a compartment serves as an approximation of the entire system due to the effects of repeated bandpass filtering in Figure 6C. In such case, we observe 20 dB/decade slope in the Bode plot shown in Figure 7A (as compared to 80 dB/decade slope in Figure 7B) and the same offset of 20 · log 10 2 ≈ 6 dB in case of halving/doubling the synaptic weight. Since the filter is of a band-passing nature, it is only natural that, around the resonant frequency, lower and higher frequency amplitudes should be ideally attenuated toward zero. Thus, it is worth mentioning that in both cases depicted here, the part of the frequency response with the cusp is at very low frequencies, so it is not visible in the relevant part of the spectrum. As such, the filter behaves as a low pass filter for all practical considerations.

RESULTS
In this section, we discuss the simulation results concerning the reconfigurable logic gates as well as the circuits. For all simulations, intrinsic parameters of the cell were kept at their default values (such as the length and diameter of each of their compartments) meaning that nothing concerning their morphological properties was changed, the spike trains fed to the input of the circuits followed a Poisson process and the threshold for spike detection and data analysis was 0 mV where any potential higher than that in a specific time slot would be considered a bit "1, " characterizing the use of a simple On-Off Keying (OOK) modulation which was implemented where a spike is considered as a bit "1" and its absence a bit "0" in each time slot. The cell models and information on their respective connection probabilities between different pair of

Algorithm 1 | Linear model filter analysis
Initialize:  neurons were obtained from the work of Markram et al. (2015), and then we used NEURON and Python for simulation and data analysis (Carnevale and Hines, 2009;Hines et al., 2009). The source-code of our simulations is publicly available on a GitHub repository 1 .

Reconfigurable Logic Gates
In this work, we call "reconfigurable" logic gates, the gates that work by changing the synaptic weight between the connections of both input cells with the output cell in a neuronal logic gate structure. Aiming to measure individual gate accuracy, the spike trains in the inputs were randomly produced but we control their frequency variation, in other words, for each simulation, the frequency at all inputs was the same and any change in the frequency was performed for all inputs of the gates meaning that none of the simulations account for different frequency values between different inputs in a single simulation. The accuracy is a simple but powerful measure for the performance of the gates, with which we intend to analyze the effects of the dynamics of the cell on the output of the circuit when comparing this output with the ideal response of the circuit derived from its truth-table. The accuracy is calculated according to the following equation (Hanisch and Pierobon, 2017): resembles the conditional probabilities in a binary symmetric channel (BSC). Thus, P 0,0 = 1 − P 1,0 , and P 0,1 = 1 − P 1,1 . It is possible to calculate P 1,1 , for instance, by counting the number of bits there are for each input-output combination.
In other words, considering #B i,j the number of times a bit i was received when bit j was sent knowing that i & j ∈ {0, 1}, then P 1,1 = #B 1,1 /(#B 1,1 + #B 0,1 ). Given the objective of obtaining a behavior similar to an OR gate, the synaptic weight should be set to 0.06 µS, meaning that the pre-synaptic stimuli will drive a higher influence on the depolarization of the post-synaptic cell. On the other hand, for an AND behavior, the weight is set to 0.03 µS, which reduces the influence of a single spike and look to a response of the postsynaptic neuron only when two spikes arrive very close to each other in terms of time. This is conducted so we have acceptable levels of accuracy when compared to the expected outputs of the gate. Figure 8 show similar responses when gates originally built to be of a specific kind. This means either OR or AND gates can change their configurations that drives their gating capabilities by modifying the synaptic weight between the connections of the input cells and the output cell. Although there is quite a visible difference between the performance of AND and OR gates, even at high frequencies (150 Hz), the accuracy of the reconfigurable logic gates remains above 80%.

Neuronal Logic Circuits
Once the reconfigurable behavior of the gates is assessed, they are connected to other gates to form a logic circuit. The performance is measured employing a ratio (frequency response), i.e., the number of spikes (bits "1") in the output divided by the nominal input frequency, in Hertz. This ratio is also known as the magnitude, or gain when evaluating the data in decibels. Following the approach for individual gates, the inputs are random and the frequency is increased uniformly. Since the gates showed similar accuracy when increasing the input frequency, we picked the one analyzed in Figure 8A for our circuit analysis with a reconfigurable logic gate, modifying only the output gate's synaptic properties. Figure 9A show the results for the circuits in Figure 5A. As expected, Circuit C has a stronger attenuation of the signals passing through it, and this is mainly due to the fact it is an arrangement with three AND gates and, based on the truth table, an AND gate only responds to stimuli if all its inputs are active at the same time. The magnitude in decibels shown in Figure 9B follow a standard presentation of the response of digital filters.
In the non-linear case of the system, the filtering is even better than what the linear model would promise, i.e., the suppression of unwanted frequencies is better due to superexponential decay. Let us compare Figures 7B, 9B. The linear model suggests that a constant difference of 6 dB is to be expected if the synaptic weight of the output cell is halved (or doubled), and a linear, constant amplitude drop. In the nonlinear model, we do observe a 20 dB/decade drop and 6 dB difference at relevant frequencies, but instead of a linear trend, we observe a convex response, which  helps in attenuating high frequencies faster than we would expect from the linear model. This is because the linear model is accurate in a neighborhood of the point at which it was linearized. Now, let us consider H(ν) as the response of an ideal low-pass filter, and W(ν) the response of the proposed neuronal filter, the counter-efficiency of W given H is calculated as where ν c is the cut-off frequency and ν f is the last evaluated frequency (in this relationship, the lower the value, the more efficient the filter is). Since, in terms of magnitude, a frequency band when cut by an ideal filter should be attenuated toward negative infinity (−∞), we have to pick a limit for the calculation of the area under the curves. In our case, after a visual inspection, the baseline for calculation chosen was −25 dB, because this is the closest integer value to the lowest values of magnitude. Figure 10 depicts the counter-efficiency analysis performed for the three circuits. As it is shown, for different frequency bands we have some circuits performing better than others. Also, each circuit has a preferable frequency band for achieving maximum efficiency. For frequencies lower than or equal to 80 Hz, Circuit C seems the most efficient, especially at 60 Hz, while frequencies around 100 Hz show Circuit B as the most efficient which is also the band where it performs the best. Circuit A, on the other hand, has its best performance for 120 Hz, and probably for higher frequencies as well if the trend continues.
This shift in performance may allow us to control which type of circuit we want to activate inside the brain depending on which activity the subject is performing at the time, e.g., being awake or being asleep. These changes may be induced by the intake of specific drugs that alter synaptic properties in a neuronal connection. Figure 11 shows a parallel analysis between the magnitude in dB and the accuracy of the filters with AND gates in cascade. Each circuit is identified by a pair of characters, the first is the letter referring to the circuit analyzed, the second is how many AND gates were connected in cascade. For example, A2 means Circuit A with two AND gates in cascade, as illustrated in Figure 5B.
The results suggest that, by increasing the number of gates in cascade, we have to deal with attenuation in the network due to FIGURE 10 | Counter-efficiency of the circuits when compared to ideal filters (the lower the value, the better the filter's performance). propagation caused by specific characteristics of the cell, such as the connection probability; hence, the more gates in cascade the worse the performance of the circuit. Also, even though the ratio keeps going downwards, at some point, the accuracy will start to shoot up. With careful evaluation, the dip in the accuracy along mid-range frequencies is very low in terms of scale, showing a difference of only around 0.03 on the values of accuracy.

DISCUSSION
Synaptic weight plays a role in the influence of the pre-synaptic stimuli and its impact on the post-synaptic neuron and has a value proportional to the synaptic conductance (Gardner, 1989) which is driven by the amount and type of neurotransmitters that are being bound to the post-synaptic terminals. The higher the connection probability between pairs of neurons, the stronger the influence of a specific synaptic weight. This is due to the proportional relationship that the weight has with each synaptic connection that individually releases a certain amount of neurotransmitters, hence, different neuron types may affect the influence of a fixed value of synaptic weight. This explains how the accuracy values fluctuate between different types of gates and circuits as shown in Figure 11. Within a larger network spatial dimension, the types of neurons may drive a higher accuracy fluctuation since the network connection exhibits different synaptic weights between each other.
With our model, we have mainly investigated the attenuation on the spiking frequency for three different types of circuits in which we decrease the number of OR gates by replacing them with AND gates. We were also able to have the fine-tuning synaptic properties showing a difference of around 5 dB in performance between the curves in Figure 9B. Changes in the synapse are also considered (Vogels and Abbott, 2005), either by strengthening or weakening specific synaptic connections, logic gates were built within a homogeneous network of integrate-andfire neurons. Moreover, the experiments conducted by Goldental et al. (2014) followed a procedure that enforced stimulations on neuronal circuits within a network of cortical cells in-vitro and they do propose other types of gates such as XOR and NOT. Furthermore, we increased the number of AND gates in a cascade-like manner in order to confirm that the longer the line of cascade gates, the more attenuated the signal should be if none of those elements receives any kind of external stimuli despite the spike coming from the circuit, and this result is depicted in Figure 11. A peak value in the difference of around 8 dB occurs in Circuit A, decreasing to around 5 dB in Circuit B and there is a small difference in Circuit C. The transfer function derived from the Hodgkin-Huxley linear model suggests a bandpass behavior of the system (Plesser and Geisel, 1999) for very low frequencies leaving us with a low-pass filter acting on higher frequencies ranging from 5 to 150 Hz. Considering the time for a spike to be fired that comprises depolarization, repolarization, and refractory period, higher frequencies will lead to saturation and non-realistic behavior of neuronal firing.
Our results, therefore, suggest that neuronal logic circuits can be used to construct also digital filters, filtering abnormal high-frequency activity which can have many sources including neurodegenerative diseases. A metric of counter-efficiency was also proposed, which should show how far apart the real results are from the ideal cases. We found that frequency bands were found to be of optimal value for different types of circuits such as 60 Hz for circuit C, 100 Hz for circuit B, and 120 Hz for circuit A, as shown in Figure 10. Based on the presented results, we demonstrate that by reconfiguring the gates inside the digital filters we can shift the intensity with how we attenuate the spiking frequency allowing an on-the-fly adaptation of the filtering tasks depending on the activity that is being performed by the subject where, for instance, circuit C should outperform both A and B for frequencies lower than or equal to 80 Hz.
The envisioned application of the proposed mathematical framework is for in-silico pharmacology and how it can be used to provide advanced prediction supporting computational strategies to test drugs. Since drug design and discovery in neuroscience are very challenging, especially due to the complexity of the brain and the significant impediment of the blood-brain barrier (BBB) imposes on the delivery of therapeutic agents to the brain. The success rate for approval by competent authorities of such drugs is <10%. Such a low rate is attributed not only to factors related to the disease itself, such as complexity, slow development, and gradual onset but also, to the limited availability of animal models with good predictive validity and the limited understanding of the biological side of the brain (Geerts et al., 2020). The system model derived from a set of coupled neuron compartments can help push forward the design of these neuronal filters and provide a platform for in silico drug-induced treatments on top of engineered biological models of neurons. A platform that could lead to cost-effective drug development and analysis of potential bio-computational units capable of enhancing signal processing in the brain, as well as predicting long-term effects of using a specific drug are potential uses of the proposed mathematical framework.

CONCLUSION
In this work, we proposed a reconfigurable spike filtering design using neuronal networks that behave as a digital logic circuit. This approach requires the cells to be sensitive to modifications through chemicals delivered through several proposed methods available in the literature. From the Hodgkin-Huxley action potential model we developed a mathematical framework to obtain the transfer function of the filter. This required a linearization of the Hodgkin-Huxley model that changes the cable theory simplification for each cell compartment. To evaluate the system, we have used our transfer function as well as the NEURON simulator to show how the frequency of operation, logic circuit configuration as well as logic circuit size can affect the accuracy and efficiency of the signal propagation. We observed that all-ANDs circuit produces more accurate results concerning their truth-table when compared to all-ORs. In addition, the results show that each digital logic circuit is also reconfigurable in terms of cut-off frequency of the filter, by manipulating the types of gates in the last layer of the circuit.
We believe the proposed filter design and its mathematical framework will contribute to synthetic biology approaches for neurodegenerative disorders such as epilepsy, by showing how the control of cellular communication inside a small population can affect the propagation of signals. For future work, we plan the use of non-neuronal cells, e.g. astrocytes, for the control of gating operations and the assessment of neuronal filtering capabilities at a network level. Treatment techniques based on this method can be a radical new approach to reaching precision and adaptable outcomes, inspired from electronic engineering as well as communication engineering. Such techniques could tackle at a single-cell level, neurons affected by seizure-induced highfrequency firing or bypass neurons that have been affected by a disease-induced neuronal death and degeneration, thus keeping the neuronal pathway working at a performance as optimal as possible.

DATA AVAILABILITY STATEMENT
The original contributions presented in the study are included in the article/supplementary material, further inquiries can be directed to the corresponding author/s.

AUTHOR CONTRIBUTIONS
GA performed the simulations and wrote the manuscript. HS performed the control-theoretic analysis. GA, HS, and MB performed the data analysis. SB, NM, MB, and MW led the work development. All authors contributed to manuscript writing and revision. All authors also have read and approved the submitted version.