Replies: 6 comments 51 replies
-
According to the datasheet, the adc has 10.1 effective bits. That's roughly 60dB useful dynamic range. But this datasheet is rather light on details. Another thing to keep in mind is that midi velocity is limited to 127 which is only 42dB of expression. Which means we need to map the drum head hits in a logarithmic manner. Having compression on the input of the adc could be one way to do that. And I think we need to keep the sensitivity high for low velocity hits. Based on the waveform you recorded I see two things:
The impact is 'negative going' and well within the range of the adc. The rebound, however, is clipped. And I'm not sure we can guarantee capturing the rebound of every type of mesh head even with 16-bits of resolution. Three solutions come to mind:
|
Beta Was this translation helpful? Give feedback.
-
Okay we're talking about two different things. I'm trying to see if the adc meets it's own spec. I think the adc meets it's own spec so there's not much more to say about that. You make a good point about the threshold power. I measure a similar difference:
I don't think 44dB is enough dynamic range. eDRUMin seems to work fine. Though he's using a Teensy 3.x of some kinda. With the 3.2 he could have 16-bit adc with pga giving 13 ENOB instead 10 and the ability to maximize the dynamic range with the pga. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
This test uses 22k bias resistors. I just wanted to get a feel for what all the options were. There are a few clocks available on Teensy 4.
And sample times.
There are 2 adc's so it should be possible to MUX 8 channels on each adc for 16 channels. Or 4 channels on each adc for 8 channels.
Based on these numbers we have a limited choice of "time per sample" with different hardware averaging. 32x with 8 channels (487 ns) is not possible. 16x with 8 channels (975 ns) or 32x with 4 channels (975 ns) is possible with 8x with 8 channels (1875 ns) AN5250 mentions that:
So let's test a single channel.
|
Beta Was this translation helpful? Give feedback.
-
Mostly I conclude that the adc is noisy. There are a lot of configurations that give noise peaks at -81dB (not adjusted for 12 bit) with averaging. The best performance comes from: very high sampling rate, 20MHz clock, and 32x hardware averaging. It's maybe 3dB better which isn't enough and we can't do 32x anyway. The async clock was quieter without averaging. Looking at the 20MHz LOW_SPEED clock, it was the same rms noise level, but 3dB more peak than ADACK_20. That trend continued until 16x sampling where the LOW_SPEED clock became the queiter by 3dB. I'm not sure what that means. It could be a mistake on my part. More depressing is that I hooked up the 110R/47pF test and the results were:
These peaks are actually noisier than the other resistor divider without a cap. The settings currently used by edrumulus (high speed for both conversion and sampling, 8x average):
Unfortunately I don't have an older measurement of that so it's hard to compare. I don't think it's any better. We can compare the 16x sampling case though:
As you can see the new bias configuration is significantly worse for both rms noise and peaks. The question is why? It's possible that being on the breadboard is part of the problem here. Ground is very far away. If we can understand why it got worse, maybe we can get better by doing the opposite. Actually, maybe the problem is noise on the 3v3. Lower bias resistors would allow higher noise current to pass by the adc pin. Maybe, I don't know if I'm talking nonsense here. Bedtime. The recordings I made were only 5s long. I don't know if that's enough to capture the random peaks. It's 40000 samples though so should represent a good number. |
Beta Was this translation helpful? Give feedback.
-
Got my hands on a teensy 3.6 a couple days ago (never knew digikey had stock). Spent some time patching in usb audio recording to evaluate the adc. The teensy3 code is a little different (doesn't use usb2) and I broke the serial upgrade, but can still put code on it by pressing the button on the teensy. I see some work has gone on to make things work for the teensy 3.6, but I haven't pulled any edrumulus code since October. My first and only priority is to measure the adc, so here's what I did:
I have no idea yet if those settings are adequate or not. At some point I will dig into it, but wanted to share some first results. Also, I subtract half the range before sending it out over usb and that is different than before. But it's more correct for the wav container.
Finally, recordings are made with:
First I tested with the input pin (A9) connected to AGnd (pin 2).
Next, I tested with the input pin (A9) connected to 3.3V.
Not sure that's a meaningful test, but all the noise must be generating voltages beyond the maximum value? Then I tested with 110k ohm resistors connected from A9 to both 3v3 and AGnd forming a voltage divider.
Then I connected a wire from AGnd to a piezo.
Then I connected the other end of the piezo to A9.
The noise increases considerably just by adding a wire to AGnd. That's not too suprising given the fact that this is on a breadboard with a long wire. Adding the rest of the piezo circuit didn't really change the peaks, but the noise floor came up 6dB. Going back to your recording on teensy 4 with piezo connected:
At first glance the teensy 3.6 seems worse than the teensy 4. However, the teensy 4 is 12-bit in a 16-bit container. Meaning the max possible level for 12-bit is actually -18dB not 0. So the effective range is -18 - -67 = 49 dB for the teensy 4 vs 57 dB for the teensy 3.6. Looks promising. I'll need to do some more tests looking at the conversion time. Though there are 22 adc available and to use them all, conversions will need to be complete in less than 5.68 uS. |
Beta Was this translation helpful? Give feedback.
-
In theory, a 12 bit ADC should give a dynamic range of 12*6 = 72 dB. This should be enough to correctly capture a piezo trigger signal. Unfortunately, with the current simple Edrumulus hardware design, it seems that the Roland PD-80R mesh pad has such a high output level so that the recorded signal is clipped. Clipping should always be avoided since algorithms like the positional sensing will most probably not work correctly on a clipped signal.
Tests should be done to lower the signal level which reaches the ADC. But if we lower the signal level, it may be that the hits with very low velocity may not be detectable anymore. We also have to consider some ADC noise which can be in the order of 1-3 bits. If we assume 3 bits, our dynamic range shrinks to a theoretical 54 dB. Still a lot...
An analog compression might be a solution to improve the situation. But this non-linearity may have an influence on the digital signal processing. So, maybe the non-linearity has to be compensated for in the digital domain.
Beta Was this translation helpful? Give feedback.
All reactions