分類彙整: 樹莓派之學習

勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧【專題】 PD‧箱子世界‧包絡

當人們閱讀文章時,常常依著原作者的思路,隨其文筆而行。雖覺一路順暢,一旦認真『思考』所讀內容,彷彿無法將那些『字詞』與『概念』連繫起來。比方說,作者讀過 Miller Puckette 先生如下一節講『正弦‧合成』之文本︰

1.5 Synthesizing a sinusoid
In most widely used audio synthesis and processing packages (Csound, Max/MSP, and Pd, for instance), the audio operations are specified as networks of unit generators[Mat69] which pass audio signals among themselves. The user of the software package specifies the network, sometimes called a patch, which essentially corresponds to the synthesis algorithm to be used, and then worries about how to control the various unit generators in time. In this section, we’ll use abstract block diagrams to describe patches, but in the “examples” section (Page 17), we’ll choose a specific implementation environment and show some of the software-dependent details.

To show how to produce a sinusoid with time-varying amplitude we’ll need to introduce two unit generators. First we need a pure sinusoid which is made with an oscillator. Figure 1.5 (part a) shows a pictorial representation of a sinusoidal oscillator as an icon. The input is a frequency (in cycles per second), and the output is a sinusoid of peak amplitude one.

Figure 1.5: Block diagrams for (a) a sinusoidal oscillator; (b) controlling the amplitude using a multiplier and an amplitude signal y[n]
\begin{figure}\psfig{file=figs/fig01.05.ps}\end{figure}

Figure 1.5 (part b) shows how to multiply the output of a sinusoidal oscillator by an appropriate scale factor y[n] to control its amplitude. Since the oscillator’s peak amplitude is 1, the peak amplitude of the product is about y[n], assuming y[n] changes slowly enough and doesn’t become negative in value.

 

Figure 1.6: Two amplitude functions (parts a, c), and (parts b, d), the result of multiplying them by the pure sinusoid of Figure 1.1.
\begin{figure}\psfig{file=figs/fig01.06.ps}\end{figure}

 

Figure 1.6 shows how the sinusoid of Figure 1.1 is affected by amplitude change by two different controlling signals y[n]. The controlling signal shown in part (a) has a discontinuity, and so therefore does the resulting amplitude-controlled sinusoid shown in (b). Parts (c) and (d) show a more gently-varying possibility for y[n] and the result. Intuition suggests that the result shown in (b) won’t sound like an amplitude-varying sinusoid, but instead like a sinusoid interrupted by an audible “pop” after which it continues more quietly. In general, for reasons that can’t be explained in this chapter, amplitude control signals y[n] which ramp smoothly from one value to another are less likely to give rise to parasitic results (such as that “pop”) than are abruptly changing ones.

For now we can state two general rules without justifying them. First, pure sinusoids are the signals most sensitive to the parasitic effects of quick amplitude change. So when you want to test an amplitude transition, if it works for sinusoids it will probably work for other signals as well. Second, depending on the signal whose amplitude you are changing, the amplitude control will need between 0 and 30 milliseconds of “ramp” time—zero for the most forgiving signals (such as white noise), and 30 for the least (such as a sinusoid). All this
also depends in a complicated way on listening levels and the acoustic context.

Suitable amplitude control functions y[n] may be made using an envelope generator. Figure 1.7 shows a network in which an envelope generator is used to control the amplitude of an oscillator. Envelope generators vary widely in design, but we will focus on the simplest kind, which generates line segments as shown in Figure 1.6 (part c). If a line segment is specified to ramp between two output values a and b over N samples starting at sample number M , the output is:

The output may have any number of segments such as this, laid end to end, over the entire range of sample numbers n; flat, horizontal segments can be made by setting a = b.

In addition to changing amplitudes of sounds, amplitude control is often used, especially in real-time applications, simply to turn sounds on and off: to turn one off, ramp the amplitude smoothly to zero. Most software synthesis packages also provide ways to actually stop modules from computing samples at all, but here we’ll use amplitude control instead.

The envelope generator dates from the analog era [Str95, p.64] [Cha80, p.90], as does the rest of Figure 1.7; oscillators with controllable frequency were called voltage-controlled oscillators or VCOs, and the multiplication step was done using a voltage-controlled amplifier or VCA [Str95, pp.34-35] [Cha80, pp.84-89].
Envelope generators are described in more detail in Section 4.1.

Figure 1.7: Using an envelope generator to control amplitude.
\begin{figure}\psfig{file=figs/fig01.07.ps}\end{figure}

───

 

那麼什麼是『振幅控制』呢?又為什麼會有『 pop 』吥吥聲的呢 ??假使以 x(t) 為『訊號』,用 y(t) 表達『振幅控制』,直覺上 y(t) \ \geq 0 容易理解,因為用它來『控制』當下振幅『大小』 !但是『 gently-varying 』溫和變化意指何事?又將如何解釋下面的兩句話??

First, pure sinusoids are the signals most sensitive to the parasitic effects of quick amplitude change.

……

Second, depending on the signal whose amplitude you are changing, the amplitude control will need between 0 and 30 milliseconds of “ramp” time—zero for the most forgiving signals (such as white noise), and 30 for the least (such as a sinusoid).

───

 

因此當作者閱讀『原作者』著作時,試圖以下圖的簡單『補丁』

 

正弦合成

 

用著原始的『耳朵』來『感覺』文本所說之事。這是因為即使了解了『 line~ 』物件

 

line~-help.pd - -usr-lib-pd-extended-doc-5.reference_聲音開關

 

