Altcoin cryptocurrency trading strategy based on market capitalization distributuion

I grab the data from coinmarketcap.com and look at plots of the logarithm of the vector of market caps. It looks kinda like this.

TANH
http://i.imgur.com/TFwe5lD.png [1]

Then I zoom in on sections and look for deviation from linearity, kinda like this.

LINBE
http://i.imgur.com/w8wWnKb.png [2]

I believe the distribution in the first pic (with log scale) to be the inverse hyperbolic tangent

http://mathworld.wolfram.com/InverseHyperbolicTangent.html[3]

Anyway I look for points that are low and buy them hoping their BTC price rises. Gambling yes, but at least it’s math.

Discussion on reddit:

Altcoin trading strategy based on market cap distribution from BitcoinMarkets

ALTOIDNERD 2014

Donations: 17NA1jYg5u6ejboArdM7HW4MwSa6cWfnEd

Extracting Periodicity from Cryptocurrency Prices (bitcoin data power spectrum)

If you take a look at a picture like this,

RpuwrgJ

there is some pretty obvious linear impulse response there. Usually, the greater resolution you use, the more frequencies you see. The prices of real currency pairs are often fractal like – as evidenced by the twitter account of Ed Matts @EdMatts (highly recommend). The only difference is the EUR/USD or pair doesn’t experience massive shocks like cryptos do. So here that periodicity really shines.

This is a follow up on a post I made doing a log linear fit for “predicting the future” bitcoin price.  This example uses the same data set of 893 daily weighted price values from September 13, 2011 to February 20, 2014.

The question: is there any significant periodicity in the bitcoin price data?  I took the power spectrum and the result is as follows.  The x-axis is days, and the y-axis represents arbitrary units for “strength” of periodic trend.  There is insufficient data to resolve any low frequency peaks…but there appear to be relevant peaks in bins 167 and 175, indicating there may be “natural cycles” for the bitcoin price.

Take none of this seriously, and enjoy the data please. Raw data (pastebin) http://pastebin.com/YntGdH9t

Image

I used Mathematica to create this, but you can do it in excel; see footnote.

Github repo: https://github.com/Altoidnerd/Spectra

I pasted the 893 numbers into input[1] in a notebook, and Mathematica automatically labeled each entry as Out[1], Out[2], …

Then I did

Price = Table[Out[k], {k, 1, 893}];
FFTPrice = Abs[Fourier[Price]]^2;
Length[FFTPrice]

returned

893

Then drop half of it (it’s symmetrical and half is a copy…useless)

FFTHALF = Drop[FFTPrice, -446];
ListLinePlot[FFTHALF, ImageSize -> 1400, PlotRange -> {0, 12000}]
Donations: 13xdMqkaVKkHKT3ZZx5ikAvQUEkzqpDkDb

ALTOIDNERD 2014 

Note about excel: You can use excel to take fourier transforms, as long as your data has a length that is a power of two.  Your data will in general not have appropriate length, but you can just add zeros until it does.  It’s called zero-padding….it actually helps make the peaks clearer and doesn’t harm your data set in any way.  Peace.

Application and table of values for LC lumped element quarter wavelength equivalent networks for low frequnecy

In the course of working with frequencies under 30 MHz, it can become cumbersome to use quarter-wavelength impedance transformers due to the required length of lines needed.

An alternative to using transmission lines of quarter wavelength electrical length is to use LC lumped elements that have the same inversion properties. If you have a range of frequencies in mind, the difficulty of using lumped elements is choosing the LC values needed to create the network.

Using the classic 1944 paper from Proceeding of I.R.E.:

Brennecke, C.G. “Equivalent T and Pi Sections for the Quarter-Wavelength Line” Original paper

I tabulated values for inductance and capacitance in both the T and Pi networks presented by the author.

Links:

• OUTPUTS_read_only

• All documents, including plaintext source code and .nb mathematica apps:

Original reddit announcement at /r/amateurradio

The mathematica code can be copied and pasted into a mathematica interpreter.  It will then generate 4 tables of values; inductor and capacitor values for both the T and Pi equivalent LC networks to quarter wave transformers at frequencies from 500 KHz to 200 MHz, incremented by 500 KHz:

Tcapsraw = Table[1/(100*Pi*k*10^6)*10^9,{k,0,200,.1}];
Tcoilsraw = Table[50/(Pi*k*10^6)*10^6,{k,.5,200,.1}];
Pcapsraw = Table[1/(50 k*10^6 [Pi])*10^9,{k,.5,200,.1}];
Pcoilsraw= Table[25/(k*10^6[Pi])*10^6,{k,.5,200,.1}];

Text[Style["T section table of capacitances to ground",FontSize->30]]

ListPlot[Tcapsraw, ImageSize->900]

TcapsTable = Table[{1/(100*Pi*k*10^6)*10^9, " nF", "@ "k " MHz"},{k,.5,200,.5}]
Text[Style["T section table of inductances for arm series coils",FontSize->30]]

ListPlot[Tcoilsraw, ImageSize->900]

TcoilsTable = Table[{50/(Pi*k*10^6)*10^6, " [Mu]H", "@ "k " MHz"},{k,.5,200,.5}]

Text[Style["Pi section table of capacitances values for arm caps",FontSize->30]]

ListPlot[Pcapsraw, ImageSize->900]

PcapsTable = Table[{1/(50 k*10^6 [Pi])*10^9, " nF", "@ "k " MHz"},{k,.5,200,.5}]

Text[Style["Pi section table of coil values for single series inductance",FontSize->30]]

ListPlot[Pcoilsraw, ImageSize->900]

PcoilsTable = Table[{25/(k*10^6[Pi])*10^6, " [Mu]H", "@ "k " MHz"},{k,.5,200,.5}]

ListPlot[{ Tcapsraw ,Tcoilsraw,Pcapsraw , Pcoilsraw },ImageSize->900]

Contact me if you have trouble running this, or have any questions about the math or the data itself.

Don’t forget to donate a little bitcoin 🙂

13xdMqkaVKkHKT3ZZx5ikAvQUEkzqpDkDb

T-Network Tables

T-section; capacitance values to ground

 Capacitance  Frequency
