Cochlea-inspired design of an acoustic rainbow sensor with a smoothly varying frequency response

A number of physical arrangements for acoustic rainbow sensors have been suggested, where the aim is to separate different frequency components into different physical locations along the sensor. Although such spatial discrimination has been achieved with several designs of sensor, the resulting frequency responses at a given position along the sensor are generally not smoothly varying. In contrast, the cochlea provides an interesting natural example of a rainbow sensor, which has an exponential frequency distribution and whose response does vary smoothly with frequency. The design of a rainbow sensor is presented that has a number of discrete resonators and an exponential frequency distribution. We discuss the conditions for a smoothly varying frequency response in such a sensor, as part of a broader design strategy. It is shown that the damping within the resonators determines the trade-off between the frequency resolution and the number of elements required to achieve a smooth response. The connection is explained between this design and that of an effective acoustic absorber. The finite number of hair cells means that the cochlea itself can be thought of as being composed of discrete units and the conditions derived above are compared with those that are observed in the cochlea.


cochlea-inspired design of an acoustic rainbow sensor with a smoothly varying frequency response Angelis Karlos * & Stephen J. elliott
A number of physical arrangements for acoustic rainbow sensors have been suggested, where the aim is to separate different frequency components into different physical locations along the sensor. Although such spatial discrimination has been achieved with several designs of sensor, the resulting frequency responses at a given position along the sensor are generally not smoothly varying. in contrast, the cochlea provides an interesting natural example of a rainbow sensor, which has an exponential frequency distribution and whose response does vary smoothly with frequency. the design of a rainbow sensor is presented that has a number of discrete resonators and an exponential frequency distribution. We discuss the conditions for a smoothly varying frequency response in such a sensor, as part of a broader design strategy. it is shown that the damping within the resonators determines the trade-off between the frequency resolution and the number of elements required to achieve a smooth response. The connection is explained between this design and that of an effective acoustic absorber. The finite number of hair cells means that the cochlea itself can be thought of as being composed of discrete units and the conditions derived above are compared with those that are observed in the cochlea.
Acoustic rainbow sensors consist of arrays of units of sub-wavelength dimensions, whose properties vary with position, which, through strong wave dispersion, can enhance and spatially separate different frequency components of incident acoustic waves 1 . The sub-wavelength dimensions of the unit elements of acoustic rainbow sensors and their strongly dispersive behaviour, which is not encountered in natural materials, classify them in the realm of acoustic metamaterials 2 .
For an acoustic rainbow sensor to be effective as a spectrum analyser, the frequency response at a given position needs to have the form of a band-pass filter with a peak at a certain frequency and without additional peaks within the working frequency range. Although several designs of acoustic rainbow sensor have previously been proposed, they generally do not have responses that vary smoothly with frequency, and therefore do not have an unambiguous peak in their frequency response. One-dimensional rainbow sensors consisting of narrow grooves of varying depth perforated in a rigid substrate have previously been presented 1,3 , using the quarter-wave resonance within the groove. In those designs, it was demonstrated both by simulations and experimentally that incident waves slow down and get amplified as they propagate along the system, until they reach a position, which is different for different frequency components, where they are trapped, beyond which they are greatly attenuated. However, the experimentally observed pressure envelope did not vary smoothly either with position or with frequency. A more compact system using coiled quarter-wave resonators was presented in 4 , but the frequency response in the resonators was not discussed. A two-dimensional system, similar to that in 1 but consisting of perforations of varying depth over a planar substrate, was presented in 5 . Viscous and thermal losses were included in the simulations, which predicted a smoother frequency response in terms of the acoustic pressure, although with some fluctuations with frequency.
A design consisting of a duct with an array of side branches of Helmholtz resonators with varying cavity volume was proposed by Zhao and Zhou 6 , where the coiling of the system was loosely based on the form of the cochlea. Simulations predicted the rainbow trapping effect, although again with significant fluctuations in the

