• ### Thermal noise

Hi guys,

I have a question about the nature of noise outputted by [adc~], even though no microphone or other input device are connected to it.

Internally, all ADC circuits produce a certain amount of rms noise which is mostly determined by three different contributors: quantization, thermal noise and clock jitter.

Since quantization and clock jitter are data converter noise and no external input has to be processed, I suppose this is solely determinated by the internal thermal noise due the physical movement of charge inside electrical conductors in the adc.

Can someone confirm or invalid this thesis?
Thanks,
Matteo

• Posts 11 | Views 2353
• @deframmentazione-geometrica We hope so when looking for a solution for [random]
There is likely though to be some vhf and uhf pickup from the computer busses as well.
If you amplify and listen to it you will be able to tell. I imagine that if your brain can hear tones in the noise then it will be less random than it looks when graphed.
It is certainly worth investigating.....
David.

• Hi David, thanks for answering,
I tested the entropy of the thermal noise with ENT and I found it's rather a week entropy source.

The tested file is 100.000 byte, I used [snapshot~] to convert signals into values, and [binfile] to create a 256 character bin file.

The result of entropy is 5,554712 bits per character, and optimum compression would reduce the size of this 100.000 byte file by 30 %. The file is considered to be essentially random when compression is 0%.
As well as entropy all others values are out of parameters

``````C:\Users\Lenovo\Desktop\ENT\random>ent -c 14.bin
Value Char Occurrences Fraction
0             1724   0.017240
3             3507   0.035070
7             3520   0.035200
11             3559   0.035590
15             3487   0.034870
19             3361   0.033610
23             3396   0.033960
27             3353   0.033530
31             3310   0.033100
35   #         3321   0.033210
38   &         3157   0.031570
42   *         3235   0.032350
46   .         3085   0.030850
50   2         3069   0.030690
54   6         2913   0.029130
58   :         2750   0.027500
62   >         2753   0.027530
66   B         2707   0.027070
70   F         2456   0.024560
73   I         2504   0.025040
77   M         2384   0.023840
81   Q         2326   0.023260
85   U         2181   0.021810
89   Y         2140   0.021400
93   ]         2001   0.020010
97   a         1921   0.019210
101   e         1762   0.017620
105   i         1643   0.016430
108   l         1642   0.016420
112   p         1537   0.015370
116   t         1444   0.014440
120   x         1397   0.013970
124   |         1266   0.012660
128             1188   0.011880
132             1115   0.011150
136              996   0.009960
140              984   0.009840
143              909   0.009090
147              774   0.007740
151              842   0.008420
155              769   0.007690
159              642   0.006420
163   ú          626   0.006260
167   º          567   0.005670
171   ½          533   0.005330
175   »          508   0.005080
178   ▓          426   0.004260
182   Â          406   0.004060
186   ║          375   0.003750
190   ¥          352   0.003520
194   ┬          320   0.003200
198   ã          314   0.003140
202   ╩          292   0.002920
206   ╬          228   0.002280
210   Ê          212   0.002120
214   Í          201   0.002010
217   ┘          186   0.001860
221   ¦          157   0.001570
225   ß          123   0.001230
229   Õ          128   0.001280
233   Ú          110   0.001100
237   Ý          105   0.001050
241   ±           95   0.000950
245   §           74   0.000740
249   ¨           79   0.000790
252   ³           68   0.000680
255              485   0.004850

Total:        100000   1.000000

Entropy = 5.554712 bits per byte.

Optimum compression would reduce the size
of this 100000 byte file by 30 percent.

Chi square distribution for 100000 samples is 530303.93, and randomly
would exceed this value less than 0.01 percent of the times.

Arithmetic mean value of data bytes is 69.9192 (127.5 = random).
Monte Carlo value for Pi is 3.924156966 (error 24.91 percent).
Serial correlation coefficient is 0.042567 (totally uncorrelated = 0.0).
``````

Even though ADC thermal noise is a week entropy source it's still true random as well as vhf and uhf signals. Some post-processing might be able to reshape the statistical characteristics of the data.