(nF) (MHz)
6.3662 0.5
3.1831 1
2.12207 1.5
1.59155 2
1.27324 2.5
1.06103 3
0.909457 3.5
0.795775 4
0.707355 4.5
0.63662 5
0.578745 5.5
0.530516 6
0.489708 6.5
0.454728 7
0.424413 7.5
0.397887 8
0.374482 8.5
0.353678 9
0.335063 9.5
0.31831 10
0.303152 10.5
0.289373 11
0.276791 11.5
0.265258 12
0.254648 12.5
0.244854 13
0.235785 13.5
0.227364 14
0.219524 14.5
0.212207 15
0.205361 15.5
0.198944 16
0.192915 16.5
0.187241 17
0.181891 17.5
0.176839 18
0.172059 18.5
0.167532 19
0.163236 19.5
0.159155 20
0.155273 20.5
0.151576 21
0.148051 21.5
0.144686 22
0.141471 22.5
0.138396 23
0.135451 23.5
0.132629 24
0.129922 24.5
0.127324 25
0.124827 25.5
0.122427 26
0.120117 26.5
0.117893 27
0.115749 27.5
0.113682 28
0.111688 28.5
0.109762 29
0.107902 29.5
0.106103 30
0.104364 30.5
0.102681 31
0.101051 31.5
0.099472 32
0.097942 32.5
0.096458 33
0.095018 33.5
0.093621 34
0.092264 34.5
0.090946 35
0.089665 35.5
0.088419 36
0.087208 36.5
0.08603 37
0.084883 37.5
0.083766 38
0.082678 38.5
0.081618 39
0.080585 39.5
0.079578 40
0.078595 40.5
0.077637 41
0.076701 41.5
0.075788 42
0.074896 42.5
0.074026 43
0.073175 43.5
0.072343 44
0.07153 44.5
0.070736 45
0.069958 45.5
0.069198 46
0.068454 46.5
0.067726 47
0.067013 47.5
0.066315 48
0.065631 48.5
0.064961 49
0.064305 49.5
0.063662 50
0.063032 50.5
0.062414 51
0.061808 51.5
0.061213 52
0.060631 52.5
0.060059 53
0.059497 53.5
0.058946 54
0.058406 54.5
0.057875 55
0.057353 55.5
0.056841 56
0.056338 56.5
0.055844 57
0.055358 57.5
0.054881 58
0.054412 58.5
0.053951 59
0.053498 59.5
0.053052 60
0.052613 60.5
0.052182 61
0.051758 61.5
0.05134 62
0.05093 62.5
0.050525 63
0.050128 63.5
0.049736 64
0.04935 64.5
0.048971 65
0.048597 65.5
0.048229 66
0.047866 66.5
0.047509 67
0.047157 67.5
0.04681 68
0.046469 68.5
0.046132 69
0.0458 69.5
0.045473 70
0.04515 70.5
0.044832 71
0.044519 71.5
0.04421 72
0.043905 72.5
0.043604 73
0.043308 73.5
0.043015 74
0.042726 74.5
0.042441 75
0.04216 75.5
0.041883 76
0.041609 76.5
0.041339 77
0.041072 77.5
0.040809 78
0.040549 78.5
0.040292 79
0.040039 79.5
0.039789 80
0.039542 80.5
0.039298 81
0.039056 81.5
0.038818 82
0.038583 82.5
0.038351 83
0.038121 83.5
0.037894 84
0.03767 84.5
0.037448 85
0.037229 85.5
0.037013 86
0.036799 86.5
0.036587 87
0.036378 87.5
0.036172 88
0.035967 88.5
0.035765 89
0.035565 89.5
0.035368 90
0.035172 90.5
0.034979 91
0.034788 91.5
0.034599 92
0.034412 92.5
0.034227 93
0.034044 93.5
0.033863 94
0.033684 94.5
0.033506 95
0.033331 95.5
0.033157 96
0.032986 96.5
0.032816 97
0.032647 97.5
0.032481 98
0.032316 98.5
0.032153 99
0.031991 99.5
0.031831 100
0.031673 100.5
0.031516 101
0.031361 101.5
0.031207 102
0.031055 102.5
0.030904 103
0.030755 103.5
0.030607 104
0.03046 104.5
0.030315 105
0.030172 105.5
0.030029 106
0.029888 106.5
0.029749 107
0.02961 107.5
0.029473 108
0.029337 108.5
0.029203 109
0.029069 109.5
0.028937 110
0.028806 110.5
0.028677 111
0.028548 111.5
0.028421 112
0.028294 112.5
0.028169 113
0.028045 113.5
0.027922 114
0.0278 114.5
0.027679 115
0.027559 115.5
0.027441 116
0.027323 116.5
0.027206 117
0.02709 117.5
0.026975 118
0.026862 118.5
0.026749 119
0.026637 119.5
0.026526 120
0.026416 120.5
0.026307 121
0.026198 121.5
0.026091 122
0.025985 122.5
0.025879 123
0.025774 123.5
0.02567 124
0.025567 124.5
0.025465 125
0.025363 125.5
0.025263 126
0.025163 126.5
0.025064 127
0.024966 127.5
0.024868 128
0.024771 128.5
0.024675 129
0.02458 129.5
0.024485 130
0.024392 130.5
0.024299 131
0.024206 131.5
0.024114 132
0.024023 132.5
0.023933 133
0.023843 133.5
0.023755 134
0.023666 134.5
0.023579 135
0.023492 135.5
0.023405 136
0.023319 136.5
0.023234 137
0.02315 137.5
0.023066 138
0.022983 138.5
0.0229 139
0.022818 139.5
0.022736 140
0.022656 140.5
0.022575 141
0.022495 141.5
0.022416 142
0.022338 142.5
0.022259 143
0.022182 143.5
0.022105 144
0.022028 144.5
0.021952 145
0.021877 145.5
0.021802 146
0.021728 146.5
0.021654 147
0.02158 147.5
0.021507 148
0.021435 148.5
0.021363 149
0.021292 149.5
0.021221 150
0.02115 150.5
0.02108 151
0.021011 151.5
0.020941 152
0.020873 152.5
0.020805 153
0.020737 153.5
0.02067 154
0.020603 154.5
0.020536 155
0.02047 155.5
0.020405 156
0.020339 156.5
0.020275 157
0.02021 157.5
0.020146 158
0.020083 158.5
0.02002 159
0.019957 159.5
0.019894 160
0.019832 160.5
0.019771 161
0.01971 161.5
0.019649 162
0.019588 162.5
0.019528 163
0.019469 163.5
0.019409 164
0.01935 164.5
0.019292 165
0.019233 165.5
0.019175 166
0.019118 166.5
0.019061 167
0.019004 167.5
0.018947 168
0.018891 168.5
0.018835 169
0.018779 169.5
0.018724 170
0.018669 170.5
0.018615 171
0.01856 171.5
0.018506 172
0.018453 172.5
0.018399 173
0.018346 173.5
0.018294 174
0.018241 174.5
0.018189 175
0.018137 175.5
0.018086 176
0.018035 176.5
0.017984 177
0.017933 177.5
0.017883 178
0.017833 178.5
0.017783 179
0.017733 179.5
0.017684 180
0.017635 180.5
0.017586 181
0.017538 181.5
0.01749 182
0.017442 182.5
0.017394 183
0.017347 183.5
0.0173 184
0.017253 184.5
0.017206 185
0.01716 185.5
0.017113 186
0.017068 186.5
0.017022 187
0.016977 187.5
0.016931 188
0.016887 188.5
0.016842 189
0.016797 189.5
0.016753 190
0.016709 190.5
0.016665 191
0.016622 191.5
0.016579 192
0.016536 192.5
0.016493 193
0.01645 193.5
0.016408 194
0.016366 194.5
0.016324 195
0.016282 195.5
0.01624 196
0.016199 196.5
0.016158 197
0.016117 197.5
0.016076 198
0.016036 198.5
0.015996 199
0.015955 199.5
0.015916 200

——–

T-section; inductances for arm series coils