Results
The properties of the passive cochlea can be reasonably well reproduced if one-dimensional fluid coupling is assumed, together with single-degree-of-freedom dynamics of the cochlear partition, with an exponential distribution of natural frequencies 13 . An entirely acoustic system can also be designed to reproduce the behaviour of the cochlea, consisting of discrete elements, provided that a sufficiently large number of elements is used. Such a system, consisting of a main duct of constant cross section with Helmholtz-resonator side branches of varying geometrical properties, is shown in Fig. 1a, where the input position is called 'the base' and the terminating position 'the apex' , by analogy with the cochlea. For the design of such a system, lumped-parameter acoustic modelling is used. A discretised Transmission Line approximation for an array of identical Helmholtz resonators is first used to obtain the wavenumber and from that, an approximate formula for the minimum wavelength in the waveguide. Formulas derived from this analysis are then used in the design of a system whose element dimensions vary with position, assuming that these vary relatively smoothly.
(a) (b) Fig. 1. Schematic of a cochlea-inspired acoustic rainbow sensor. (a) Longitudinal cross section along the midwidth plane of a system consisting of a square-cross-section duct of side w D , with side branches consisting of Helmholtz resonators of varying dimensions. The neck radius, a, and length, l a , are shown, along with the cavity volume, V H . Each element of the system consists of a duct segment of length l D and a Helmholtz resonator. The length and width of each cavity are the same as those of the corresponding duct segment, and the height of each cavity is denoted by h H . Formulas for the cross-sectional area of the duct, S D , and of the neck, S H , are shown, as well as for the volume of the cavity. The left and right ends of the system correspond to the base and the apex of the cochlea, respectively. (b) Circuit representation of an element of the system. Z 1 is the series impedance, consisting of the inertance of the duct, L D , and Z 2 is the shunt impedance, consisting of the duct compliance, C D , in parallel with an RLC branch representing the Helmholtz resonator, with resistance R H , inertance L H and compliance C H .
Scientific RepoRtS | (2020) 10:10803 | https://doi.org/10.1038/s41598-020-67608-z www.nature.com/scientificreports/ transmission Line analysis of an array of identical Helmholtz resonators. A system consisting of a main duct with an array of identical Helmholtz-resonator side branches is first considered, where each element of the system comprises a segment of the main duct of constant length l D and a side branch of a Helmholtz resonator. Such a system produces a 'slow wave' , that is, a wave whose propagation speed is smaller than that of an acoustic plane wave in a uniform tube, up to a frequency where the propagation speed becomes very small 14 . Above this frequency, there is a stop band, where the wavenumber is mainly imaginary. Beyond this, there is another pass band, in which waves propagate with a speed that approaches the speed of plane-wave propagation as frequency increases. These propagation characteristics will also be observed in the designed system below, although the aim of the current analysis is to provide a simple model of the wave propagation that can be used for design purposes.
Assuming that the dimensions of the components of an element are much smaller than the wavelength, an equivalent circuit with lumped parameters can be used 15 and the system can be analysed using Transmission Line theory, as presented for example in 16 . This assumption also ensures that only the fundamental mode within the duct can propagate in the considered frequency range. An equivalent circuit representation of an element of the system is shown in Fig. 1b, in which all the impedances are acoustic, that is, ratios of acoustic pressure to volume velocity. The element lumped parameters in Fig. 1b correspond to those of a finite duct length, whereas in classic Transmission Line theory, the lumped parameters of each infinitesimal segment of the waveguide represent inertances, compliances and resistances per unit length of the Transmission Line. Therefore, the ratio of each lumped parameter to the element length, l D , corresponds to the parameter per unit length used in Transmission Line theory.
The series impedance of each element is only due to the inertance of the duct segment and is denoted by Z 1 , whereas the shunt impedance, denoted by Z 2 , consists of the parallel combination of the compliance of the air in one section of the duct and the impedance of the Helmholtz resonator. The resistance, inertance and compliance of the Helmholtz resonator, as derived in the Supplementary material, are given by where l H is the effective neck length, S H is the neck cross-sectional area, V H is the cavity volume, ρ is the air density, c 0 is the speed of sound in air and α is the frequency-dependent loss coefficient. It should be noted that the effective neck length, l H , is larger than the actual neck length, l a , shown in Fig. 1a, since the former also includes end corrections, as explained below. The inertance and compliance of the duct are given by L D = ρl D /S D and C D = V D /ρc 2 0 , where V D = S D l D is the volume of the duct segment. Viscous and thermal losses are only considered in the neck of the Helmholtz resonator. It should be noted that the acoustic resistance, R H , depends on frequency. The element impedances can be expressed in terms of the lumped parameters, assuming an e iωt time dependence, as Z 1 = iωL D and Z 2 = Z C D Z H / Z C D + Z H , where Z C D = −i/ωC D and Z H is given by The Helmholtz resonance angular frequency, when iωL H is equal to −i/ωC H , and the corresponding quality factor are given by 17,18 , where the acoustic resistance is evaluated at the resonance frequency.
The wavenumber of the Transmission Line is given by 16 where ik corresponds to the propagation constant of the Transmission Line. The wavenumber in Eq. (3) corresponds to a wave travelling along the system as if it were a uniform Transmission Line. In other words, the duct with the array of identical Helmholtz resonators is transformed into a uniform acoustic waveguide, whose properties are smeared out so that they do not change with position. A cut-on angular frequency is also introduced, which forms the upper limit of the stop band, defined by and a second quality factor is defined as Q 2 = Q 1 ω 2 /ω 1 . By substituting the relations for Z 1 and Z 2 given above into Eq. (3), also using the expressions for ω 1 , Q 1 , ω 2 and Q 2 , the wavenumber takes the relatively simple form where k 0 = ω/c 0 . At very low frequencies, that is, for ω ≪ ω 1 , the wavenumber tends to the value k b = k 0 ω 2 /ω 1 , where the subscript b has been used in correspondence with the limiting behaviour at the basal end, as will be seen below, whereas at very high frequencies, for ω ≫ ω 2 , the wavenumber tends to that in free space, k 0 . For intermediate frequencies where ω 1 ≪ ω ≪ ω 2 , the wavenumber takes the form k ≈ −i/d , where d = c 0 /ω 2 is the exponential decay length, so that a stop band is formed between ω 1 and ω 2 , where waves do not propagate but are attenuated.
The wavelength of the wave propagating in the Transmission Line is given by = 2π/Re{k} , whereas the wavelength in free space is given by 0 = c 0 /f = 2π/k 0 . Assuming that the band gap is large, that is, ω 2 ≫ ω 1 , the wavenumber at the resonance frequency of the Helmholtz resonators takes the approximate form The wavelength reaches a minimum at a frequency which is close to the resonance frequency ω 1 , as will be seen below, and so is approximately given by For air in room temperature and a neck radius much larger than the viscous boundary layer thickness, the loss coefficient is approximately given by α ≈ 3 · 10 −5 f /Hz/a , where f is the frequency in Hz and a is the neck radius, so that if a is in metres, then α is in Np/m, as derived in the Supplementary material. Using this approximate formula for the loss coefficient and the expressions for R H , L H and Q 1 , the quality factor takes the simple approximate form where f 1 = ω 1 /2π is the resonance frequency in Hz, and a is the neck radius in meters.
The effective neck length, l H , is equal to the sum of its physical length, l a , and end corrections at both ends. For the inertance, these end corrections account for the mass of air outside the neck that gets accelerated by the air within it 19 , whereas for the resistance, the end corrections account for the additional loss as the air flows around the two ends of the neck 18 . For this design study, it is assumed that the end correction for the resistance is equal to that for the inertance. The end correction for a flanged end is approximately 18 0.85a, although more complicated formulas have also been proposed for a baffle of finite size 14 , presented in the Supplementary material, which are used in the simulations.