Thanks,
Matteo

• @deframmentazione-geometrica It is looking hopeful. It was my first thought years ago, but the person looking for this could not access the microphone input running Pd for Android..

If you want to strip out some of the lower decimals to get your random numbers you can use [mod] and [div] something like this.......... randomyness4.pd
David.

• @deframmentazione-geometrica Some of that noise would also be from the circuitry feeding the ADC, from here we get the noise from the preamp which generally just has its input shorted to ground when nothing is plugged in and still is amplifying anything that manages to get into the circuit, this includes the self noise of the amp, Johnson noise, any RF which manages to get in, ground noise, digital noise seeping into the analog, etc. This is unlikely to be a portable solution since some devices will turn off the ADC itself when nothing is plugged in as a power saving measure, so no noise or clock jitter and some will likewise turn off the preamp when nothing is plugged in, so we loose that source of noise, which is likely the dominant source in most cases.

• @oid Yes. One could build a small Johnson resistor circuit into a 3,5mm jack plug (4 pole probably for a mobile phone) to open the preamp and add more thermal noise.
David.

• @whale-av The 3.5mm jack without a resistor would actually add more noise than with it,. The input jack is a switchting type jack, with nothing plugged in the tip and ring is shorted directly to ground, if you just plugged in a bare plug, it would break that short to ground, the plug would become an antenna and while being very short and limited in the wavelengths it could pickup, it would pickup a good deal and certainly more than the Johnson noise of a resistor, if you just plugged in a cable and left the other end unplugged, you would get even more since your antenna is now longer and can pick up longer wavelengths better. A resistor added in, will just resist, those weak RF signals will need to over come that resistance to reach the preamp and be amplified. Johnson noise is a very small factor, it does contribute, but it is not something one would really want to try and exploit as a noise source, a few feet of and wire will give you considerably more. A rather simplified explanation and not completely correct, consider it practical but not technical.

As an aside, the second ring on the standard tip, ring, ring 3.5 mm plug that we see on phones and anything that can take a headset is powered, those headsets use electret microphones which need some voltage to function. I am not sure what this voltage is, but if you can find a zener diode with a reverse breakdown voltage that is less than the voltage supplied by the jack for a microphone, you could likely build a noise generator into a standard 3.5mm plug with little issue. Zener diodes are generally thought of as poor noise generators, their output level is quite erratic, they are too random to be good noise, but that is great when your needs are random and not pure white noise. There is no real gain to building such a noise source into a plug, just plugging in any cable and leaving the other end floating will do just as well and with less effort.

• @oid They do provide phantom...... but that is just because dynamic microphones are too bulky and heavy for headsets and such. The current can anyway be drained with a 470ohm resistor.
But some hands free sets use low impedance values for button control..... so beware.
Samsung specify 1k0 to 1k5 for audio input detection.
I meant use a "high noise" resistor across the input...... that would open up the input and inject more thermal noise.
A carbon or thick-film resistor will be a good source...... and thick film best because it will get hotter.
The phantom could provide enough current to slightly heat up a thick film resistor and provide even more noise...... if its value is correct..... so maybe 1k0 to maximise the heating and still be recognised for audio.

But yes....... if you find a simple antenna is a random enough source...... then "why not?".
David.

• @whale-av Hi David, thanks for the suggestions.

In order to satisfy all ENT parameters, the best option is to get the varying amplitude from [env~] and using [mod] to evenly spread the values.

Here the test of a so generated 180.000 byte bin file, the results are within the normal required parameters.

Entropy is 7.999070 bits per byte. This value is the information density of the contents of the file, expressed as a number of bits per byte. So the file is essentially random.

The chi-square distribution is 84.08%. This test is the most commonly used test for the randomness of data calculated for the stream of bytes in the file and expressed as an absolute number and a percentage which indicates how frequently a truly random sequence would exceed the value calculated. If the percentages is between 10% and 90% the sequence is random.