Inductance (uH) Frequency (MHz)
31.831 0.5
15.9155 1
10.6103 1.5
7.95775 2
6.3662 2.5
5.30516 3
4.54728 3.5
3.97887 4
3.53678 4.5
3.1831 5
2.89373 5.5
2.65258 6
2.44854 6.5
2.27364 7
2.12207 7.5
1.98944 8
1.87241 8.5
1.76839 9
1.67532 9.5
1.59155 10
1.51576 10.5
1.44686 11
1.38396 11.5
1.32629 12
1.27324 12.5
1.22427 13
1.17893 13.5
1.13682 14
1.09762 14.5
1.06103 15
1.02681 15.5
0.994718 16
0.964575 16.5
0.936206 17
0.909457 17.5
0.884194 18
0.860297 18.5
0.837658 19
0.816179 19.5
0.795775 20
0.776366 20.5
0.757881 21
0.740256 21.5
0.723432 22
0.707355 22.5
0.691978 23
0.677255 23.5
0.663146 24
0.649612 24.5
0.63662 25
0.624137 25.5
0.612134 26
0.600585 26.5
0.589463 27
0.578745 27.5
0.568411 28
0.558438 28.5
0.54881 29
0.539508 29.5
0.530516 30
0.521819 30.5
0.513403 31
0.505254 31.5
0.497359 32
0.489708 32.5
0.482288 33
0.475089 33.5
0.468103 34
0.461319 34.5
0.454728 35
0.448324 35.5
0.442097 36
0.436041 36.5
0.430148 37
0.424413 37.5
0.418829 38
0.413389 38.5
0.40809 39
0.402924 39.5
0.397887 40
0.392975 40.5
0.388183 41
0.383506 41.5
0.37894 42
0.374482 42.5
0.370128 43
0.365873 43.5
0.361716 44
0.357652 44.5
0.353678 45
0.349791 45.5
0.345989 46
0.342269 46.5
0.338628 47
0.335063 47.5
0.331573 48
0.328155 48.5
0.324806 49
0.321525 49.5
0.31831 50
0.315158 50.5
0.312069 51
0.309039 51.5
0.306067 52
0.303152 52.5
0.300292 53
0.297486 53.5
0.294731 54
0.292027 54.5
0.289373 55
0.286766 55.5
0.284205 56
0.28169 56.5
0.279219 57
0.276791 57.5
0.274405 58
0.27206 58.5
0.269754 59
0.267487 59.5
0.265258 60
0.263066 60.5
0.26091 61
0.258789 61.5
0.256702 62
0.254648 62.5
0.252627 63
0.250638 63.5
0.24868 64
0.246752 64.5
0.244854 65
0.242985 65.5
0.241144 66
0.239331 66.5
0.237545 67
0.235785 67.5
0.234051 68
0.232343 68.5
0.230659 69
0.229 69.5
0.227364 70
0.225752 70.5
0.224162 71
0.222594 71.5
0.221049 72
0.219524 72.5
0.21802 73
0.216537 73.5
0.215074 74
0.213631 74.5
0.212207 75
0.210801 75.5
0.209414 76
0.208046 76.5
0.206695 77
0.205361 77.5
0.204045 78
0.202745 78.5
0.201462 79
0.200195 79.5
0.198944 80
0.197708 80.5
0.196488 81
0.195282 81.5
0.194091 82
0.192915 82.5
0.191753 83
0.190605 83.5
0.18947 84
0.188349 84.5
0.187241 85
0.186146 85.5
0.185064 86
0.183994 86.5
0.182937 87
0.181891 87.5
0.180858 88
0.179836 88.5
0.178826 89
0.177827 89.5
0.176839 90
0.175862 90.5
0.174896 91
0.17394 91.5
0.172995 92
0.172059 92.5
0.171134 93
0.170219 93.5
0.169314 94
0.168418 94.5
0.167532 95
0.166654 95.5
0.165786 96
0.164927 96.5
0.164077 97
0.163236 97.5
0.162403 98
0.161579 98.5
0.160763 99
0.159955 99.5
0.159155 100
0.158363 100.5
0.157579 101
0.156803 101.5
0.156034 102
0.155273 102.5
0.154519 103
0.153773 103.5
0.153034 104
0.152301 104.5
0.151576 105
0.150858 105.5
0.150146 106
0.149441 106.5
0.148743 107
0.148051 107.5
0.147366 108
0.146687 108.5
0.146014 109
0.145347 109.5
0.144686 110
0.144032 110.5
0.143383 111
0.14274 111.5
0.142103 112
0.141471 112.5
0.140845 113
0.140225 113.5
0.13961 114
0.139 114.5
0.138396 115
0.137796 115.5
0.137203 116
0.136614 116.5
0.13603 117
0.135451 117.5
0.134877 118
0.134308 118.5
0.133744 119
0.133184 119.5
0.132629 120
0.132079 120.5
0.131533 121
0.130992 121.5
0.130455 122
0.129922 122.5
0.129394 123
0.12887 123.5
0.128351 124
0.127835 124.5
0.127324 125
0.126817 125.5
0.126313 126
0.125814 126.5
0.125319 127
0.124827 127.5
0.12434 128
0.123856 128.5
0.123376 129
0.1229 129.5
0.122427 130
0.121958 130.5
0.121492 131
0.12103 131.5
0.120572 132
0.120117 132.5
0.119665 133
0.119217 133.5
0.118772 134
0.118331 134.5
0.117893 135
0.117458 135.5
0.117026 136
0.116597 136.5
0.116171 137
0.115749 137.5
0.11533 138
0.114913 138.5
0.1145 139
0.11409 139.5
0.113682 140
0.113278 140.5
0.112876 141
0.112477 141.5
0.112081 142
0.111688 142.5
0.111297 143
0.110909 143.5
0.110524 144
0.110142 144.5
0.109762 145
0.109385 145.5
0.10901 146
0.108638 146.5
0.108269 147
0.107902 147.5
0.107537 148
0.107175 148.5
0.106815 149
0.106458 149.5
0.106103 150
0.105751 150.5
0.105401 151
0.105053 151.5
0.104707 152
0.104364 152.5
0.104023 153
0.103684 153.5
0.103347 154
0.103013 154.5
0.102681 155
0.10235 155.5
0.102022 156
0.101696 156.5
0.101373 157
0.101051 157.5
0.100731 158
0.100413 158.5
0.100097 159
0.0997837 159.5
0.0994718 160
0.099162 160.5
0.098854 161
0.098548 161.5
0.0982438 162
0.0979415 162.5
0.0976411 163
0.0973425 163.5
0.0970457 164
0.0967507 164.5
0.0964575 165
0.0961661 165.5
0.0958765 166
0.0955886 166.5
0.0953024 167
0.0950179 167.5
0.0947351 168
0.094454 168.5
0.0941745 169
0.0938967 169.5
0.0936206 170
0.093346 170.5
0.0930731 171
0.0928017 171.5
0.0925319 172
0.0922637 172.5
0.0919971 173
0.091732 173.5
0.0914684 174
0.0912063 174.5
0.0909457 175
0.0906866 175.5
0.0904289 176
0.0901728 176.5
0.089918 177
0.0896648 177.5
0.0894129 178
0.0891624 178.5
0.0889134 179
0.0886657 179.5
0.0884194 180
0.0881745 180.5
0.0879309 181
0.0876887 181.5
0.0874478 182
0.0872082 182.5
0.0869699 183
0.0867329 183.5
0.0864973 184
0.0862628 184.5
0.0860297 185
0.0857978 185.5
0.0855672 186
0.0853378 186.5
0.0851096 187
0.0848826 187.5
0.0846569 188
0.0844323 188.5
0.084209 189
0.0839868 189.5
0.0837658 190
0.0835459 190.5
0.0833272 191
0.0831096 191.5
0.0828932 192
0.0826779 192.5
0.0824637 193
0.0822506 193.5
0.0820386 194
0.0818277 194.5
0.0816179 195
0.0814092 195.5
0.0812015 196
0.0809949 196.5
0.0807893 197
0.0805848 197.5
0.0803813 198
0.0801788 198.5
0.0799774 199
0.0797769 199.5
0.0795775 200

