1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
{
"metadata": {
"name": "",
"signature": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 15, Musical sound & acoustic of buildings"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1, page 518"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from __future__ import division\n",
"from math import log10\n",
"# decibles\n",
"#given data :\n",
"i1=4 #assume\n",
"i2=4*i1 #\n",
"dl=10*log10(i2/i1) #db\n",
"print \"Decibles by which intensity level will decrease = %0.2f db \" %dl"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Decibles by which intensity level will decrease = 6.02 db \n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2, page 519"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import sympy\n",
"# ratio of amlitudes\n",
"#given data :\n",
"l1=10 #db\n",
"l2=40 #db\n",
"dl=l2-l1 #db\n",
"x=(10**(dl/10)) #\n",
"x1=sympy.sqrt(x) #\n",
"print \"Ratio of amplitudes =\", x1"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Ratio of amplitudes = 10*sqrt(10)\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 3, page 521"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# frequency\n",
"#given data :\n",
"x=264 #key note\n",
"g=x*(3.0/2) #\n",
"print \"Frequency of note G = %0.f \" %g\n",
"cd1=x*2 #\n",
"print \"Frequency of note C = %0.f \"%cd1"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Frequency of note G = 396 \n",
"Frequency of note C = 528 \n"
]
}
],
"prompt_number": 3
}
],
"metadata": {}
}
]
}
|