OMK Logo
OMK Title

Patch-a-Week

Week 33

When reading the Chimaera firmware documentation, one might wonder on how the underlying raw sensor signals and the interpolated event signals actually look like. This is what this patch-a-week is all about.

Raw sensor readouts

The data underlying the following two graphs are raw ADC readouts and were captured from a Chimaera S96. The ADCs of the Chimaera have 12-bit resolution with a range of [0, 4095]. As the linear hall-effect sensors both measure north and south polarized magnetic field strengths, the device writes out a signed 11-bit range of [-2048, 2047]. The ADC readout was accomplished with no magnetic source present and therefore represents quiescent output. It can nicely be seen, that the quiescent output of each sensor varies along the sensor array due to sensor manufacturing. The standard deviation of the raw ADC readout is at its best with 1/4095 = 0.024%.

The standard deviation or jitter depends on the moving average window. The latter is set to 8 by default. It can be changed via the configuration hook /sensors/movingaverage.

bla bla
Left: Mean of raw ADC readout of quiescent output with a moving average window of 8 over N=3000 samples. Right: Standard deviation for the latter.

Interpolated position signals

To derive continuous position signals from the raw ADC readouts along the sensor array, we can apply interpolation curves of differing orders. You can read up on the involved math in the firmware documentation.

Below, we present the interpolated positional signals when (1) no interpolation, (2) cubic and (3) Catmull-Rom spline interpolation is applied to the raw sensor data. For each interpolation method, we show the derived position signals (x, z) for the same magnet sweep pattern: We swept a single magnet source left to right at vicinity=0.25, from right to left at vicinity=0.5, from left to right at vicinity=0.75 and finally from right to left at vicinity=1.0. We show separately interpolated x-dimension and z-dimention over the sweep pattern and a combination of both. Additionally, we show the distribution of the x-dimension bit depth over the whole sweep pattern.

The measurements were again taken from a Chimaera S96.

No interpolation (order=0)

With no interpolation, the 'interpolated' signal just reflects the underlying normalized (not raw!) sensor readouts. The x-dimensional position signal thus is stepped (zoom in on the graphs, they are scalable vector graphics (SVGs)). The z-dimensional signal also fluctuates in a step-wise fashion.

The bit-depth of the x-dimension is fixed and dependent on sensor number N: $$\begin{eqnarray} xbitdepth(N) &=& \frac{log(N)}{log(2)} \\ xbitdepth(96) &=& 6.585 \end{eqnarray}$$

This obviously is not good enough for a continuous controller, as the signals involved are not continuous. Nevertheless, in some cases it can be useful to have access to this kind of data to do some per-sensor sound synthesis.

bla bla
bla bla
Not interpolated positional signals of x-dimension, z-dimension, z- vs x-dimension and bit-depth of x-dimension.

Quadratic interpolation (order=2)

With quadratic, aka hyperbolic interpolation, always 3 adjacent sensor values are considered to derive the positional signal. As can be seen in the graphs (zoom in), the x-dimension over the sweep is smoothly resolved with a bit-depth of 12.87±0.63(SD) corresponding to 7486 distinct values over 96 sensors. We use the Chimaera most of the time in a configuration where 3 sensors are mapped over one semitone (100 cents). Like that, this Chimaera S96 with quadratic interpolation can resolve down to 0.43 cents in average, way below the just-noticeable difference of humans and more than adequate for use as a continuous controller.

Also the z-dimension gains a lot from the quadratic interpolation, but not at all vicinities. The two vicinities in the center (0.5, 0.75) gain most in terms of a smoothing of the signal compared to no interpolation. The far vicinity (0.25) gains a lot, too, but not as much as the two center ones which is due to the nonlinearity of the distance-magnetic field relationship of permanent magnets. The nearest vicinity (1.0), however looks equal to the case with no interpolation. This is expected, as this vicinity, the magnet is just above the linear hall-effect sensors and a smoother interpolation could only be gained by reducing the spacing of the linear hall-effect sensors (and increasing material costs). As the center vicinities are those that are played by far the most, the inter-sensor distance has actually been optimized for just that fact to the current 5mm.

bla bla
bla bla
Quadratic interpolated positional signals of x-dimension, z-dimension, z- vs x-dimension and bit-depth of x-dimension.

Catmull-Rom spline interpolation (order=3)

The Catmull-Rom splines always take 4 adjacent sensor values into account to derive both x- and z-positional signals. Both x-dimension and z-dimension are even more smooth than with quadratic interpolation. In average, however, the gain is not enormous, as the bit-depth now accounts for 13.24±1.40(SD), which corresponds to 9675 discrete steps over 96 sensors. In the default configuration of the Chimaera with 3 sensors over 100 cents, this leads to a mean resolution down to 0.33 cents, way more than we would ever need and not really worth the extra computation. Note that the interpolated z-dimensional signal at vicinity=1 did not improve much, hardening the fact that this is really due to underlying physical constraints (inter sensor spacing) which cannot just be magicked away with any math.

bla bla
bla bla
Catmull-Rom spline interpolated positional signals of x-dimension, z-dimension, z- vs x-dimension and bit-depth of x-dimension.

Conclusion

We have shown that the raw sensor readouts of the Chimaera have a standard deviation of \(2^{-12}\) with a moving average window of 8 samples. This is the maximum that we can get out of a 12-bit ADC. So, we have the best prerequisite for the subsequent interpolation step.

The position signals are interpolated over the normalized sensor values along the sensor arrays. No interpolation is not adequate for Chimaera with 96 sensors, as the bit depth would only be 6.5 and under no circumstance comply as continuous controller. We have shown that a quadratic interpolation can resolve down to 0.43 cents when 3 sensors each span over a range of 100 cents. That is far more than human ears can discriminate. Although Catmull-Rom spline interpolation has even slightly higher resolution than quadratic interpolation, the increased computational costs most probably are not worth it.

The Chimaera thus can derive a very fine resolution based on simple concepts and is ideally suited for continuous-pitch musical play. The resolution in x-dimension is augmented 78x when quadratic interpolation is applied compared to no interpolation. For Catmull-Rom splines, the increase in resolution is even higher with 100x.

WANTED:
Beta Testers

After a high interest at Maker Faire Rome, we are now running a beta-testing campaign to collect more comprehensive feedback of first-hand experiences of our final Chimaera prototype design from interested individuals. Get in contact with us. Now.

Please support free/libre software and hardware designs.

or

donate bitcoins

or

request bank credentials via encrypted mail for SEPA transfers.

Last update - 09 February 2016

GitHub Google+ SoundCloud Vimeo

Copyright © 2014-2017, Hanspeter Portner, Open Music Kontrollers, cc-by-sa 4.0. Uses libre javascript.