——————————————-

Pi-Network Tables

Pi section; capacitance values for arm caps

Capacitance (nF) Frequency (Mhz)
12.7324 0.5
6.3662 1
4.24413 1.5
3.1831 2
2.54648 2.5
2.12207 3
1.81891 3.5
1.59155 4
1.41471 4.5
1.27324 5
1.15749 5.5
1.06103 6
0.979415 6.5
0.909457 7
0.848826 7.5
0.795775 8
0.748964 8.5
0.707355 9
0.670126 9.5
0.63662 10
0.606305 10.5
0.578745 11
0.553582 11.5
0.530516 12
0.509296 12.5
0.489708 13
0.47157 13.5
0.454728 14
0.439048 14.5
0.424413 15
0.410722 15.5
0.397887 16
0.38583 16.5
0.374482 17
0.363783 17.5
0.353678 18
0.344119 18.5
0.335063 19
0.326472 19.5
0.31831 20
0.310546 20.5
0.303152 21
0.296102 21.5
0.289373 22
0.282942 22.5
0.276791 23
0.270902 23.5
0.265258 24
0.259845 24.5
0.254648 25
0.249655 25.5
0.244854 26
0.240234 26.5
0.235785 27
0.231498 27.5
0.227364 28
0.223375 28.5
0.219524 29
0.215803 29.5
0.212207 30
0.208728 30.5
0.205361 31
0.202102 31.5
0.198944 32
0.195883 32.5
0.192915 33
0.190036 33.5
0.187241 34
0.184527 34.5
0.181891 35
0.17933 35.5
0.176839 36
0.174416 36.5
0.172059 37
0.169765 37.5
0.167532 38
0.165356 38.5
0.163236 39
0.16117 39.5
0.159155 40
0.15719 40.5
0.155273 41
0.153402 41.5
0.151576 42
0.149793 42.5
0.148051 43
0.146349 43.5
0.144686 44
0.143061 44.5
0.141471 45
0.139916 45.5
0.138396 46
0.136907 46.5
0.135451 47
0.134025 47.5
0.132629 48
0.131262 48.5
0.129922 49
0.12861 49.5
0.127324 50
0.126063 50.5
0.124827 51
0.123615 51.5
0.122427 52
0.121261 52.5
0.120117 53
0.118994 53.5
0.117893 54
0.116811 54.5
0.115749 55
0.114706 55.5
0.113682 56
0.112676 56.5
0.111688 57
0.110716 57.5
0.109762 58
0.108824 58.5
0.107902 59
0.106995 59.5
0.106103 60
0.105226 60.5
0.104364 61
0.103515 61.5
0.102681 62
0.101859 62.5
0.101051 63
0.100255 63.5
0.0994718 64
0.0987007 64.5
0.0979415 65
0.0971939 65.5
0.0964575 66
0.0957323 66.5
0.0950179 67
0.094314 67.5
0.0936206 68
0.0929372 68.5
0.0922637 69
0.0916 69.5
0.0909457 70
0.0903007 70.5
0.0896648 71
0.0890377 71.5
0.0884194 72
0.0878096 72.5
0.0872082 73
0.0866149 73.5
0.0860297 74
0.0854523 74.5
0.0848826 75
0.0843205 75.5
0.0837658 76
0.0832183 76.5
0.0826779 77
0.0821445 77.5
0.0816179 78
0.0810981 78.5
0.0805848 79
0.080078 79.5
0.0795775 80
0.0790832 80.5
0.078595 81
0.0781129 81.5
0.0776366 82
0.077166 82.5
0.0767012 83
0.0762419 83.5
0.0757881 84
0.0753396 84.5
0.0748964 85
0.0744585 85.5
0.0740256 86
0.0735977 86.5
0.0731747 87
0.0727565 87.5
0.0723432 88
0.0719344 88.5
0.0715303 89
0.0711307 89.5
0.0707355 90
0.0703447 90.5
0.0699582 91
0.0695759 91.5
0.0691978 92
0.0688238 92.5
0.0684537 93
0.0680877 93.5
0.0677255 94
0.0673672 94.5
0.0670126 95
0.0666618 95.5
0.0663146 96
0.065971 96.5
0.0656309 97
0.0652943 97.5
0.0649612 98
0.0646314 98.5
0.064305 99
0.0639819 99.5
0.063662 100
0.0633453 100.5
0.0630317 101
0.0627212 101.5
0.0624137 102
0.0621092 102.5
0.0618077 103
0.0615092 103.5
0.0612134 104
0.0609206 104.5
0.0606305 105
0.0603431 105.5
0.0600585 106
0.0597765 106.5
0.0594972 107
0.0592204 107.5
0.0589463 108
0.0586746 108.5
0.0584055 109
0.0581388 109.5
0.0578745 110
0.0576126 110.5
0.0573531 111
0.0570959 111.5
0.0568411 112
0.0565884 112.5
0.056338 113
0.0560898 113.5
0.0558438 114
0.0556 114.5
0.0553582 115
0.0551186 115.5
0.054881 116
0.0546455 116.5
0.0544119 117
0.0541804 117.5
0.0539508 118
0.0537232 118.5
0.0534975 119
0.0532736 119.5
0.0530516 120
0.0528315 120.5
0.0526132 121
0.0523967 121.5
0.0521819 122
0.051969 122.5
0.0517577 123
0.0515482 123.5
0.0513403 124
0.0511341 124.5
0.0509296 125
0.0507267 125.5
0.0505254 126
0.0503257 126.5
0.0501275 127
0.049931 127.5
0.0497359 128
0.0495424 128.5
0.0493504 129
0.0491598 129.5
0.0489708 130
0.0487831 130.5
0.0485969 131
0.0484121 131.5
0.0482288 132
0.0480468 132.5
0.0478661 133
0.0476869 133.5
0.0475089 134
0.0473323 134.5
0.047157 135
0.046983 135.5
0.0468103 136
0.0466388 136.5
0.0464686 137
0.0462996 137.5
0.0461319 138
0.0459653 138.5
0.0458 139
0.0456358 139.5
0.0454728 140
0.045311 140.5
0.0451503 141
0.0449908 141.5
0.0448324 142
0.0446751 142.5
0.0445189 143
0.0443637 143.5
0.0442097 144
0.0440567 144.5
0.0439048 145
0.0437539 145.5
0.0436041 146
0.0434553 146.5
0.0433075 147
0.0431607 147.5
0.0430148 148
0.04287 148.5
0.0427262 149
0.0425833 149.5
0.0424413 150
0.0423003 150.5
0.0421602 151
0.0420211 151.5
0.0418829 152
0.0417456 152.5
0.0416091 153
0.0414736 153.5
0.0413389 154
0.0412052 154.5
0.0410722 155
0.0409402 155.5
0.040809 156
0.0406786 156.5
0.040549 157
0.0404203 157.5
0.0402924 158
0.0401653 158.5
0.040039 159
0.0399135 159.5
0.0397887 160
0.0396648 160.5
0.0395416 161
0.0394192 161.5
0.0392975 162
0.0391766 162.5
0.0390564 163
0.038937 163.5
0.0388183 164
0.0387003 164.5
0.038583 165
0.0384665 165.5
0.0383506 166
0.0382354 166.5
0.0381209 167
0.0380072 167.5
0.037894 168
0.0377816 168.5
0.0376698 169
0.0375587 169.5
0.0374482 170
0.0373384 170.5
0.0372292 171
0.0371207 171.5
0.0370128 172
0.0369055 172.5
0.0367988 173
0.0366928 173.5
0.0365873 174
0.0364825 174.5
0.0363783 175
0.0362746 175.5
0.0361716 176
0.0360691 176.5
0.0359672 177
0.0358659 177.5
0.0357652 178
0.035665 178.5
0.0355654 179
0.0354663 179.5
0.0353678 180
0.0352698 180.5
0.0351724 181
0.0350755 181.5
0.0349791 182
0.0348833 182.5
0.034788 183
0.0346932 183.5
0.0345989 184
0.0345051 184.5
0.0344119 185
0.0343191 185.5
0.0342269 186
0.0341351 186.5
0.0340438 187
0.0339531 187.5
0.0338628 188
0.0337729 188.5
0.0336836 189
0.0335947 189.5
0.0335063 190
0.0334184 190.5
0.0333309 191
0.0332439 191.5
0.0331573 192
0.0330712 192.5
0.0329855 193
0.0329002 193.5
0.0328155 194
0.0327311 194.5
0.0326472 195
0.0325637 195.5
0.0324806 196
0.032398 196.5
0.0323157 197
0.0322339 197.5
0.0321525 198
0.0320715 198.5
0.0319909 199
0.0319108 199.5
0.031831 200