發現用作『聲音開關』不錯,但是在理解『 parasitic effects 』寄生效應上總是不易體會。當時因對 Pd 程式語言認識之不足,所以才會設想那樣奇怪的程式!不過 { ( sin(2 \pi f t) ) } ^2  \ \geq 0 , 還可以透過頻率 f 調節訊號『包絡』 envelope 快慢,感覺十分好玩,或許有益於初學者,故特引以為記!!

 

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧【專題】 PD‧箱子世界‧合成

『合成』是個一般性概念, WiKi 百科詞條這麼說︰

Synthesis
In general, the noun synthesis (from the ancient Greek σύνθεσις, σύν “with” and θέσις “placing”) refers to a combination of two or more entities that together form something new; alternately, it refers to the creating of something by artificial means. The corresponding verb, to synthesize (or synthesise), means to make or form a synthesis.

 

如果將之從廣義上講,東方的

七巧板

七巧板是一種智力遊戲,顧名思義,七巧板是由七塊板組成的。由於等積變換,所以這七塊板可拼成許多圖形(千種以上),例如:

如果配合兩副或以上的七巧板,甚至可以做出一幅畫。

Make_a_tangram.svg

 

也可以稱之為『圖像』的『合成器』 Synthesizer 了。若是問所合成的圖案『像』或『不像』

220px-Tangram-man.svg    跑步的人??

 

大概只能訴諸『感官經驗』的吧!

所以要是說一個『聲音合成器』

Synthesizer

A sound synthesizer (usually abbreviated as “synthesizer” or “synth“, also spelled “synthesiser“) is an electronic musical instrument that generates electric signals converted to sound through loudspeakers or headphones. Synthesizers may either imitate other instruments or generate new timbres. They are often played with a keyboard, but they can be controlled via a variety of other input devices, including music sequencers, instrument controllers, fingerboards, guitar synthesizers, wind controllers, and electronic drums. Synthesizers without built-in controllers are often called sound modules, and are controlled via MIDI or CV/Gate.