Design requirements and trade-offs for an acoustic rainbow sensor with varying Helmholtz
resonators. An acoustic system with Helmholtz-resonator side branches of varying dimensions can be designed by analogy with the varying stiffness and mass of the basilar membrane along the cochlea. The varying dimensions of the cavities of the Helmholtz resonators correspond to the variation of the stiffness and the varying lengths of the necks to the variation of the mass. The longitudinal inertia of the liquid in the cochlear chambers, which provides the longitudinal coupling, is accounted for by the inertia of the air in the main duct. If the dimensions are assumed to vary relatively smoothly between consecutive elements, the wavenumber of the system will be approximately given by Eq. (4), where now the wavenumber will also depend on position, since the resonance frequency, ω 1 , will now vary for the different Helmholtz resonators, and accordingly ω 2 , Q 1 and Q 2 will also vary with position. For a discrete system to accurately approximate a continuous waveguide, a minimum number of elements per wavelength along the direction of propagation has to be used, with a minimum of six elements per wavelength often applied, as for example in Finite Element Analysis 20 . In the system of a duct with an array of Helmholtz resonators, the condition of at least six elements per wavelength has to be satisfied for the minimum occurring wavelength. The decay length, defined as d = c 0 /ω 2 above, can also be written as d = l D √ µH/(1 + H) , where H = V H /V D , and µ = l H S D /l D S H is the ratio of the inertance of the Helmholtz resonator to that of the duct segment. The minimum wavelength given by Eq. (5) then takes the form min ≈ 2πl D √ 2µH/Q 1 (1 + H). In the cochlea, the tonotopic mapping of the local natural frequency of vibration of the basilar membrane with position can be approximated by 12 f n (x) = f B e −x/l , where f B is the natural frequency at the base and l is the lengthscale of the exponential decrease in frequency. If an equivalent discrete system with equally spaced elements is considered, then the natural frequency of the n-th element is given by f 1 (n) = f B e −(n−1)l D /l . A constant element length, l D , is assumed here to estimate the distribution of elements per octave. The number of elements per octave is calculated as the difference in the order of two elements whose natural frequencies are an octave apart, that is, N oct = n 2 − n 1 , where f 1 (n 1 ) = 2f 1 (n 2 ) . Using the discrete natural frequency variation above, the number of elements per octave is calculated as N oct ≈ 0.7l/l D .
A more meaningful expression for the appropriate number of elements per octave can be found by combining two requirements. First, the minimum wavelength as expressed in Eq. (5) can be conveniently set to be equal to min = 2πl D 6l D to satisfy the smoothness requirement, of at least six elements per minimum wavelength, so that the element length can be written as For a given Q 1 , Eq. (7) leads to a restrictive condition for the dimensions of the Helmholtz resonators in relation to the dimensions of the duct segment involved in the definition of µ , a condition which is used in the design procedure. The second requirement is that the number of cycles of phase shift should be approximately given by the non-dimensional phase-shift parameter introduced for the cochlea in 21 , and defined as N c = l/4d , which also defines the form of the frequency response 22 . Combining this expression with the result N oct ≈ 0.7l/l D for the number of elements per octave, also using the expression l D = d √ 2/Q 1 , gives a relation for the number of elements per octave, for a given N c and Q 1 , as Therefore, the estimation of an appropriate number of elements per octave stems from the smoothness requirement of sufficient elements per wavelength and from the required form of the frequency response.  (8) that, for a given N c , the choice of the damping in the resonators thus involves a tradeoff in the design between good frequency selectivity, provided by a narrow band-pass frequency response in the case of high Q 1 , and the number of elements required for a given frequency range to give a smooth response. The attenuation per octave in the stop band can also be calculated as where Eq. (8) and the relation l D = d √ 2/Q 1 have been used. Therefore, for a given N c , the required total attenuation within the stop band will define the width of the band gap. This will then impose a minimum value for H in the design, which is the ratio of the volume of the cavity to that of the duct, since ω 2 /ω 1 = √ 1 + H.
A design example. The phase-shift parameter is chosen to be N c = 2.5 , which is a good approximation for the phase shift in the human cochlea 12 . For this value of N c , Eq. (9) gives an attenuation in dB of approximately 60 dB/octave in the stop band. If it is assumed that an attenuation of 30 dB within the stop band is sufficient, then a band gap of at least half an octave should be used, that is, . This means that H ≥ 1 , which requires that the volume of a given Helmholtz resonator has to be larger than or equal to the volume of the corresponding duct segment.
The example system considered here is designed to work in the standard telecommunications band of 300 Hz to 3.4 kHz, which is about 3.5 octaves wide. Therefore, the basal and apical natural frequencies are set to be f B = 3.4 kHz and f A = 300 Hz. Assuming a neck radius of a = 0.5 mm for all the elements, to ensure a reasonable fidelity of manufacturing using conventional 3D printing 7 , the quality factor for the first and the last element are calculated from Eq. (6) to be Q 1,B = 17.5 and Q 1,A = 5.2 . The number of elements per octave, calculated by Eq. (8) with the respective values for Q 1 for the basal and apical elements, takes approximately the values 21 and 11. On average, it can be assumed that around 15 elements per octave are required, so that for the 3.5 octaves of the considered bandwidth, around 50 elements are required in total.
An effective neck length of l H = 1 mm is assumed for the first element, which, using the relation for ω 1 and the relations V H = Hl D S D and µ = l H S D /l D S H , along with Eq. (7) with the minimum required value H = 1 , defines the values for the length, l D , of the first element and for the cross-sectional area of the main duct, S D . The side of the square-cross-section duct, which is constant throughout the system, is then calculated by w D = √ S D . An exponential variation of the resonance frequencies of the Helmholtz resonators is defined, by analogy with the cochlea, as f 1 (n) = f B (f B /f A ) (1−n)/(N−1) , which also defines the respective quality factors according to Eq. (6). Using the same relations as for the first element along with the defined resonance frequencies and quality factors, the element length, l D (n) , and the effective neck length, l H (n) , of the other elements can be calculated by l D (n) = √ 2/(1 + H)Q 1 c 0 /ω 1 and l H (n) = √ (1 + H)Q 1 /2c 0 S H /ω 1 HS D . Table 1 indicatively shows the parameters for the first, 25th and 50th element for this design example. The design procedure is illustrated as a flow chart in Fig. 2.