——–

Pi section; coil inductance for single series element

Inductance (uH) Frequency (MHz)
15.9155 0.5
7.95775 1
5.30516 1.5
3.97887 2
3.1831 2.5
2.65258 3
2.27364 3.5
1.98944 4
1.76839 4.5
1.59155 5
1.44686 5.5
1.32629 6
1.22427 6.5
1.13682 7
1.06103 7.5
0.994718 8
0.936206 8.5
0.884194 9
0.837658 9.5
0.795775 10
0.757881 10.5
0.723432 11
0.691978 11.5
0.663146 12
0.63662 12.5
0.612134 13
0.589463 13.5
0.568411 14
0.54881 14.5
0.530516 15
0.513403 15.5
0.497359 16
0.482288 16.5
0.468103 17
0.454728 17.5
0.442097 18
0.430148 18.5
0.418829 19
0.40809 19.5
0.397887 20
0.388183 20.5
0.37894 21
0.370128 21.5
0.361716 22
0.353678 22.5
0.345989 23
0.338628 23.5
0.331573 24
0.324806 24.5
0.31831 25
0.312069 25.5
0.306067 26
0.300292 26.5
0.294731 27
0.289373 27.5
0.284205 28
0.279219 28.5
0.274405 29
0.269754 29.5
0.265258 30
0.26091 30.5
0.256702 31
0.252627 31.5
0.24868 32
0.244854 32.5
0.241144 33
0.237545 33.5
0.234051 34
0.230659 34.5
0.227364 35
0.224162 35.5
0.221049 36
0.21802 36.5
0.215074 37
0.212207 37.5
0.209414 38
0.206695 38.5
0.204045 39
0.201462 39.5
0.198944 40
0.196488 40.5
0.194091 41
0.191753 41.5
0.18947 42
0.187241 42.5
0.185064 43
0.182937 43.5
0.180858 44
0.178826 44.5
0.176839 45
0.174896 45.5
0.172995 46
0.171134 46.5
0.169314 47
0.167532 47.5
0.165786 48
0.164077 48.5
0.162403 49
0.160763 49.5
0.159155 50
0.157579 50.5
0.156034 51
0.154519 51.5
0.153034 52
0.151576 52.5
0.150146 53
0.148743 53.5
0.147366 54
0.146014 54.5
0.144686 55
0.143383 55.5
0.142103 56
0.140845 56.5
0.13961 57
0.138396 57.5
0.137203 58
0.13603 58.5
0.134877 59
0.133744 59.5
0.132629 60
0.131533 60.5
0.130455 61
0.129394 61.5
0.128351 62
0.127324 62.5
0.126313 63
0.125319 63.5
0.12434 64
0.123376 64.5
0.122427 65
0.121492 65.5
0.120572 66
0.119665 66.5
0.118772 67
0.117893 67.5
0.117026 68
0.116171 68.5
0.11533 69
0.1145 69.5
0.113682 70
0.112876 70.5
0.112081 71
0.111297 71.5
0.110524 72
0.109762 72.5
0.10901 73
0.108269 73.5
0.107537 74
0.106815 74.5
0.106103 75
0.105401 75.5
0.104707 76
0.104023 76.5
0.103347 77
0.102681 77.5
0.102022 78
0.101373 78.5
0.100731 79
0.100097 79.5
0.099472 80
0.098854 80.5
0.098244 81
0.097641 81.5
0.097046 82
0.096458 82.5
0.095877 83
0.095302 83.5
0.094735 84
0.094175 84.5
0.093621 85
0.093073 85.5
0.092532 86
0.091997 86.5
0.091468 87
0.090946 87.5
0.090429 88
0.089918 88.5
0.089413 89
0.088913 89.5
0.088419 90
0.087931 90.5
0.087448 91
0.08697 91.5
0.086497 92
0.08603 92.5
0.085567 93
0.08511 93.5
0.084657 94
0.084209 94.5
0.083766 95
0.083327 95.5
0.082893 96
0.082464 96.5
0.082039 97
0.081618 97.5
0.081202 98
0.080789 98.5
0.080381 99
0.079977 99.5
0.079578 100
0.079182 100.5
0.07879 101
0.078401 101.5
0.078017 102
0.077637 102.5
0.07726 103
0.076886 103.5
0.076517 104
0.076151 104.5
0.075788 105
0.075429 105.5
0.075073 106
0.074721 106.5
0.074372 107
0.074026 107.5
0.073683 108
0.073343 108.5
0.073007 109
0.072674 109.5
0.072343 110
0.072016 110.5
0.071691 111
0.07137 111.5
0.071051 112
0.070736 112.5
0.070423 113
0.070112 113.5
0.069805 114
0.0695 114.5
0.069198 115
0.068898 115.5
0.068601 116
0.068307 116.5
0.068015 117
0.067726 117.5
0.067439 118
0.067154 118.5
0.066872 119
0.066592 119.5
0.066315 120
0.066039 120.5
0.065767 121
0.065496 121.5
0.065227 122
0.064961 122.5
0.064697 123
0.064435 123.5
0.064175 124
0.063918 124.5
0.063662 125
0.063408 125.5
0.063157 126
0.062907 126.5
0.062659 127
0.062414 127.5
0.06217 128
0.061928 128.5
0.061688 129
0.06145 129.5
0.061213 130
0.060979 130.5
0.060746 131
0.060515 131.5
0.060286 132
0.060059 132.5
0.059833 133
0.059609 133.5
0.059386 134
0.059165 134.5
0.058946 135
0.058729 135.5
0.058513 136
0.058299 136.5
0.058086 137
0.057875 137.5
0.057665 138
0.057457 138.5
0.05725 139
0.057045 139.5
0.056841 140
0.056639 140.5
0.056438 141
0.056239 141.5
0.056041 142
0.055844 142.5
0.055649 143
0.055455 143.5
0.055262 144
0.055071 144.5
0.054881 145
0.054692 145.5
0.054505 146
0.054319 146.5
0.054134 147
0.053951 147.5
0.053769 148
0.053588 148.5
0.053408 149
0.053229 149.5
0.053052 150
0.052875 150.5
0.0527 151
0.052526 151.5
0.052354 152
0.052182 152.5
0.052011 153
0.051842 153.5
0.051674 154
0.051507 154.5
0.05134 155
0.051175 155.5
0.051011 156
0.050848 156.5
0.050686 157
0.050525 157.5
0.050366 158
0.050207 158.5
0.050049 159
0.049892 159.5
0.049736 160
0.049581 160.5
0.049427 161
0.049274 161.5
0.049122 162
0.048971 162.5
0.048821 163
0.048671 163.5
0.048523 164
0.048375 164.5
0.048229 165
0.048083 165.5
0.047938 166
0.047794 166.5
0.047651 167
0.047509 167.5
0.047368 168
0.047227 168.5
0.047087 169
0.046948 169.5
0.04681 170
0.046673 170.5
0.046537 171
0.046401 171.5
0.046266 172
0.046132 172.5
0.045999 173
0.045866 173.5
0.045734 174
0.045603 174.5
0.045473 175
0.045343 175.5
0.045215 176
0.045086 176.5
0.044959 177
0.044832 177.5
0.044706 178
0.044581 178.5
0.044457 179
0.044333 179.5
0.04421 180
0.044087 180.5
0.043966 181
0.043844 181.5
0.043724 182
0.043604 182.5
0.043485 183
0.043367 183.5
0.043249 184
0.043131 184.5
0.043015 185
0.042899 185.5
0.042784 186
0.042669 186.5
0.042555 187
0.042441 187.5
0.042328 188
0.042216 188.5
0.042105 189
0.041993 189.5
0.041883 190
0.041773 190.5
0.041664 191
0.041555 191.5
0.041447 192
0.041339 192.5
0.041232 193
0.041125 193.5
0.041019 194
0.040914 194.5
0.040809 195
0.040705 195.5
0.040601 196
0.040497 196.5
0.040395 197
0.040292 197.5
0.040191 198
0.040089 198.5
0.039989 199
0.039889 199.5
0.039789 200