``````C:\Users\Lenovo\Desktop\ENT\random>ent -c 1.bin
Value Char Occurrences Fraction
0              683   0.003781
1              730   0.004041
2              731   0.004047
3              717   0.003969
4              705   0.003903
5              717   0.003969
6              720   0.003986
7              709   0.003925
8              707   0.003914
9              696   0.003853
10              703   0.003892
11              685   0.003792
12              713   0.003947
13              707   0.003914
14              674   0.003731
15              708   0.003919
16              653   0.003615
17              700   0.003875
18              699   0.003870
19              685   0.003792
20              720   0.003986
21              710   0.003930
22              733   0.004058
23              722   0.003997
24              647   0.003582
25              691   0.003825
26              656   0.003632
27              699   0.003870
28              677   0.003748
29              674   0.003731
30              696   0.003853
31              700   0.003875
32              672   0.003720
33   !          693   0.003836
34   "          727   0.004025
35   #          744   0.004119
36   \$          769   0.004257
37   %          735   0.004069
38   &          663   0.003670
39   '          715   0.003958
40   (          680   0.003764
41   )          712   0.003942
42   *          713   0.003947
43   +          692   0.003831
44   ,          737   0.004080
45   -          649   0.003593
46   .          677   0.003748
47   /          728   0.004030
48   0          721   0.003991
49   1          729   0.004036
50   2          689   0.003814
51   3          724   0.004008
52   4          701   0.003881
53   5          685   0.003792
54   6          678   0.003753
55   7          671   0.003715
56   8          694   0.003842
57   9          687   0.003803
58   :          719   0.003980
59   ;          764   0.004229
60   <          736   0.004074
61   =          688   0.003809
62   >          699   0.003870
63   ?          749   0.004146
64   @          724   0.004008
65   A          742   0.004108
66   B          660   0.003654
67   C          695   0.003847
68   D          721   0.003991
69   E          710   0.003930
70   F          677   0.003748
71   G          697   0.003859
72   H          715   0.003958
73   I          712   0.003942
74   J          692   0.003831
75   K          729   0.004036
76   L          702   0.003886
77   M          717   0.003969
78   N          702   0.003886
79   O          696   0.003853
80   P          692   0.003831
81   Q          753   0.004169
82   R          729   0.004036
83   S          726   0.004019
84   T          742   0.004108
85   U          687   0.003803
86   V          689   0.003814
87   W          652   0.003609
88   X          700   0.003875
89   Y          738   0.004085
90   Z          683   0.003781
91   [          700   0.003875
92   \          703   0.003892
93   ]          728   0.004030
94   ^          735   0.004069
95   _          711   0.003936
96   `          724   0.004008
97   a          742   0.004108
98   b          690   0.003820
99   c          723   0.004002
100   d          705   0.003903
101   e          703   0.003892
102   f          706   0.003908
103   g          735   0.004069
104   h          693   0.003836
105   i          719   0.003980
106   j          711   0.003936
107   k          650   0.003598
108   l          724   0.004008
109   m          712   0.003942
110   n          669   0.003704
111   o          697   0.003859
112   p          729   0.004036
113   q          661   0.003659
114   r          666   0.003687
115   s          740   0.004097
116   t          742   0.004108
117   u          710   0.003930
118   v          685   0.003792
119   w          758   0.004196
120   x          669   0.003704
121   y          701   0.003881
122   z          720   0.003986
123   {          694   0.003842
124   |          725   0.004014
125   }          658   0.003643
126   ~          699   0.003870
127              669   0.003704
128              725   0.004014
129              712   0.003942
130              755   0.004180
131              682   0.003775
132              727   0.004025
133              712   0.003942
134              732   0.004052
135              750   0.004152
136              726   0.004019
137              678   0.003753
138              695   0.003847
139              701   0.003881
140              709   0.003925
141              702   0.003886
142              710   0.003930
143              696   0.003853
144              729   0.004036
145              684   0.003787
146              702   0.003886
147              694   0.003842
148              691   0.003825
149              707   0.003914
150              739   0.004091
151              685   0.003792
152              738   0.004085
153              694   0.003842
154              687   0.003803
155              696   0.003853
156              692   0.003831
157              627   0.003471
158              715   0.003958
159              716   0.003964
160              695   0.003847
161   í          715   0.003958
162   ó          697   0.003859
163   ú          675   0.003737
164   ñ          721   0.003991
165   Ñ          724   0.004008
166   ª          681   0.003770
167   º          712   0.003942
168   ¿          693   0.003836
169   ®          696   0.003853
170   ¬          708   0.003919
171   ½          692   0.003831
172   ¼          666   0.003687
173   ¡          694   0.003842
174   «          711   0.003936
175   »          711   0.003936
176   ░          747   0.004135
177   ▒          685   0.003792
178   ▓          702   0.003886
179   │          709   0.003925
180   ┤          684   0.003787
181   Á          668   0.003698
182   Â          750   0.004152
183   À          683   0.003781
185   ╣          674   0.003731
186   ║          661   0.003659
187   ╗          696   0.003853
188   ╝          700   0.003875
189   ¢          720   0.003986
190   ¥          681   0.003770
191   ┐          742   0.004108
192   └          681   0.003770
193   ┴          697   0.003859
194   ┬          757   0.004191
195   ├          682   0.003775
196   ─          715   0.003958
197   ┼          711   0.003936
198   ã          706   0.003908
199   Ã          734   0.004063
200   ╚          743   0.004113
201   ╔          708   0.003919
202   ╩          697   0.003859
203   ╦          717   0.003969
204   ╠          757   0.004191
205   ═          690   0.003820
206   ╬          684   0.003787
207   ¤          718   0.003975
208   ð          662   0.003665
209   Ð          741   0.004102
210   Ê          739   0.004091
211   Ë          750   0.004152
212   È          691   0.003825
213   ı          695   0.003847
214   Í          735   0.004069
215   Î          698   0.003864
216   Ï          690   0.003820
217   ┘          718   0.003975
218   ┌          721   0.003991
219   █          693   0.003836
220   ▄          696   0.003853
221   ¦          690   0.003820
222   Ì          716   0.003964
223   ▀          723   0.004002
224   Ó          719   0.003980
225   ß          697   0.003859
226   Ô          732   0.004052
227   Ò          691   0.003825
228   õ          733   0.004058
229   Õ          752   0.004163
230   µ          680   0.003764
231   þ          701   0.003881
232   Þ          746   0.004130
233   Ú          729   0.004036
234   Û          702   0.003886
235   Ù          711   0.003936
236   ý          694   0.003842
237   Ý          661   0.003659
238   ¯          741   0.004102
239   ´          717   0.003969
240   ­           757   0.004191
241   ±          686   0.003798
242   ‗          754   0.004174
243   ¾          722   0.003997
244   ¶          722   0.003997
245   §          691   0.003825
246   ÷          725   0.004014
247   ¸          741   0.004102
248   °          702   0.003886
249   ¨          653   0.003615
250   ·          695   0.003847
251   ¹          711   0.003936
252   ³          668   0.003698
253   ²          700   0.003875
254   ■          687   0.003803
255              667   0.003692

Total:        180639   1.000000

Entropy = 7.999070 bits per byte.

Optimum compression would reduce the size
of this 180639 byte file by 0 percent.

Chi square distribution for 180639 samples is 232.49, and randomly
would exceed this value 84.08 percent of the times.

Arithmetic mean value of data bytes is 127.6331 (127.5 = random).
Monte Carlo value for Pi is 3.132000266 (error 0.31 percent).
Serial correlation coefficient is -0.000969 (totally uncorrelated = 0.0).Insert Code Here
``````
• @oid Hi, thanks for answering, these are very useful informations to know before start to design a portable solution. But this is not my case since this project is designed to run on laptop\desktop computer.

• @deframmentazione-geometrica Looking very good!
David.

Posts 11 | Views 2353
Internal error.

Oops! Looks like something went wrong!