Simulations.
A set of results for the design example with 50 elements is presented here, analysed using a distributed-element Transfer Matrix method. This is a more accurate model than the lumped-parameter approach used for the design, since it accounts for wave propagation within the elements, and also includes losses in the main duct and in the cavities, and is used to provide an independent check on the assumptions made in the design process. The input of the system is a harmonic volume velocity of constant amplitude 2 · 10 −7 m 3 s −1 at the left side of the first element. A matched load is assumed as the termination of the main duct, although results presented in the Supplementary material show that this is not essential.
Wavenumber and acoustic pressure. The real and imaginary parts of the wavenumber calculated using Eq. (4) are plotted against position, for a frequency of 1 kHz, and against frequency, for the 26th element, in Fig. 3a, b, respectively. At basal positions and lower frequencies, the wave propagates with a purely real wavenumber whose value tends to k b = k 0 ω 2 /ω 1 , which is larger than k 0 and therefore corresponds to smaller propagation velocity, plots for which are included in the Supplementary material. At apical positions and higher frequencies, the wavenumber is again purely real but tends to the free-space wavenumber, k 0 . Between these two pass bands defined by the resonance frequency, f 1 , of a given element and the corresponding cut-on frequency, f 2 , a stop band can be seen where the imaginary part of the wavenumber has large negative values so that the waves are attenuated. A spatial region of evanescence also occurs beyond an element which is basal to the element of resonance for a given frequency, as can be seen in Fig. 3a. In the stop band, the imaginary part of the wavenumber is seen to be of the order of − 1/d , as presented above. Even though the stop band is not wide enough for any extended (9) Att oct = e −N oct l D /d ≈ e −2.8N c , Table 1. Design parameter values of the acoustic rainbow sensor. Main parameter values of the first, 25th and 50th element of a system with an array of 50 Helmholtz resonators of varying dimensions. The neck radius is a = 0.5 mm and the duct width is w D = 7.3 mm for all the elements. www.nature.com/scientificreports/ frequency range to satisfy the condition ω 1 ≪ ω ≪ ω 2 , and therefore the imaginary part of the wavenumber only has the value − 1/d close to the middle of the stop band, this still provides a reasonable approximation for the average value along the band. Figure 4a shows the predicted variation of the modulus of the acoustic pressure along the waveguide calculated using the Transfer Matrix method, both at the top of the cavities in the resonators and in the main duct, plotted against the element number, n, for three different frequencies. It can be seen that the pressure in the resonators builds up smoothly along the waveguide, reaching a peak at a different element for different frequencies, after which it decreases rapidly, with lower frequencies peaking at apical positions and higher frequencies peaking at basal positions. This pattern for the pressure in the resonators closely resembles the coupled response of the cochlea in terms of the transverse velocity of the basilar membrane 12 . The pressure in the duct, plotted in dotted lines, decreases slowly up to the position where the pressure in the resonators peaks, beyond which it also rapidly decays, which is similar to the variation of the pressure difference across the basilar membrane, as can be seen for example in 23 . These results justify the correspondence of the side branches with the basilar membrane and of the main duct with the fluid-filled cochlear chambers.
The modulus of the pressure is also plotted against frequency in Fig. 4b for three different elements. It can be seen that within the frequency range defined by the basal and apical resonance frequencies, that is, between 0.3 kHz and 3.4 kHz, the pressure in the resonator of a specific element smoothly increases and peaks at a specific frequency, with basal elements peaking at higher frequencies and apical elements peaking at lower frequencies, similarly to the cochlea 12 . The peaks of the resonator pressures occur at lower frequencies compared to the corresponding resonance frequencies, denoted by the grey vertical dashed lines, due to the presence of damping. At lower frequencies, damping is more prominent, since the quality factor is smaller towards the apex, and also the wave passes through more elements which results in more losses. Therefore, for the 40th element, the peak of the response appears to be low, as is also seen for the lower-frequency plot in Fig. 4a. The fluctuations that appear in the frequency response at the lower part of the shown spectrum are outside the working frequency range.
The phase of the pressure is plotted against the element number and against frequency in Fig. 4c, d. The phase variation up to the response peak is also similar to that in the cochlea 12 . The larger phase shift at positions or www.nature.com/scientificreports/ frequencies beyond the peak is less important, since the response has already decreased to very small values there. The fact that at higher frequencies the phase shift from base to peak is less than that at lower frequencies, also observed in the cochlea 12 , may be attributed to the fact that it takes a considerable number of elements for the phase to accumulate, which is prevented at high frequencies by the small number of elements involved. It is seen in the phase plots that the phase-shift parameter, N c , which has the value 2.5 in this design, only approximately corresponds to the phase shift up to the peak. The obvious similarity of the coupled response with respect to the element number, n, and with respect to logarithmic frequency observed in both the modulus and phase plots is similar to the 'scaling symmetry' in the cochlea 24 . It should be noted, however, that since Q 1 depends both on frequency and neck radius, according to Eq. (6), and the neck radius is assumed to be constant, then Q 1 varies with the natural frequency of the element in this design. This means that this design does not exactly satisfy www.nature.com/scientificreports/ scaling symmetry, as illustrated in the plots of the response against non-dimensional quantities in Fig. S7 in the Supplementary material. The stop bands for the three different elements are illustrated in Fig. 4b, d by shaded areas of corresponding colours. For the 40th and 26th elements, the response is seen to decay rapidly and little phase shift occurs within the stop band. Beyond the stop band, there is a second pass band, as shown in the wavenumber frequency variation in Fig. 3b, which leads to further phase shift of the response in Fig. 4d. The modulus of the response in Fig. 4b continues to decrease in the second pass band, albeit at a slower rate compared to in the stop band. For the basal element n = 12 , an inversion of the phase is observed in the stop band and slightly beyond that. This, however, corresponds to a very low response modulus and is therefore not expected to have any significant effect. Secondary peaks appear beyond about 4 kHz, outside the working frequency range, which are also significantly lower than the primary response peak.
The pressure modulus plots in Fig. 4a, b predict that the designed system can be used as an acoustic rainbow sensor, where different frequency components are filtered at different positions, since each element acts as a bandpass filter with a smooth frequency response centred at a different frequency. Therefore, the different frequency components can be captured by introducing small microphones in the cavities of the Helmholtz resonators, as was done in a system with quarter-wave resonators in 10 .
Variation of the number of elements. Figure 5a, c, e show the pressure in the resonators for different values of the total number of elements, N, at frequencies 500 Hz, 1 kHz and 2 kHz, respectively, plotted against the element number, n, normalised by the total number of elements in each case. Figure 5b, d, f show the corresponding frequency response for the elements whose resonance frequencies are the closest to 500 Hz, 1 kHz and 2 kHz, respectively. For all the different values of N, the first and last element of the system are the same, as given in Table 1, based on the chosen working frequency band, and the intermediate elements are scaled accordingly. In Fig. 5d, the smoothness of the frequency response begins to break down when there are 30 elements, and fluctuations in the frequency response are apparent with 20 elements in all cases. It can also be observed that more elements give more suppressed peaks, due to the presence of more overall damping in the system, which is dominated by the necks of the Helmholtz resonators.
Absorption. The absorption coefficient, A, defined as the ratio of absorbed to incident power, as presented in the Supplementary material, is plotted against frequency in Fig. 6. It can be seen that for N = 50 , incident waves are primarily absorbed within the region defined by the lowest and highest resonance frequencies, as seen from the part of the plot above the 0.9 line, which implies that the waves are neither reflected nor further transmitted. Therefore, the smooth response of the rainbow sensor, which requires that waves are concentrated at certain elements for different frequencies without reflections and without further transmission, also ensures that the system performs as an acoustic absorber with approximately uniform broadband absorption. It can be seen that using less than 50 elements produces fluctuations of the absorption coefficient with frequency, and that using less elements generally reduces the absorption.