The Bitcoin Price Model – Large Time Calculations of the Bitcoin Price

exp

logplot

Just for a toy model, to start us off, I used excel to insist the log data is strictly linear, implying the price follows a perfect exponential curve.  We observe bitcoin hits $1000 on precisely….ok lets not get carried away.  The Price cannot be a pure exponential function of time – that seems to violate some economic conservation laws.  But these are still fun plots.  The source is an excel sheet which you can find here https://drive.google.com/folderview?id=0B2HU2oGcAN_SbDRHZmFsWldSX0E&usp=sharing

A somewhat sophistocated model for the price of bitcoin based on diffusion

In a previous post I suggested that the log linear behavior of bitcoin was a trend that will continue and proposed a model by which this would operate.  Here is a gogle drive containing the mathematica code I wrote to investigate the matter.  These equations do support the long term log linear behavior and produce price curves which seem to match the behavior we have seen from bitcoin.

https://drive.google.com/folderview?id=0B2HU2oGcAN_SSllnYkd0VThTcW8&usp=sharing

You will be able to manipulate a parameter controlling the effective bitcoin supply.

The rules I used to derive the formulas were:

1) the Bitcoin demand D(t) is proportional to the probability that somebody on earth has learned of Bitcoins existence.  This function is an exponential in t for small times

D(t) ~ exp[t / to]

However the probability question has vastly distinct long time behavior.  The function that really represents the long term demand of bitcoin over time is closely related to the hyperbolic tangent 

600px-Logistic-curve.svg

This family of functions has the form

D(t) = 1 / ( 1 + exp[- t / t0] )

2) The Bitcoin supply is known in the short term to be proportional to t, but since the number of bitcoins generated per unit time halves every fixed amount of years, dictated by the protocol, I said we should model the supply as

S(t) = t * 2^(-t / t’)

Where t’ is in general a parameter that can be adjusted to dictate the effective supply of bitcoin as a function of time.

This incredibly simplistic model was in fact successful at generating the family of curves that the bitcoin price and its log seem to belong to.

Perhaps in the future more sophisticated models for the supply curve can be employed, since it seems clear the supply curve is responsible for the volatility.  See tables beneath:

Anyone who has mathematica ready to can run this code.  An animation can be generated as well as a dynamic plot you may manipulate.  A simple table of outputs for the price and log of the price is given in the above google drive as the supply parameter is swept.  You can observe the supply in the model has a strong influence on the price – many orders of magnitude in fact.  Below are some excerpts from the PDF and interactive mathematica program provided in the google drive, as well as the generating mathematica code.

Demand[t_] := 1/(1 + Exp[-t/tp])
 Supply[t_] := t*2^(-t/th)
Slider[Dynamic[tp], {0, 29, .1}, ImageSize -> 1300], Dynamic[tp],
 "= propogation time tp" ,
 Slider[Dynamic[th], {0, 4, .1}], ImageSize -> 1300, Dynamic[th],
 "= effective bitcoin supply"}
Dynamic[
 Plot[Demand[t]/Supply[t], {t, .0000001, 5}, ImageSize -> 500]]
 Dynamic[
 Plot[Log[Demand[t]/Supply[t]], {t, .0000001, 5}, ImageSize -> 500]]
 {Slider[Dynamic[tp], {0, 29, .1}, ImageSize -> 1300], Dynamic[tp],
 "= propogation time tp", Slider[Dynamic[th], {0, 2, .001}],
 ImageSize -> 1300, Dynamic[th], "= effective bitcoin supply"}
{Dynamic[
 Plot[Demand[t]/Supply[t], {t, .0000001, 5}, ImageSize -> 500]],
 Dynamic[Plot[Log[Demand[t]/Supply[t]], {t, .0000001, 5},
 ImageSize -> 500]]}*)

NULL

1

2

3

4

----------

Donations:

BTC: 17NA1jYg5u6ejboArdM7HW4MwSa6cWfnEd

LTC: LQ1XbTGMiNfL4tQoqA3doVKwUDEuddSpRx

XPM: AejVQ34ntJAwUhebe7GMtC8aQ2oPg4bHDf

PPC: PQzT1tFMB5ECbQPhp41R5cTc7jpbgGUDfb

Cigar box guitar amp with LM386 + JFET preamp guide with LTSpice optimization

 2013-10-20 10.41.35 HDR