Synthesizers use various methods to generate signal. Among the most popular waveform synthesis techniques are subtractive synthesis, additive synthesis, wavetable synthesis, frequency modulation synthesis, phase distortion synthesis, physical modeling synthesis and sample-based synthesis. Other less common synthesis types (see #Types of synthesis) include subharmonic synthesis, a form of additive synthesis via subharmonics (used by mixture trautonium), and granular synthesis, sample-based synthesis based on grains of sound, generally resulting in soundscapes or clouds.

1280px-R.A.Moog_minimoog_2

 

是否可以產生『動人』的聲效?那也只能求之於人類感覺之本質的了。要是再引而申之︰

假使對『大自然』的『認識』就像是『知識之拼圖』,作為一個科學的『觀察者』,通常需要『考察』那些『已知的碎片』能不能夠『融匯』成為那一整張『全景圖』,往往還得『研判』以為『拼起的圖象』它會不會『引發』彼此之間『不同調』的『矛盾』。終究『科學』以『實驗觀察』之『現象事實』為『依據』,從所得之『量測數據』建立『假說』,提出『理論』來『解釋』自然萬象。要是『輕忽』了這個『本末』,可能會將『物理方程式』只當成了『數學系統』來『研究』,『忘卻』了『物理量』本是為著『描述自然』而『』的,如果說『宇宙』中根本『沒有』那種量,它又怎麼能有『物理意義』的呢?比方講,從日常生活的『經驗』裡,我們『知道』拋一個『』,它總是會『停下來』的。於是在『力學』中有所謂的『摩擦力』用以『說明』它的『原因』。然而不同的『形狀』、相異的『接觸面』以及物體『速度大小』種種『因素』都可能影響這個『摩擦力』的大小。假使從『物理近似』的觀點來看,假設那個『摩擦力大小』正比於『速度大小』,方向與『運動方向』相反,『數學上』表示為 f_r = - \alpha \cdot v, \ \alpha > 0。這個『函數』符合物理上『摩擦力』的『想法』︰

一、 v = 0 \Longrightarrow f_r = 0

二、 v > 0, \Longrightarrow f_r < 0

三、 v < 0, \Longrightarrow f_r > 0

,於是我們會想 f_r = - \beta \cdot v^2, \ \beta > 0 這個『形式』的『摩擦力』應該『不合理』的了。為什麼呢?因為當 v < 0 時  f_r < 0,那個『摩擦力』總『不可能』產生『加速』的吧!然而當我們將物理的『運動方程式』用『數學』來表達時,它就是一個『數學方程式』了,如果只就它的『數學求解』而言,那麼它的『數學近似』應該是『合理的』吧!這樣我們當考慮『摩擦力』的『修正項』時,假設它是 \pm \beta \cdot v^2 這在物理上『合理的』嗎?簡單分析一下 f_r = - \alpha \cdot v \pm \beta \cdot v^2, \ \alpha  , \beta > 0,當 f_r = 0 時,它有兩個『v = 0, v = \pm \frac{\alpha}{\beta},它雖然不可能在速度之『全域』上『符合』物理上對『摩擦力』的想法,不過某個速度的『範圍』內,它的確是『符合』的啊!如此到底就『物理近似』的『意義』來講,這個『範圍限定』是『』還是『不可』的呢?如果審思『物理量』的『』 ⊕ 應該如何『計算』,是由『自然律』得來的,因此它在『意義』上就與『數學的加』 + 有一定的『不同』。也可以說『數學近似』的『過程結果』,一般還是需要『合理的』物理之『解釋』。要是說因為 f_r = - \alpha \cdot v - \beta \cdot v^2 - \gamma \cdot v^3 可以在速度的『全域』上『符合』物理上對『摩擦力』的想法,所以在物理上它就比 f_r = - \alpha \cdot v, \ \alpha > 0 是更好的『近似描述』,豈不怪哉!!

─── 引自《【Sonic π】電聲學之電路學《四》之《 !!!! 》上

 

恐將會引起『大哉辯』的耶!!??

 

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧【專題】 PD‧箱子世界‧dB

假使我們閱讀維基百科詞條對『分貝』 dB 的定義︰

分貝(decibel)是量度兩個相同單位之數量比例的單位,主要用於度量聲音強度,常用dB表示。「」(deci-)指十分之一,個位是「貝」或「貝爾」(bel,紀念發明家亞歷山大·貝爾),但一般只用分貝。

常用的空氣參考聲壓為p_{\mathrm{ref}} = 20 µPa(微帕斯卡) (rms),它通常被認為是人類的最少聽覺響應值(大約是3米以外飛行的蚊子聲音)。最完善的水平測量,測量1帕斯卡等於94分貝聲壓級。在其他介質 ,如水下,1微帕斯卡更為普遍[1] 。這些標準被ANSIS1.1-1994.所收錄[2]

計算方法

分貝(dB)是十分之一貝爾(B): 1B = 10dB。1貝爾的兩個功率量的比值是10:1,1貝爾的兩個場量的比值是\sqrt{10}: 1 [3]。場量(field quantity)是諸如電壓電流聲壓電場強度速度電荷密度等量值,其平方值在一個線性系統中與功率成比例。功率量(power quantity)是功率值或者直接與功率值成比例的其它量,如能量密度音強發光強度等。

分貝的計算,依賴於是功率量還是場量而不同。

兩個信號具有1分貝的差異,那麼其功率比值是1.25892(即10^\frac{1}{10}\,)而幅值之比是1.12202(即\sqrt{10}^\frac{1}{10}\,[4]

功率量

考慮功率或者強度(intensity)時, 其比值可以表示為分貝,這是通過把測量值與參考量值之比計算基於10的對數,再乘以10。因此功率值P1與另一個功率值P0之比用分貝表示為LdB[5]

 L_\mathrm{dB} = 10 \log_{10} \bigg(\frac{P_1}{P_0}\bigg) \,

兩個功率值的比值基於10的對數,就是貝爾(bel)值。兩個功率值之比的分貝值是貝爾值的10倍(或者說,1個分貝是十分之一貝爾)。P1P0必須度量同一個數值類型,具有相同的單位。如果在上式中P1 = P0,那麼LdB = 0。如果P1大於P0,那麼LdB是正的;如果P1小於P0,那麼LdB是負的。

重新安排上式可得到計算P1的公式,依據P0LdB:

 P_1 = 10^\frac{L_\mathrm{dB}}{10} P_0 \, .

因為貝爾是10倍的分貝,對應的使用貝爾(LB)的公式為

 L_\mathrm{B} = \log_{10} \bigg(\frac{P_1}{P_0}\bigg) \,
 P_1 = 10^{L_\mathrm{B}} P_0 \, .

場量

考慮到場(field)的幅值(amplitude)時,通常使用A1(度量到的幅值)的平方與A0(參考幅值)的平方之比。這是因為對於大多數應用,功率與幅值的平方成比例,並期望對同一應用採取功率計算的分貝與用場的幅值計算的分貝相等。因此使用下述場量的分貝定義:

 L_\mathrm{dB} = 10 \log_{10} \bigg(\frac{A_1^2}{A_0^2}\bigg) = 20 \log_{10} \bigg(\frac{A_1}{A_0}\bigg). \,

10 \log_{10} \frac{a^2}{b^2}20 \log_{10} \frac{a}{b} 相等,這是由於對數的性質

上述公式可寫成:

 A_1 = 10^\frac{L_\mathrm{dB}}{20} A_0 \,

電子電路中,阻抗不變時,耗散功率通常與電壓或電流的平方成正比。以電壓為例,有下述方程:

 G_\mathrm{dB} =20 \log_{10} \left (\frac{V_1}{V_0} \right ) \quad \mathrm \quad

其中V1是電壓的測量值,V0是指定的參考電壓,GdB是用分貝表示的功率增益。類似的公式對電流也成立。

───

 

又考察了什麼是『對數尺度』︰

Logarithmic scale

Scientific quantities are often expressed as logarithms of other quantities, using a logarithmic scale. For example, the decibel is a unit of measurement associated with logarithmic-scale quantities. It is based on the common logarithm of ratios—10 times the common logarithm of a power ratio or 20 times the common logarithm of a voltage ratio. It is used to quantify the loss of voltage levels in transmitting electrical signals,[66] to describe power levels of sounds in acoustics,[67] and the absorbance of light in the fields of spectrometry and optics. The signal-to-noise ratio describing the amount of unwanted noise in relation to a (meaningful) signal is also measured in decibels.[68] In a similar vein, the peak signal-to-noise ratio is commonly used to assess the quality of sound and image compression methods using the logarithm.[69]

The strength of an earthquake is measured by taking the common logarithm of the energy emitted at the quake. This is used in the moment magnitude scale or the Richter scale. For example, a 5.0 earthquake releases 32 times (101.5) and a 6.0 releases 1000 times (103) the energy of a 4.0.[70] Another logarithmic scale is apparent magnitude. It measures the brightness of stars logarithmically.[71] Yet another example is pH in chemistry; pH is the negative of the common logarithm of the activity of hydronium ions (the form hydrogen ions H+ take in water).[72] The activity of hydronium ions in neutral water is 10−7 mol·L−1, hence a pH of 7. Vinegar typically has a pH of about 3. The difference of 4 corresponds to a ratio of 104 of the activity, that is, vinegar’s hydronium ion activity is about 10−3 mol·L−1.

Semilog (log-linear) graphs use the logarithmic scale concept for visualization: one axis, typically the vertical one, is scaled logarithmically. For example, the chart at the right compresses the steep increase from 1 million to 1 trillion to the same space (on the vertical axis) as the increase from 1 to 1 million. In such graphs, exponential functions of the form f(x) = a · bx appear as straight lines with slope equal to the logarithm of b. Log-log graphs scale both axes logarithmically, which causes functions of the form f(x) = a · xk to be depicted as straight lines with slope equal to the exponent k. This is applied in visualizing and analyzing power laws.[73]

───

 

或覺這個 dB 看似簡明扼要,總有莫名其妙之感。此時若是輔之以

千江有水千江月》文本所說『對數』之來歷︰

一六一四年 John Napier 約翰‧納皮爾在一本名為《 Mirifici Logarithmorum Canonis Descriptio  》── 奇妙的對數規律的描述 ── 的書中,用了三十七頁解釋『對數log ,以及給了長達九十頁的對數表。這有什麼重要的嗎?想一想即使在今天用『鉛筆』和『紙』做大位數的加減乘除,尚且困難也很容易算錯,就可以知道對數的發明,對計算一事貢獻之大的了。如果用一對一對應的觀點來看,對數把『乘除』運算『變換加減』運算

\log {a * b} = \log{a} + \log{b}

\log {a / b} = \log{a} - \log{b}

,更不要說還可以算『平方』、『立方』種種和開『平方根』、『立方根』等等的計算了。

\log {a^n} = n * \log{a}

傳聞納皮爾還發明了的『骨頭計算器』,他的書對於之後的天文學 、力學、物理學、占星學的發展都有很大的影響。他的運算變換 Transform 的想法,開啟了『換個空間解決數學問題』的大門 ,比方『常微分方程式的  Laplace Transform』與『頻譜分析的傅立葉變換』等等。

這個對數畫起來是這個樣子︰

Rendered by QuickLaTeX.com

不只如此這個對數關係竟然還跟人類之『五官』── 眼耳鼻舌身 ── 受到『刺激』── 色聲香味觸 ── 的『感覺』強弱大小有關。一七九五年出生的 Ernst Heinrich Weber 韋伯,一位德國物理學家,是一位心理物理學的先驅,他提出感覺之『方可分辨』JND just-noticeable difference 的特性。比方說你提了五公斤的水,再加上半公斤,可能感覺差不了多少,要是你沒提水,說不定會覺的突然拿著半公斤的水很重。也就是說在『既定的刺激』下, 感覺的方可分辨性大小並不相同。韋伯實驗後歸結成一個關係式︰

ΔR/R = K

R:  既有刺激之物理量數值
ΔR:  方可分辨 JND 所需增加的刺激之物理量數值
K: 特定感官之常數,不同的感官不同

。之後  Gustav Theodor Fechner  費希納,一位韋伯派的學者,提出『知覺』perception 『連續性假設,將韋伯關係式改寫為︰

dP = k  \frac {dS}{S}

,求解微分方程式得到︰

P = k \ln S + C

假如刺激之物理量數值小於 S_0 時,人感覺不到 P = 0,就可將上式寫成︰

P = k \ln \frac {S}{S_0}

這就是知名的韋伯-費希納定律,它講著:在絕對閾限 S_0 之上,主觀知覺之強度的變化與刺激之物理量大小的改變呈現自然對數的關係,也可以說,如果刺激大小按著幾何級數倍增,所引起的感覺強度卻只依造算術級數累加。

其後有人將它應用到『行銷學』的領域︰

消費者對價格變化的感受大都取決於改變的百分比

,也就是說︰

十塊錢東西變成十五塊,天價』的
二十五塊錢東西變成三十塊,坑人』的
一百塊錢東西變成一百零五塊,感覺』的

── 真是可憐的『小吃業者』,沒在怕的『頂級餐廳』!!──

───

 

再補之以『對數』的性質︰

一八二一年,法國數學家『柯西』曾經考慮了一個現今稱為『柯西函數方程』 Cauchy’s functional equation 的『加性函數』additive functions f(x + y) = f(x) + f(y)。假使 x, y 都是『有理數』,可以證明 f(x) = c \cdot x,這個『函數族』是它的『唯一解』。同時『柯西』也證明了︰如果 f(x) 是一個『實數』的『連續函數』,那麼 f(x) = c \cdot x 這個『函數族』也是它的『唯一解。要是對於『實數函數f(x) 不加上任何『限制條件』,一九零五年,德國數學家 Georg Hamel 證明了它可以有『無窮解』。在此我們僅再次的『演示』如何用『無窮小分析』來『求取』這個『加性函數』的『平滑解』︰

f(x + \delta x) =  f(x) + f(\delta x)

f(x + \delta x) = f(x) + f^{\prime}(x) \cdot \delta x + \epsilon \cdot \delta x,於是

f(x) + f(\delta x) = f(x) + f^{\prime}(x) \cdot \delta x + \epsilon \cdot \delta x,所以

f^{\prime}(x) = \frac{f(\delta x)}{\delta x} - \epsilon,因此

f^{\prime}(x) = c = constant

,再從 f(0) = f(0 + 0) = f(0) + f(0) 可得 f(0) = 0,如是就得到了 f(x) = c \cdot x 這個『函數族』。

如果從『恆等式』identity 的『觀點』來看,『 泛函數方程式』可以看成是『泛函數恆等式』 functional identities,就像{[\sin{x}]}^2 + {[\cos{x}]}^2 = 1 這個 『三角恆等式』 一樣,假使我們藉由上式將 \sin{(x + y)} = \sin{(x)} \cos{(y)} + \cos{(x)} \sin{(y)} 恆等式改寫成 \sin{(x + y)} = \sin{(x)} \sqrt{1 - {[\sin{y}]}^2} + \sqrt{1 - {[\sin{x}]}^2} \sin{(y)},儼然是一個『 泛函數方程式』的了!因此我們也可以用『相同』的『觀點』將『微分方程式』看成是一種『泛函數恆等式』,進一步『明白』即使『不求解』那個方程式,我們依然能夠藉之得到有關『解函數』的許多重要有用的『資訊』的啊!!

之前我們曾用『均值定理

一個實數函數 f 在閉區間 [a, b] 裡『連續』且於開區間 [a, b] 中『可微分』,那麼一定存在一點 c, \ a < c < b 使得此點的『切線斜率』等於兩端點間的『割線斜率』,即 f^{\prime}(c) = \frac{f(b) - f(a)}{b - a}

論證了『劉維爾定理』。這個『均值定理』的重要性在於,它將一個『連續』而且『可微分』的『函數』的『區間端點割線』與『區間內切線』聯繫了起來,使我們可以『確定』一個『等式』的『存在』。就讓我們再舉一個『對數性函數f(x \cdot y) = f(x) + f(y) 的例子,看看它的『運用』 吧。首先 f(1) = f(1 \cdot 1) = f(1) + f(1) \Longrightarrow f(1) = 0,其次 f(x \cdot \frac{1}{x}) = f(1) = 0 = f(x) + f(\frac{1}{x}) \Longrightarrow f(\frac{1}{x}) = - f(x),所以 f(\frac{x}{y}) = f(x \cdot \frac{1}{y}) = f(x) + f(\frac{1}{y}) = f(x) -f(y)。因此

f(x + \delta x) - f(x) = f(\frac{x + \delta x}{\delta x}) = f(1 + \frac{\delta x}{ x})

= f^{\prime}(\eta) \left[(1 + \frac{\delta x}{x}) - 1 \right], \ \eta \in (1, 1 + \delta x)

= f^{\prime}(\eta) \frac{\delta x}{x}

,為什麼呢?因為 f(x) 在『閉區間[1, 1 + \delta x]是『平滑的』,按照『均值定理』,存在一個 \eta \in (1, 1+ \delta x) 使得

f^{\prime}(\eta) = \frac{f( 1 + \frac{\delta x}{ x}) - f(1)}{(1 + \frac{\delta x}{x})  - 1} = \frac{f( 1 + \frac{\delta x}{ x})}{ \frac{\delta x}{x}}

\therefore f(x + \delta x) = f(x) +  f^{\prime}(\eta) \frac{\delta x}{x} = f(x) + f^{\prime}(x) \cdot \delta x + \epsilon \cdot \delta x,於是我們可以得到

f^{\prime}(x) = \frac{f^{\prime}(\eta)}{x} - \epsilon,也就是說『函數f(x) 滿足

f^{\prime}(x) = \frac{k}{x} , \ f(1)= 0, \ k= f^{\prime}(1)

它的『』果真就是 f(x) = k \ln{(x)} 的啊!!

─── 引自《【Sonic π】電聲學之電路學《四》之《一》

 

添加上物理量『均方根』之參照︰

之前在《【Sonic π】電路學之補充《二》》一篇裡,我們說到了『平均功率』的『定義』,通常物理上與工程中常用『均方根』或叫做『平方平均數』 Root mean square 來計算這個『平均值』,就讓先我們將『平均功率』的定義引述於此

所謂的『功率』 power 是指『能量』之『轉換』或者『使用』的『速率』,用單位時間的能量大小來表示。『功率』的『單位』是『瓦特』 W ,假使 \Delta W 是一物理系統在 \Delta t 時間內所做的功,那麼這段時間內的『平均功率P_{avg} 可以由下式給出

P_{avg} = \frac{\Delta W}{\Delta t}

。而『瞬時功率』就是當時間 \Delta t \rightarrow 0 時,『平均功率』的極限值

P = \lim \limits_{\Delta t\to 0} \frac{\Delta W}{\Delta t} = \frac{{\rm d}W}{{\rm d}t}

。也就是講一秒消耗一焦耳的能量就是一『瓦特』,一般所說的『一度電』是指『一千瓦小時』所使用的『電能』多寡,它等於 1000 \cdot 60 \cdot 60 J

從『瞬時功率』 的『定義』,可以推導出

機械瞬時功率】是 {P}(t) = \vec{F}(t) \cdot \vec{v}(t)

電力瞬時功率】是 P(t) = I(t) \cdot V(t)

。 那麽『均方根RMS, \ rms  的『定義』就是,如果在 0T 時距中,我們『度量』了某個 x  『物理量nt_i, \ i=1 \cdots n ,這個『物理量』的『量測值』是 x(t_i) = x_i, \ i=1 \cdots n,這時我們說這個『物理量x 的『均方根x_{rms}

x_{rms} = \sqrt{ \frac{1}{n} \left( x_1^2 + x_2^2 + \cdots + x_n^2 \right) }

。也可以說,對於一個『連續』可『度量』的 X(t) 而言﹐它就是

X_{rms} = \lim \limits_{T\rightarrow \infty} \sqrt {{1 \over {T}} {\int_{0}^{T} {[X(t)]}^2\, dt}}

,設使 Y(t) 只存在於 T_1T_2 時距間,此時 『均方根』 是

Y_{rms}} = \sqrt {{1 \over {T_2-T_1}} {\int_{T_1}^{T_2} {[Y(t)]}^2\, dt}}

為什麼是這樣『定義』的呢?假使我們『預期』一個刺激源是『周期函數』,它的『響應』也就會是一個『同頻率』之『周期函數』,如此只需要知道『一個週期』的『現象』,就能夠推論『任意時間』的『結果』。更何況『傅立葉分析』讓我們能推廣到更複雜的狀況,即使是刺激源根本就不是個『周期函數』的情形。如果從物理上來說,這個『均方表述』就是滿足『線性』、『疊加原理』與『熱力平衡』種種為『特徵』的『描述』,或許講,是人們常用『習知』之『標準差』的啊!!

於此就讓我們列出一些常見的『典型波形』之『周期函數Z(t) 之『均方根

400px-Waveforms.svg

Sine Wave

Z(t) = a \sin{(2 \pi f t)}Z_{rms} = \frac{a}{\sqrt{2}}

Square Wave

Z(t) = \begin{cases}a & \{f t\} < 0.5 \\ -a & \{f t\} > 0.5 \end{cases}Z_{rms} = a

Triangle Wave

Z(t) = |2a\{ft\} - a|, Z_{rms} = \frac{a}{\sqrt{3}}

Sawtouth Wave

Z(t) = 2a\{ft\} - a, Z_{rms} = \frac{a}{\sqrt{3}}

,此處

t 是『時間』,
f 是『頻率』,
a 是『振幅』,
\{r\}r 的『分數部份』 Fractional part。

── 如果命運果真有規劃局;事物就定能分好類嗎??──

─── 引自《【Sonic π】電聲學之電路學《一》下

 

貫通之後,或將能對 Miller Puckette 書中所言︰

1.2 Units of Amplitude
Two amplitudes are often better compared using their ratio than their difference. Saying that one signal’s amplitude is greater than another’s by a factor of two might be more informative than saying it is greater by 30 millivolts. This is true for any measure of amplitude (RMS or peak, for instance). To facilitate comparisons, we often express amplitudes in logarithmic units called decibels. If a is the amplitude of a signal (either peak or RMS), then we can define the
decibel (dB) level d as:

where a0 is a reference amplitude.

………

 

有更深入之理解耶!?

 

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧【專題】 PD‧箱子世界‧正交

雖然不知道『聲波』振動與傳播的物理,並不妨礙 Miller Puckette 先生書中文章之應用。然而若能知道那些原理,或許可以深化理解 ,不只是『知其然』,進而能知『所以然』的吧!所以此處先列出一些與之相關文本系列之首篇,方便讀者參考︰

【Sonic π】聲波之傳播原理︰振動篇

【Sonic π】聲波之傳播原理︰原理篇《一》

【Sonic π】聲波之傳播原理︰共振篇《一》

以期在運用科技之時,還能欣賞自然耶!!

比方說 Miller Puckette 在 1.6 節文中,用著簡易的數學來談『訊號疊加』現象,

1.6 Superposing Signals

If a signal x[n] has a peak or RMS amplitude A (in some fixed window), then the scaled signal k · x[n] (where k ≥ 0) has amplitude kA. The mean power of the scaled signal changes by a factor of k 2 . The situation gets more complicated when two different signals are added together; just knowing the amplitudes of the two does not suffice to know the amplitude of the sum. The two amplitude measures do at least obey triangle inequalities; for any two signals x[n] and y[n],

If we fix a window from M to N + M − 1 as usual, we can write out the mean power of the sum of two signals:

where we have introduced the covariance of two signals:

The covariance may be positive, zero, or negative. Over a sufficiently large window, the covariance of two sinusoids with different frequencies is negligible compared to the mean power. Two signals which have no covariance are called uncorrelated (the correlation is the covariance normalized to lie between -1 and 1). In general, for two uncorrelated signals, the power of the sum is the sum of the powers:

Put in terms of amplitude, this becomes:

This is the familiar Pythagorean relation. So uncorrelated signals can be thought of as vectors at right angles to each other; positively correlated ones as having an acute angle between them, and negatively correlated as having an obtuse angle between them.
For example, if two uncorrelated signals both have RMS amplitude a, the sum will have RMS amplitude \sqrt{a}. On the other hand if the two signals happen to be equal—the most correlated possible—the sum will have amplitude 2a, which is the maximum allowed by the triangle inequality.

………

 

引出『不相關』 uncorrelated 訊號間有直角三角形『畢氏關係』。說明了頻率不同之『正弦波』 sinusoids 通常『不相關』 。假使此時補之以《【Sonic π】聲波之傳播原理︰原理篇《四下》》文本所講的『駐波』,這也是許多『樂器』的發聲原理︰

火車

200px-Shock_sink

220px-Eisbach_die_Welle_Surfer

250px-Standingwaves.svg

駐波形成

在一輛長列『左行』的火車上有一個很長的『水槽』,上有一向右的『行進波
u(x, t) = A(x,\ t)\sin (kx - \omega t + \phi)
,假使向左的火車與向右之水波速度相同,那麼一位站在月台的『觀察者』 將如何描述那個『行進波』的呢?

如果觀察水由水龍頭注入水槽的現象,由於水在到達槽底前的流速『較快』,然而到達槽底後水的流速突然的『變慢』,因此會發生『水躍』Hydraulic jump 的現象,此時水之部份動能將轉換為位能,故而在槽底的液面形成『駐波』。這個現象在『河水』的『流速』突然『由快變慢』時也可能發生,因而有人能在『河裡衝浪』,他正站在『駐波』之上!!

那什麼是『駐波』的呢?比方說一個『不動的』stationary 介質中,向左的波 u_l(k x + \omega t) 與向右的波 u_r(k x - \omega t) 疊加後的『合成波u_l +u_r,在『特定』的『邊界條件』下,被『侷限』在一定『空間區域』內無法前進,因此稱為『駐波』。由於駐波不能傳播能量,它的能量將『儲存』在那個空間區域裡。駐波所在區域,『振幅為零』的點稱為『節點』或『波節』Node ,『振幅最大』的點位於兩『節點』之間,通常叫做『腹點』或『波腹』Antinode。

120px-Standing_wave_2

120px-Standing_waves_on_a_string

120px-Drum_vibration_mode01

120px-Drum_vibration_mode21

一根長度 L 震盪的弦上,一個向右的簡諧波 u_r = u_0  \sin(kx - \omega t),由於弦的兩頭固定,那個波在右端點也只能『反射』回來,形成了 u_l = u_0  \sin(kx + \omega t),此時合成波 u = u_l + u_r
u\; = u_0\sin(kx - \omega t) + u_0 \sin(kx + \omega t)
,可用三角恆等式簡化為
u = 2 u_0\cos(\omega t)\sin(kx)
。此時『時間項』與『空間項』分離,形成『駐波』。在 kx = n \pi 時,\sin(kx) = 0,此處 n 是整數,這就是『節點』;當 kx = n \pi + \frac{\pi}{2}\parallel \sin(kx) = 1 \parallel,也就是『腹點』。當然波長 \lambda 就得滿足 \lambda = \frac {L}{n \pi} 的邊界條件。

─── 琴弦擇音而振, 苟非知音焉得共鳴。───

───

 

當更能了解那些滿足 \lambda = \frac {L}{n \pi} 『波長』關係的『頻率』構成了那根『弦』的『泛音』。不同『音色』的『弦』正因此『泛音』頻譜不同而出色。或也將知這也是『正交函數族』 Orthogonal functions 的發展以及『傅立葉級數』之歷史濫觴乎︰

Hilbert space interpretation

In the language of Hilbert spaces, the set of functions {e_n=e^{inx}; nZ} is an orthonormal basis for the space L2([−ππ]) of square-integrable functions of [−ππ]. This space is actually a Hilbert space with an inner product given for any two elements f and g by

\langle f,\, g \rangle \;\stackrel{\mathrm{def}}{=} \; \frac{1}{2\pi}\int_{-\pi}^{\pi} f(x)\overline{g(x)}\,dx.

The basic Fourier series result for Hilbert spaces can be written as

f=\sum_{n=-\infty}^\infty \langle f,e_n \rangle \, e_n.
This corresponds exactly to the complex exponential formulation given above. The version with sines and cosines is also justified with the Hilbert space interpretation. Indeed, the sines and cosines form an orthogonal set:
400px-Fourier_series_integral_identities
Sines and cosines form an orthonormal set, as illustrated above. The integral of sine, cosine and their product is zero (green and red areas are equal, and cancel out) when m, n or the functions are different, and pi only if m and n are equal, and the function used is the same.
\int_{-\pi}^{\pi} \cos(mx)\, \cos(nx)\, dx = \pi \delta_{mn}, \quad m, n \ge 1, \,
\int_{-\pi}^{\pi} \sin(mx)\, \sin(nx)\, dx = \pi \delta_{mn}, \quad m, n \ge 1

(where δmn is the Kronecker delta), and

\int_{-\pi}^{\pi} \cos(mx)\, \sin(nx)\, dx = 0;\,

furthermore, the sines and cosines are orthogonal to the constant function 1. An orthonormal basis for L2([−π,π]) consisting of real functions is formed by the functions 1 and √2 cos(nx),  √2 sin(nx) with n = 1, 2,…  The density of their span is a consequence of the Stone–Weierstrass theorem, but follows also from the properties of classical kernels like the Fejér kernel.

───

 

若非如此,樂器將如何和鳴共奏呢?或終可聞箱子天籟之聲的耶 ??!!

 

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧【專題】 PD‧箱子世界‧取樣

繚綾》 唐‧白居易

繚綾繚綾何所似,不似羅綃與紈綺。
應似天台山上月明前,四十五尺瀑布泉。
中有文章又奇絕,地鋪白煙花簇雪。
織者何人衣者誰,越溪寒女漢宮姬。
去年中使宣口敕,天上取樣人間織。
織爲雲外秋雁行,染作江南春水色。
廣裁衫袖長制裙,金鬥熨波刀翦紋。
異彩奇文相隱映,轉側看花花不定。
昭陽舞人恩正深,春衣一對直千金。
汗沾粉污不再著,曳土蹋泥無惜心。
繚綾織成費功績,莫比尋常繒與帛。
絲細繰多女手疼,紮紮千聲不盈尺。
昭陽殿里歌舞人。若見織時應也惜。

 

一首《繚綾》之詩,繫念女工之劬勞。如何能夠取樣天上?竟然還可人間織 !完成那織為雲外秋雁行,染作江南春水色。詩人白居易常帶給人讚嘆與哀愁。《說文解字》:  樣 樣,栩實。从木,羕聲 。宛如似樹木的年輪,相似卻又不同一般。引人想起了『類比電腦 』

Analog computer

An analog computer is a form of computer that uses the continuously changeable aspects of physical phenomena such as electrical, mechanical, or hydraulic quantities to model the problem being solved. In contrast, digital computers represent varying quantities symbolically, as their numerical values change. As an analog computer does not use discrete values, but rather continuous values, processes cannot be reliably repeated with exact equivalence, as they can with Turing machines. Analog computers do not suffer from the quantization noise inherent in digital computers, but are limited instead by analog noise.

Analog computers were widely used in scientific and industrial applications where digital computers of the time lacked sufficient performance. Analog computers can have a very wide range of complexity. Slide rules and nomographs are the simplest, while naval gunfire control computers and large hybrid digital/analog computers were among the most complicated.[1] Systems for process control and protective relays used analog computation to perform control and protective functions.

The advent of digital computing and its success made analog computers largely obsolete in 1950s and 1960s, though they remain in use in some specific applications, like the flight computer in aircraft, and for teaching control systems in universities.

 

Bifnordennomenclature

A page from the Bombardier’s Information File (BIF) that describes the components and controls of the Norden bombsight. The Norden bombsight was a highly sophisticated optical/mechanical analog computer used by the United States Army Air Force during World War II, the Korean War, and the Vietnam War to aid the pilot of a bomber aircraft in dropping bombs accurately.

 

的沒落史。這一切可說是『取樣理論』發展的必然結果!『類比』終究會為『數位』所取代。

Sampling (signal processing)

In signal processing, sampling is the reduction of a continuous signal to a discrete signal. A common example is the conversion of a sound wave (a continuous signal) to a sequence of samples (a discrete-time signal).

A sample is a value or set of values at a point in time and/or space.

A sampler is a subsystem or operation that extracts samples from a continuous signal.

A theoretical ideal sampler produces samples equivalent to the instantaneous value of the continuous signal at the desired points.

300px-Signal_Sampling

Signal sampling representation. The continuous signal is represented with a green colored line while the discrete samples are indicated by the blue vertical lines.

Theory

Sampling can be done for functions varying in space, time, or any other dimension, and similar results are obtained in two or more dimensions.

For functions that vary with time, let s(t) be a continuous function (or “signal”) to be sampled, and let sampling be performed by measuring the value of the continuous function every T seconds, which is called the sampling interval.[1]  Then the sampled function is given by the sequence:

s(nT),   for integer values of n.

The sampling frequency or sampling rate, fs, is the average number of samples obtained in one second (samples per second), thus fs = 1/T.

Reconstructing a continuous function from samples is done by interpolation algorithms. The Whittaker–Shannon interpolation formula is mathematically equivalent to an ideal lowpass filter whose input is a sequence of Dirac delta functions that are modulated (multiplied) by the sample values. When the time interval between adjacent samples is a constant (T), the sequence of delta functions is called a Dirac comb. Mathematically, the modulated Dirac comb is equivalent to the product of the comb function with s(t). That purely mathematical abstraction is sometimes referred to as impulse sampling.[2]

Most sampled signals are not simply stored and reconstructed. But the fidelity of a theoretical reconstruction is a customary measure of the effectiveness of sampling. That fidelity is reduced when s(t) contains frequency components whose periodicity is smaller than 2 samples; or equivalently the ratio of cycles to samples exceeds ½ (see Aliasing). The quantity ½ cycles/sample × fs samples/sec = fs/2 cycles/sec (hertz) is known as the Nyquist frequency of the sampler. Therefore, s(t) is usually the output of a lowpass filter, functionally known as an anti-aliasing filter. Without an anti-aliasing filter, frequencies higher than the Nyquist frequency will influence the samples in a way that is misinterpreted by the interpolation process.[3]

───

Whittaker–Shannon interpolation formula

The Whittaker–Shannon interpolation formula or sinc interpolation is a method to construct a continuous-time bandlimited function from a sequence of real numbers. The formula dates back to the works of E. Borel in 1898, and E. T. Whittaker in 1915, and was cited from works of J. M. Whittaker in 1935, and in the formulation of the Nyquist–Shannon sampling theorem by Claude Shannon in 1949. It is also commonly called Shannon’s interpolation formula and Whittaker’s interpolation formula. E. T. Whittaker, who published it in 1915, called it the Cardinal series.

Definition

Given a sequence of real numbers, x[n], the continuous function

x(t) = \sum_{n=-\infty}^{\infty} x[n] \, {\rm sinc}\left(\frac{t - nT}{T}\right)\,

(where “sinc” denotes the normalized sinc function) has a Fourier transform, X(f), whose non-zero values are confined to the region |f| ≤ 1/(2T).  When parameter T has units of seconds, the bandlimit, 1/(2T), has units of cycles/sec (hertz). When the x[n] sequence represents time samples, at interval T, of a continuous function, the quantity fs = 1/T is known as the sample rate, and fs/2 is the corresponding Nyquist frequency. When the sampled function has a bandlimit, B, less than the Nyquist frequency, x(t) is a perfect reconstruction of the original function. (See Sampling theorem.) Otherwise, the frequency components above the Nyquist frequency “fold” into the sub-Nyquist region of X(f), resulting in distortion. (See Aliasing.)

240px-Bandlimited.svg

Fourier transform of a bandlimited function.

───

 

事實上『取樣』原理也是深入 Miller Puckette 先生之書,很重要的『概念』之一。因為這『取樣』正是此一『聲音』之『數據流』的源頭。經過 Pd 『箱子』的 處理後,創新且產生『類比』之『音聲 』。