Discussion
A new set of design principles for an acoustic rainbow sensor has been presented, which is predicted to provide a smooth frequency response, similar to the cochlea. The system consists of a main duct with side branches of Helmholtz resonators whose dimensions vary along it, and whose main design characteristics are based on the characteristics of the cochlea. Such a system enhances and absorbs incident waves at different positions for different frequencies, and can therefore be used as an acoustic rainbow sensor, that is, as a spatial spectrum analyser. The designed rainbow sensor also behaves as a broadband acoustic absorber, with different frequency components being absorbed around their corresponding peak positions. The design procedure revealed that, for a given value of the phase-shift parameter, a compromise between the number of elements and the damping has to be made to achieve a desirable frequency selectivity. If too few elements are used, this gives rise to unevenness in the frequency response, as seen for example in 1,3,5 . Although quarter-wave resonators were used in 10 , rather than Helmholtz resonators, the equivalent criterion for a smooth frequency response is found to be satisfied for their passive system, but not for their active system. The ripples observed in the measured response are thus likely to be due to the discrete nature of their implementation, as opposed to an inherent feature in the real cochlea.
By drawing an analogy between the rainbow sensor presented above and the cochlea, the compliance of the air in the main duct of the rainbow sensor corresponds to the compliance of the fluid in the cochlear chambers, while the compliance of the resonator cavity corresponds to the compliance of the basilar membrane. In the rainbow sensor, the upper limit of the stop band is given by f 2 = f 1 √ 1 + C H /C D . This leads to a stop band of limited bandwidth, determined by the ratio of the compliance of the air in the resonator cavity to that of the air in the main duct, which are in general of comparable size, and chosen to be equal in the design example above. In the cochlea, however, the fluid in the chambers is generally considered to be practically incompressible 12 , which corresponds to a vanishing fluid compliance, and therefore leads to an infinite bandwidth for the stop band. In this case no upper pass band would occur in the cochlea 12 .
There are around 3,000 rows of sensory, inner hair cells, approximately uniformly distributed along the human cochlea, which could be considered as the discrete elements of a Transmission Line. The audible spectrum for young people is around 10 octaves 25 , leading to about 300 elements per octave. In the passive cochlea, the local resonance quality factor is around 13 2.5, which, according to Eq. (8), gives a minimum requirement of only about 8 elements per octave. Even if a higher value of, for example 21 , Q 1 = 50 is used to approximate the behaviour of the active cochlea, due to the outer hair cells, with single-degree-of-freedom basilar membrane dynamics, the required number of elements per octave is found to be about 35. This is still much smaller than the 300 elements   www.nature.com/scientificreports/ per octave present in the human cochlea. Using the nominal values N oct = 300 and N c = 2.5 for the cochlea in Eq. (8) also gives a maximum value for the quality factor to ensure that at least six elements per wavelength are present as Q 1 ≤ (N oct /2N c ) 2 = 3600 . This suggests that extremely low values of damping would be required for reflections to occur inside the cochlea from the discontinuities of consecutive elements if their parameters are smoothly varying. In practice, however, reflections are thought to be generated by the roughness in the variation of these parameters, giving rise to certain forms of otoacoustic emission 25,26 .