Of all the circuits I’ve ever designed purely by guessing, this one has the highest performance/expectations ratio.  I took the LM386, basically combined two of the diagrams in the data sheet, and added a transistor preamp stage and some high quality capacitors.  And dude.  I like the way this thing sounds.  A lot.   First picture time, then full schematics.

2013-10-20 10.42.05 HDR

The power amplifier section (left above) is nothing more than a combination of the first two schematics given in the LM386 data sheet.  And yeah yeah the sloppy soldering…  I told you it was on the fly. 

power stage

The way the 386 works is not like a normal op amp.  If that is messing with your mind, it does with mine as well.  But this is life.  It is a cool chip anyway.  The way this works is that 10u cap AC shorts an internal 1.35k gain setting resistor.  So I added the cap, as well as a switch so I can go between high and low gain settings.

2013-11-09 11.56.11




The switch you see there is from radio shack.  It is used to switch between the gain of 20 and gain of 200 settings; it is placed right in series with the 10u capacitor which amounts to an amp with two settings.  You either have decent clean-ish, or absolutely saturated, raunchy, but good distortion.  But it’s not because of the LM386 alone – the little preamp has a lot to do with the sound and overdrive in this design.  This 386 is seeing a well-groomed guitar signal.


2013-11-09 11.30.49

That’s the preamp, on the near side.  The image below is a spice model of the transistor premap circuit. And if you don’t know what spice is PLEASE learn spice. You must learn spice.

preamp

This little preamp was adapted from some ideas I had seen online.  But I this combination of common source followed  by follower is a bit uncommon (a lot of times you see common base instead – this is called the cascode amp). I just like the way this one works for no particular reason, just many.  It is sometimes difficult to bias (as transistors can often be…) but I’ll show you how to take the guesswork out of it using LTSpice.

With JFET’s, my strategy is to set the drain currents the way I want them first, and for that I like to use spice.  It is a sensitive issue.  Here are some plots of the performance of this preamp driven with a 10k sine of 100 mV (if you want the spice files, just contact me).

The capacitors paired with resistors have RC time constants that determine the transfer curve or frequency response of this preamp.  Whenever you build one of these, you want to put some thought into those RC constants. Here’s how to obtain the desired transfer curve from RC elements in an amplifier like this, while making sure your transistors are in their safe operating regions.

Using DC sweep to set Id

Realize it is a common source amplifier followed by a common drain (source follower). So the second transistor is actually never going to give us a gain more than 1.  The first transistor’s gain is set by the size of R4, the drain resistor of J2.  Higher R4 means more gain in the common source stage.  So, because C4 looks like a short to high frequency, this gives us our high frequency rolloff:

acanal transfer




The low frequency -3dB point is determined by the input capacitance.  You want a nice big cap to get that bass!  Audible tones are as low as 20 Hz, and tactile sense goes even lower.  Keep the bass…but you don’t want any DC.  So you get a pretty big cap, but just make sure it is not electrolytic.  Not for your signal path.  Metal film, ceramic disk, whatever.  Anything but electrolytic in the signal path.  And I don’t know if its mysticism or not, which there is a LOT of in audio as we all know…but I have noticed this input cap is a pretty big deal, so you may want to buy some nice ones.  These were $10 on ebay for 8 of them.  I used two in the amplifier here.  Anyway, let’s see the gain now:

transient1

Not a crazy high gain.  I’d like there to be more.  Then I could use the LM386 as an output and not have to rail it to get some drive.  Hmmm.  The gain itself is set by the drain resistor of J2 (which I have stupidly labeled R4 ; sorry).  I want more gain, so I need to increase R4. But the most important part of this transistor design process is keeping an eye on your drain currents.  You can do this either with the data sheet and the equation

Id = Idss*(1-Vgs/Vp)^2


(I’ll write a more technical article later about how I optimized this by hand and with mathematica).  Or you can do this in spice with DC sweep and monitor the currents through R1, and R4.

draincurrents

Well they don’t look completely ideal, but as long as I don’t use too high of a supply voltage, I’ll stay in that linear region.  , but what you really want is the drain currents (shown above) to be in the flat region at the supply voltage you choose.  If you look at 9V there, I seem to be in the correct region of operation for my transistor.  But in the case of a guitar amp…you can certainly push the limits because hey – it’s just a little distortion.  Sounds fun, right?

Let’s increase the gain.  How do we do that?  We recall from the common source link, that drain resistor sets my gain.  Ok lets make it 850 ohm.  That won’t change much right?

current cray distorted

Holy moly, we have a pretty distorted waveform and we can see why.  Look at my drain currents now.  Not only are they small, but they’re “much less linear.”





The big picture:  There are lots of ways to use spice.  One of those ways that is particularly good for discrete transistor design is DC sweep and checking out your transistors – make sure they’re in the correct operating range.  This waveform might be cool for some effect or something, but it will not give a good result if the idea is to reproduce exactly the waveform it sees.  I do like this amplifier anyway.  I plan next to make this thing with a variable supply voltage – controlling the gain that way is really cool.

Final design notes and summary:

Bypassing the supply (skip if not a noob)

This is one of those things that is basically automatic for this kind of circuit, yet if you’re a noobie, nobody really mentions it.  So I will.

• You must put 100 nF caps to ground as close as possible to the pins on your 8 pin op amps or anything similar.  If you’re still learning, think about what effect that would have.  What frequencies see a short to ground?  The idea is for your supply to be nice clean DC, because your supply will mess with your…well, everything, as we have seen.  We do not want it to fluctuate much, at any frequency.

• You want to place some big electrolytic caps between the node where you connect the battery to ground.  That is the very least you can do.  If you just pick big capacitors, you’re fine…I think I used 220uF here or something really high.  I was sloppy here because I could.  Sometimes, though, you’ll want to make a little RC network that charges up and take a little time.  This is especially true if you’re using CMOS.  JFETs can really take a beating, but not all transistors can handle a big impulse.

Connect the preamp to the LM386 schematic