Methods
The system shown in Fig. 1a can be analysed using Transfer Matrices 7 , where each element, consisting of a duct segment and a side branch, is represented as a two-port network with a Transfer Matrix T n . The pressure and volume velocity at the input of an element can be expressed with respect to the corresponding quantities at its output either explicitly or compactly as 15 where v n is the state vector of the n-th element. The N-th element can be expressed with respect to the state variables at the termination as v N = T N v end , where v end = [p end q end ] T , and p end and q end are the pressure and volume velocity at the termination of the system. By iteratively substituting the lower-order vector by its relation with the vector of the next element using Eq. (10), the first state vector can be expressed with respect to the last one as v 1 = Tv end , where T = T 1 T 2 . . . T N−1 T N is the total Transfer Matrix and v 1 = [p in q in ] T , where p in and q in are the pressure and volume velocity at the input. Given the input volume velocity, q in , along with the termination impedance, Z end = p end /q end , the other three state variables, that is, p in , p end and q end , can be found by solving the matrix equation v 1 = Tv end along with the expression for Z end . The pressure and volume velocity at the input of each element can be calculated once p end and q end are found, by iteratively applying Eq. (10) starting from the last element. The pressure in the resonators can then be calculated with expressions given in the Supplementary material. Detailed formulas for the Transfer Matrices, as well as formulas for calculating the absorption coefficient, are given in the Supplementary material.