• Feed the preamp into the LM386.  And see that I have a 10k resistor in my spice diagram?  That is not really in the final circuit – it’s just for the simulation, to act like the 386, which is (like an op amp or “op ampish thing” supposed to have a massive input impedance.

AC couple the output

• Put a capacitor at the output of the LM386 between your amplifier and your speaker.  Just experiment with different sizes.  Remember that caps block DC.  You don’t wanna hear any sudden DC in your speaker.  It’s nasty.  This is called AC coupling and is a great idea in many cases.

Don’t load it down too hard – its just a chip

• This little chip is awesome, and can drive a 3 ohm speaker.  But don’t push it.  It does start to oscillate driving 3 ohms, for one. And it’s not too big of a deal if you blow the chip because its cheap but you can start a fire perhaps if you let the battery get super hot or the chip starts on fire.  I find it unlikely, but yeah.  Stay above 4 ohms for the best sound anway.  I was really happy with a 6 ohm load in fact.



The one modification that would really make it nicer is increasing the supply rail from 9V to 12V, which is its max.  or better yet, use two LM386’s and an inverting buffer to get +-12V.  This should double the power output, which honestly, is surprisingly satisfying from 3/4 watt.  Try it out and let me know what variations you make!  This little thing screams.  Another cool mod would be varying the supply voltage.  I say this because we saw how much the circuit right there at the drain of J2 affects the overall waveform.  You could do some wonky stuff with this thing.

Have fun, be safe, ask any questions if you need help, and respect electronics! It’s not the safest hobby on earth.  Disclaimer disclaimer disclaimer!!

Altoidnerd

BTC: 13xdMqkaVKkHKT3ZZx5ikAvQUEkzqpDkDb

Donate Bitcoins

Donate Bitcoins





Can you represent a sine curve using sawtooth waves?

Image

It occurred to me when looking at this picture that there may be a time in a laboratory setting when representing a sine curve with sawtooth waves might be useful.  Can it be done?

The answer is yes – for the impatient, here is the plot I eventually made. The recipe is given below…

saw

as was explained to me in the subreddit /r/puremathematics by reddit user /u/Gro-Tsen as follows:

First, let me discuss how one can formally compute the coefficients expressing a sine wave as a sum of sawtooth waves: assume we have a formal sum

f(x) = g(x) + c₂·g(2x) + c₃·g(3x) + c₄·g(4x) + …

where c₂,c₃,c₄,… are known coefficients, and we want to invert this to find a similar expression for g in function of f,

g(x) = f(x) + d₂·f(2x) + d₃·f(3x) + d₄·f(4x) + …

(our goal is to compute the d coefficients in function of the c's).

This can be done inductively as follows: assuming the N−1 first d's are known (starting with just d₁=1), truncate the expression of g to the first N terms (leaving the N-th d coefficient, d[N], as an unknown) and substitute this in the first expression, then equate the first N coefficients: clearly this will give an equation determining the unknown d[N] in function of the known ones and the c's, in fact, for all N>1 this gives

d[N] = − sum(d[i]·c[N/i]) where i ranges over divisors of N (including i=1, for which d₁=1, but excluding i=N)

so we can compute

  • d₂ = −c₂
  • d₃ = −c₃
  • d₄ = −c₄+(c₂)²
  • d₅ = −c₅
  • d₆ = −c₆ + 2·c₂·c₃

and so on (for any prime number, d[p] = −c[p] as is clear from my inductive formula).





Now we can try the above purely formal method in the case where g(x) = sin(x) and f(x) is the sawtooth wave defined by f(x)=x/2 for −π<x<π. We have

f(x) = sin(x) − sin(2x)/2 + sin(3x)/3 − sin(4x)/4 + …

in other words c[i] = (−1)i+1/i and we can compute the d's from the above process:

1, 1/2, -1/3, 1/2, -1/5, -1/6, -1/7, 1/2, 0, -1/10, -1/11, -1/6, -1/13, -1/14, 1/15, 1/2, -1/17, 0, -1/19, -1/10, 1/21, -1/22, -1/23, -1/6, 0, -1/26, 0, -1/14, -1/29, 1/30, -1/31, 1/2, …

so we should have sin(x) = f(x) + f(2x)/2 − f(3x)/3 + f(4x)/2 − f(5x)/5 − f(6x)/6 − f(7x)/7 + f(8x)/2 − f(10x)/10 − … (where, again, f(x) is x/2 − π·floor((x+π)/(2π))).

Unfortunately, this reasoning was completely formal and does not say anything about convergence. I don't think one can reasonably expect convergence a.e. or L² convergence, because one can easily see that d[2n] is always 1/2, for any n>0, so the d[i] don't even tend to zero! Still, there's probably some weak sense in which the series converges (e.g., I'm pretty sure it converges as distributions), but since I'm an algebraist and not an analyst I'll just leave it at that.




Well “terrific,” I thought.   But does it really work?  /u/Gro-Tsen warned us that it would not converge, and he was correct.  I fired up Mathematica and generated the following image with 100 terms of the expansion /u/Gro-Tsen provided, displaying the weird convergence (code below). I still don’t know if its the convergence of the series causing this effect, or the built in machine representation of a sawtooth in Mathematica.

The coefficients were pulled from OEIS sequence A067856 with each entry divided by it’s index.  Here is the Mathematica code for the plot:

Tooth[x_] := SawtoothWave[(x - Pi)/(2*Pi)] - .5

Plot[Tooth[x], {x, -2*Pi, 2*Pi}]  (* this will verify that the function Tooth[] is valid *)

BigArr =

{1, 1, -1, 2, -1, -1, -1, 4, 0, -1, -1, -2, -1, -1, 1, 8, -1, 0, -1, -2, 1, -1, -1, -4, 0, -1, 0, -2, -1, 1, -1, 16, 1, -1, 1, 0, -1, -1, 1, -4, -1, 1, -1, -2, 0, -1, -1, -8, 0, 0, 1, -2, -1, 0, 1, -4, 1, -1, -1, 2, -1, -1, 0, 32, 1, 1, -1, -2, 1, 1, -1, 0, -1, -1, 0, -2, 1, 1, -1, -8, 0, -1, -1, 2, 1, -1, 1, -4, -1, 0, 1, -2, 1, -1, 1, -16, -1, 0, 0, 0}

BigArray = BigArr*(Array[1/# &, 100, 1])

Plot[Array[Tooth[# x] &, 100, 1].BigArray, {x, -2*Pi, 2*Pi},
ImageSize -> 1800]

Donate Bitcoins

The cost of artificially pumping a low volume altcoin: pumping the alt markets by yourself with the BTC/LTC “pump machine” strategy




Understanding the magnetic dipole moment

If you want to understand more about the parameter μ, try this.

We know (or at least accept) the usual equation E = – μ • B and perhaps one or two expressions for μ, like I*A or maybe even one using the current density J

μ = 1/2 ∫ d3x (r x J)

But this mysterious parameter can be found using only elementary physics, simply proposing that E is proportional to B, and finding that constant of proportionality.




Start with the same example that we used to find the gyromagnetic ratio of the electron, the charged particle motion in a circle due to uniform B. Now write down the kinetic energy of the particle – that’s right, just plain old

E = 1/2 m v2

Of course, v = r ω and we know from equating

m v2 / r = e v B  (the force due to B)

that m ω = e B. Propose there exists a constant of proportionality μ obeying

E = μ B = 1/2 m v2

where E is your expression you wrote down for kinetic energy. Solve for μ until you are satisfied that you have the same expression as you’d get by doing the integral above or using the current loop model I*A. You will obtain the same result as if you were to calculate

μ = IA = current x area = e ω/(2 π)π r2 = 1/2 e ω r2

or using the integral over current density J

μ = 1/2∫ d3x [r x J] = 1/2 r ρ*(Volume) v = 1/2 r e (rω) !!!



Note that here, ρ is charge density, so ρ (Volume) = total charge. The current density J is defined as ρv where v is the velocity of drift for the charge distribution ρ.




A round about derivation of the gyromagnetic ratio of a particle using elementary physics notions

A round about derivation of the gyromagnetic ratio of a particle using elementary physics notions

Of course, you can’t get the g-factor this way.  But hey.

Gyromagnetic ratios of various nuclei; A table of selected nuclear spins

Gyromagnetic ratios of various nuclei; A table of selected nuclear spins

Some gyromagnetic ratios of nuclei in MHz/T; some nuclear spins