【鼎革‧革鼎】︰ Raspbian Stretch 《六之 I.3 》

雖然我們已經介紹過了 Johannes Kreidler  之『公開書』

Programming Electronic Music in Pd

。但猶恐許多讀者尚且未讀過其

Chapter 2. Programming with Pd for the first time

的整篇文本那一章就是對 Pd 整體圖形界面環境之詳細的圖說。

事 物的理解,宛如認識一個陌生的環境。當初步熟悉後,或應內外上下將之貫串起來,加深整體的了解。此時若對這個環境多點鳥瞰全觀 ,或能循名責實,得其一斑 乎!既然 Pd 是一種『圖象』之程式語言 ,如把它和一般『文本』的程式語言比較,『異同』如何呢?由於『關注點』的改變,再次『重讀』一篇文章時,常會發現先前所『忽略 』之處!!也可能產生新的『疑惑』??或許俗話講的『有理』︰熟讀唐詩三百首,不會作詩也會吟。要是能夠輔之以『主動』之不同『對比』下的分析綜合,是否 可以︰唐詩不但會吟 ,也能作的呢?? !!

所以說文章並沒有『該讀』幾遍的問題,事實上卻常在有不同的『體驗』及『閱歷』之後『重讀』,總會發現『新意』。因此才講︰學而時習之,不亦說乎。要有人能『深入淺出』的為己『解說』『錯綜複雜』的『概念』之『來龍去脈』,大概是已『讀通』了的吧!!??

── 摘自《勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧【專題】 GEM‧PD‧語言回顧

 

一旦有了麥克風 adc~ 物件,純數據之天空更加多彩燦爛。故而補筆新添索引,期盼不熟悉者有個開始,熟悉者來個語言回顧︰

Chapter 2: Theory of Operation

Pd Documentation chapter 2: theory of operation
back to table of contents

 

The purpose of this chapter is to describe Pd’s design and how it is supposed to work. Practical details about how to obtain, install, and run Pd are described in the next chapter. To learn digital audio processing basics such as how to generate time-varying sounds that don’t click or fold over, a good reference is Dodge and Jerse, Computer Music .

 

或可激發創意,向世界發聲乎?

……

3.1.2.2.3 Processing adc-input

Say something into a microphone and play it back at a changed volume:

patches/3-1-2-2-3-edit-input.pd

 

至少能觀摩他人程式耶!

pd-puredata-vanilla-patches

collection of public puredata vanilla patches found on internet

DISCLAIMER: I did not write these patches. I was searching the net for free vanilla patches in order to use with pdlib/mobmuplat. I figured it would be convenient for others as well to collect it here on github.

Please contact me if you notice any license-conflict

 

 

 

 

 

 

 

【鼎革‧革鼎】︰ Raspbian Stretch 《六之 I.2 》

由於過去曾寫《專題》,詳細介紹了純數據程式以及環境的點點滴滴 ,這裡就不再贅述,還請讀者自行參照閱讀吧。

比方說,既有了 adc~ 麥克風物件,自可用延遲線 delay line 製造回聲效果︰

 

或可重現往日情懷哩!

Echoplex

The Echoplex is a tape delay effect, first made in 1959. Designed by Mike Battle,[1] the Echoplex set a standard for the effect in the 1960s—it is still regarded as “the standard by which everything else is measured.”[2] It was used by some of the most notable guitar players of the era; original Echoplexes are highly sought after.

Echoplex EP-2

The original tube Echoplex

Tape echoes work by recording sound on a magnetic tape, which is then played back; the tape speed or distance between heads determine the delay, while a feedback variable (where the delayed sound is delayed again) allows for a repetitive effect.[3] The predecessor of the Echoplex was a tape echo designed by Ray Butts in the 1950s, who built it into a guitar amplifier called the EchoSonic. He built fewer than seventy of them and could never keep up with the demand; they were used by players like Chet Atkins, Scotty Moore, and Carl Perkins.[4] Electronics technician Mike Battle copied the design and built it into a portable unit;[5] another version, however, states that Battle, working with a guitar player named Don Dixon from Akron, Ohio, perfected Dixon’s original creation.[2]

The first Echoplex with vacuum tubes was marketed in 1961. Their big innovation was the moving head, which allowed the operator to change the delay time. In 1962, their patent was bought by a company called Market Electronics in Cleveland, Ohio. Market Electronics built the units and kept designers Battle and Dixon as consultants; they marketed the units through distributor Maestro, hence the name, Maestro Echoplex. In the 1950s, Maestro was a leader in vacuum tube technology. It had close ties with Gibson, and often manufactured amplifiers for Gibson. Later, Harris-Teller of Chicago took over production.[2] The first tube Echoplex had no number designation, but was retroactively designated the EP-1 after the unit received its first upgrade. The upgraded unit was designated the EP-2.[1] These two units set the standard for the delay effect, with their “warm, round, thick echo.”[6] Two of Battle’s improvements over earlier designs were key — the adjustable tape head, which allowed for variable delay, and a cartridge containing the tape, protecting it to retain sound quality.[2]

The Echoplex wasn’t notable just for the delay, but also for the sound; it is “still a classic today, and highly desirable for a range of playing styles … warm, rich, and full-bodied.”[7] The delay could be turned off and the unit used as a filter, thanks to the sound of the vacuum tubes; this is how Tom Verlaine uses it, for instance.

While Echoplexes were used mainly by guitar players (and the occasional bass player, such as Chuck Rainey,[8] or trumpeter, such as Don Ellis[9] or Miles Davis[10][11]), many recording studios also used the Echoplex.[12]

 

若講借著 PureData 度量 Micphone 頻率響應︰

 

即使大白天,沒有隔音室,怕耳朵受不了也!!

故而作者偏好利用白雜訊?

White noise

In signal processing, white noise is a random signal having equal intensity at different frequencies, giving it a constant power spectral density.[1] The term is used, with this or similar meanings, in many scientific and technical disciplines, including physics, acoustic engineering, telecommunications, statistical forecasting, and many more. White noise refers to a statistical model for signals and signal sources, rather than to any specific signal.

In discrete time, white noise is a discrete signal whose samples are regarded as a sequence of serially uncorrelated random variables with zero mean and finite variance; a single realization of white noise is a random shock. Depending on the context, one may also require that the samples be independent and have identical probability distribution (in other words i.i.d. is the simplest representative of the white noise).[2] In particular, if each sample has a normal distribution with zero mean, the signal is said to be Gaussian white noise.[3]

The samples of a white noise signal may be sequential in time, or arranged along one or more spatial dimensions. In digital image processing, the pixels of a white noise image are typically arranged in a rectangular grid, and are assumed to be independent random variables with uniform probability distribution over some interval. The concept can be defined also for signals spread over more complicated domains, such as a sphere or a torus.

An infinite-bandwidth white noise signal is a purely theoretical construction. The bandwidth of white noise is limited in practice by the mechanism of noise generation, by the transmission medium and by finite observation capabilities. Thus, random signals are considered “white noise” if they are observed to have a flat spectrum over the range of frequencies that are relevant to the context. For an audio signal, for example, the relevant range is the band of audible sound frequencies, between 20 and 20,000 Hz. Such a signal is heard as a hissing sound, resembling the /sh/ sound in “ash”. In music and acoustics, the term “white noise” may be used for any signal that has a similar hissing sound.

White noise draws its name from white light,[4] although light that appears white generally does not have a flat spectral power density over the visible band.

The term white noise is sometimes used in the context of phylogenetically based statistical methods to refer to a lack of phylogenetic pattern in comparative data.[5] It is sometimes used in non technical contexts, in the metaphoric sense of “random talk without meaningful contents”.[6][7]

Plot of a Gaussian white noise signal

……

Practical applications

Music

White noise is commonly used in the production of electronic music, usually either directly or as an input for a filter to create other types of noise signal. It is used extensively in audio synthesis, typically to recreate percussive instruments such as cymbals or snare drums which have high noise content in their frequency domain.

Electronics engineering

White noise is also used to obtain the impulse response of an electrical circuit, in particular of amplifiers and other audio equipment. It is not used for testing loudspeakers as its spectrum contains too great an amount of high frequency content. Pink noise, which differs from white noise in that it has equal energy in each octave, is used for testing transducers such as loudspeakers and microphones.

Acoustics

To set up the equalization for a concert or other performance in a venue, a short burst of white or pink noise is sent through the PA system and monitored from various points in the venue so that the engineer can tell if the acoustics of the building naturally boost or cut any frequencies. The engineer can then adjust the overall equalization to ensure a balanced mix.

Computing

White noise is used as the basis of some random number generators. For example, Random.org uses a system of atmospheric antennae to generate random digit patterns from white noise.

………

 

估量麥克風效能呦??

 

實亦有所本矣◎

Sound System Measurements using Time Delay Spectrometry

This web site is part of a project done for Dr. Baraniuk’s ELEC 301 class (Fall 2000) at Rice University.

 

The Problem | How TDS Works | Applications | Other Measurement Techniques | Future Projects

What is TDS?

TDS, or Time Delay Spectrometry, is a technique that can be used to measure the system response of electro-acoustical systems (such as a loudspeakers) in “real-world” reverberant environments. The technique can also be expanded to measure the system response of an acoustic environment such as an auditorium or concert hall. TDS lends itself naturally to obtaining three dimensional TEF (time-energy-frequency) plots of system response. Although the mathematical and conceptual basis behind TDS have been known for quite some time, the TDS technique itself is usually credited to the late Dr. Richard Heyser, who first published the technique in the 1967 Journal of the Audio Engineering Society.

The Problem

How do we measure the system response of a loudspeaker in a reverberant environment?

If we assume that the system under test is LTI, we can completely describe the system using either one of the two system responses, since they are related by the Fourier transform. The impulse response implies the frequency response and vice versa–each one is saying the same thing, just in a different way.

Trying to measure the system response of a loudspeaker system in a “real-world” environment can often be quite challenging. Given the finite voltage handling limits of a real-world speaker system, any attempt to apply an impulse function at the input terminals would cause the system to turn into a chunk of smoldering carbon, or at the very least, cause our system to become nonlinear.

Getting a frequency response, on the other hand, seems relatively simple. We could just feed in an electrical input signal X(f), note the mechanical (pressure) signal, Y(f), coming out of the system, and then divide the frequency output by the frequency input to get our transfer function H(f)=Y(f)/X(f).

In a real-world environment, however, using the technique described above would lead to a flawed transfer function.

Why?

Sound is a compression wave in air, and most rooms are comprised of surfaces (walls, floors, ceilings, not to mention furniture like desks and chairs), that cause acoustical scattering of the wavefront emitted by the speaker. Surfaces inside the room tend to reflect, transmit, and absorb sound to varying degrees. How a surface acts varies greatly depending upon its composition, but hard surfaces like tile tend to reflect sound, although some materials, like metal, can act as ‘conductors’ or ‘transmitters’ of sound. Softer surfaces, on the other hand, like carpet and foam, tend to absorb or ‘damp’ sound.

One solution to this problem is to create an environment that allows for no acoustical scattering. Such ‘dead rooms’, also called anechoic chambers, are usually very expensive to build and maintain.

What we need is a method to measure the response of such as system regardless of the acoustic environment in which the system is located.

One solution, usually credited to the late Dr. Richard Heyser, is called Time Delay Spectrometry. The technique was first published in the Journal of the Audio Engineering Society in October 1967.

……

Other Measurement Techniques

Since we are trying to find an impulse response, what we are really doing is using our test signal (swept sine wave for TDS) to model an ideal impulse function. As we increase the amount of energy per unit time contained in our test signal, our measurement becomes more and more like the ‘real’ impulse response. We must have as much energy in our signal as possible in order to maintain a high signal-to-noise ratio for our measurement. This is especially important in an environment where ambient noise levels are high (in real-world venues, we must consider HVAC, industrial sounds, and possibly even things like audience noise).

One convenient measure of how much energy our signal contains per unit time is the crest factor. The crest factor of a signal is simply the ratio of peak value of the signal and the RMS value of the signal:

crest factor = (peak value) / (RMS value).

Ideally, we would like our crest factor to be as close to 1 as possible. Since our peak value and RMS value would be the same, we cannot have any more energy per unit time in our signal, and our input signal can be said more closely resemble an idealized impulse.

Our swept sine wave input has a crest factor of sqrt(2), which is approximately 1.4.

Another kind of input signal, which has gained a great deal of popularity in the last few years, is called an MLS, or Maximum Length Sequence. An MLS signal is simply a series of pseudo-random pulses generated by an MLS random number generator. Usually, these pulses are white or pink noise signals (pink noise is like random white noise, but it has equal power for each octave in the frequency domain).

The crest factor for MLS is very close to 1, so it makes sense to use this kind of input signal when we need a high signal-to-noise ratio for our measurement. MLS works well for the noisy real-world environments that are ever so prevalent in acoustics testing.

………

 

 

 

 

 

 

 

【鼎革‧革鼎】︰ Raspbian Stretch 《六之 I.1 》

聲音是波,在環境中常有著複雜的反射、折射與繞射現象。喜歡唱卡拉 OK 者,對麥克風之囂叫聲大概不陌生。這是一種惱人的共振

Audio feedback

“Block diagram of the signal-flow for a common feedback loop.”[1]

Audio feedback (also known as acoustic feedback, simply as feedback, or the Larsen effect) is a special kind of positive feedback which occurs when a sound loop exists between an audio input (for example, a microphone or guitar pickup) and an audio output (for example, a loudspeaker). In this example, a signal received by the microphone is amplified and passed out of the loudspeaker. The sound from the loudspeaker can then be received by the microphone again, amplified further, and then passed out through the loudspeaker again. The frequency of the resulting sound is determined by resonance frequencies in the microphone, amplifier, and loudspeaker, the acoustics of the room, the directional pick-up and emission patterns of the microphone and loudspeaker, and the distance between them. For small PA systems the sound is readily recognized as a loud squeal or screech.

Feedback is almost always considered undesirable when it occurs with a singer’s or public speaker’s microphone at an event using a sound reinforcement system or PA system. Audio engineers use highly directional cardioid microphones and various electronic devices, such as equalizers and, since the 1990s, automatic feedback detection devices to prevent these unwanted squeals or screeching sounds, which detract from the audience’s enjoyment of the event. On the other hand, since the 1960s, electric guitar players in rock music bands using loud guitar amplifiers, speaker cabinets and distortion effects have intentionally created guitar feedback to create a sustained sound. The sound of guitar feedback is considered to be desirable musical effect in heavy metal music, hardcore punk and grunge. Jimi Hendrix was an innovator in the intentional use of guitar feedback in his guitar solos to create unique sound effects not possible with more traditional playing techniques. The principles of audio feedback were first discovered by Danish scientist Søren Absalon Larsen, hence the name “Larsen Effect”.

 

,空氣為媒之回環。特寫在測試 MIC 之前,免得擾人清夜也。

故而選擇首起播歌

 

錄音回放

 

收音,觀察比較的哩!?

 

 

 

 

 

 

 

 

 

【鼎革‧革鼎】︰ Raspbian Stretch 《六之 I 》

如同色彩並非客觀之物理量,響度也不是︰

Loudness

In acoustics, loudness is the subjective perception of sound pressure. More formally, it is defined as, “That attribute of auditory sensation in terms of which sounds can be ordered on a scale extending from quiet to loud.”[1] The relation of physical attributes of sound to perceived loudness consists of physical, physiological and psychological components. The study of apparent loudness is included in the topic of psychoacoustics and employs methods of psychophysics.

In different industries, loudness may have different meanings and different measurement standards. Some definitions such as LKFS refer to relative loudness of different segments of electronically reproduced sounds such as for broadcasting and cinema. Others, such as ISO 532A (Stevens loudness, measured in sones), ISO 532B (Zwicker loudness), DIN 45631 and ASA/ANSI S3.4, have a more general scope and are often used to characterize loudness of environmental noise.

It is sometimes stated that loudness is a subjective measure, often confused with physical measures of sound strength such as sound pressure, sound pressure level (in decibels), sound intensity or sound power. It is often possible to separate the truly subjective components such as social considerations from the physical and physiological.

Filters such as A-weighting attempt to adjust sound measurements to correspond to loudness as perceived by the typical human, however this approach is only truly valid for loudness of single tones. A-weighting follows human sensitivity to sound and describes relative perceived loudness for at quiet to moderate speech levels, around 40 phons. However, physiological loudness perception is a much more complex process than can be captured with a single correction curve.[2] Not only do equal-loudness contours vary with intensity, but perceived loudness of a complex sound depends on whether its spectral components are closely or widely spaced in frequency. When generating neural impulses in response to sounds of one frequency, the ear is less sensitive to nearby frequencies, which are said to be in the same critical band. Sounds containing spectral components in many critical bands are perceived as louder even if the total sound pressure remains constant.

Explanation

The perception of loudness is related to sound pressure level (SPL), frequency content and duration of a sound. The human auditory system averages the effects of SPL over a 600–1000 ms interval. A sound of constant SPL will be perceived to increase in loudness as samples of duration 20, 50, 100, 200 ms are heard, up to a duration of about 1 second at which point the perception of loudness will stabilize. For sounds of duration greater than 1 second, the moment-by-moment perception of loudness will be related to the average loudness during the preceding 600–1000 ms.[citation needed]

For sounds having a duration longer than 1 second, the relationship between SPL and loudness of a single tone can be approximated by Stevens’ power law in which SPL has an exponent of 0.6.[a] More precise measurements indicate that loudness increases with a higher exponent at low and high levels and with a lower exponent at moderate levels.[citation needed]

 The horizontal axis shows frequency in Hz

The sensitivity of the human ear changes as a function of frequency, as shown in the equal-loudness graph. Each line on this graph shows the SPL required for frequencies to be perceived as equally loud, and different curves pertain to different sound pressure levels. It also shows that humans with normal hearing are most sensitive to sounds around 2–4 kHz, with sensitivity declining to either side of this region. A complete model of the perception of loudness will include the integration of SPL by frequency.[2]

Historically, loudness was measured using an “ear-balance” audiometer in which the amplitude of a sine wave was adjusted by the user to equal the perceived loudness of the sound being evaluated. Contemporary standards for measurement of loudness are based on summation of energy in critical bands as described in IEC 532, DIN 45631 and ASA/ANSI S3.4. A distinction is made between stationary loudness (sounds that remain sensibly constant) and non-stationary (sound sources that move in space or change amplitude over time.)

Hearing loss

When sensorineural hearing loss (damage to the cochlea or in the brain) is present, the perception of loudness is altered. Sounds at low levels (often perceived by those without hearing loss as relatively quiet) are no longer audible to the hearing impaired, but sounds at high levels often are perceived as having the same loudness as they would for an unimpaired listener. This phenomenon can be explained by two theories: loudness grows more rapidly for these listeners than normal listeners with changes in level. This theory is called “loudness recruitment” and has been accepted as the classical explanation. More recently, it has been proposed that some listeners with sensorineural hearing loss may in fact exhibit a normal rate of loudness growth, but instead have an elevated loudness at their threshold. That is, the softest sound that is audible to these listeners is louder than the softest sound audible to normal listeners. This theory is called “softness imperception”, a term coined by Mary Florentine.[3]

 

無論打算拿 ReSpeaker 4-Mic Array

 

的麥克風做什麼?最好能先知道它的規格。

於是考察其電路圖︰

 

得知使用 SPU0414HR5H-SB 也。

 

依據上面 Data Sheet 所說,是種微機電麥克風哩︰

MEMS

The MEMS (MicroElectrical-Mechanical System) microphone is also called a microphone chip or silicon microphone. A pressure-sensitive diaphragm is etched directly into a silicon wafer by MEMS processing techniques, and is usually accompanied with integrated preamplifier. Most MEMS microphones are variants of the condenser microphone design. Digital MEMS microphones have built in analog-to-digital converter (ADC) circuits on the same CMOS chip making the chip a digital microphone and so more readily integrated with modern digital products. Major manufacturers producing MEMS silicon microphones are Wolfson Microelectronics (WM7xxx) now Cirrus Logic,[30] InvenSense (product line sold by Analog Devices [31]), Akustica (AKU200x), Infineon (SMM310 product), Knowles Electronics, Memstech (MSMx), NXP Semiconductors (division bought by Knowles [32]), Sonion MEMS, Vesper, AAC Acoustic Technologies,[33] and Omron.[34]

More recently[when?], there has been increased interest and research into making piezoelectric MEMS microphones which are a significant architectural and material change from existing condenser style MEMS designs.[35]

……

Omnidirectional

An omnidirectional (or nondirectional) microphone’s response is generally considered to be a perfect sphere in three dimensions. In the real world, this is not the case. As with directional microphones, the polar pattern for an “omnidirectional” microphone is a function of frequency. The body of the microphone is not infinitely small and, as a consequence, it tends to get in its own way with respect to sounds arriving from the rear, causing a slight flattening of the polar response. This flattening increases as the diameter of the microphone (assuming it’s cylindrical) reaches the wavelength of the frequency in question. Therefore, the smallest diameter microphone gives the best omnidirectional characteristics at high frequencies.

The wavelength of sound at 10 kHz is 1.4″ (3.5 cm). The smallest measuring microphones are often 1/4″ (6 mm) in diameter, which practically eliminates directionality even up to the highest frequencies. Omnidirectional microphones, unlike cardioids, do not employ resonant cavities as delays, and so can be considered the “purest” microphones in terms of low coloration; they add very little to the original sound. Being pressure-sensitive they can also have a very flat low-frequency response down to 20 Hz or below. Pressure-sensitive microphones also respond much less to wind noise and plosives than directional (velocity sensitive) microphones.

An example of a nondirectional microphone is the round black eight ball.[37]

───

 

看來語音應用理當沒有問題,卻不知 Hi Fi 錄音如何的呦?!

 

 

 

 

 

 

 

【鼎革‧革鼎】︰ Raspbian Stretch 《六之 I‧導言 》

久居都市早已習慣眼不見星空,耳難得清靜,故爾雖非不知

DoA on ReSpeaker 4-Mic Array for Raspberry Pi

With DoA(Direction of Arrial), ReSpeaker 4-Mic Array is able to find the direction where the sound source is located.

1. setup voice engine

pi@raspberrypi:~ source ~/env/bin/activate                    # activate the virtual, if we have already activated, skip this step (env) pi@raspberrypi:~ cd ~/4mics_hat
(env) pi@raspberrypi:~/4mics_hat sudo apt install libatlas-base-dev     # install snowboy dependencies (env) pi@raspberrypi:~/4mics_hat sudo apt install python-pyaudio        # install pyaudio
(env) pi@raspberrypi:~/4mics_hat pip install ./snowboy*.whl             # install snowboy for KWS (env) pi@raspberrypi:~/4mics_hat pip install ./webrtc*.whl              # install webrtc for DoA
(env) pi@raspberrypi:~/4mics_hat cd ~/ (env) pi@raspberrypi:~ git clone https://github.com/voice-engine/voice-engine
(env) pi@raspberrypi:~ cd voice-engine/ (env) pi@raspberrypi:~/voice-engine python setup.py install

2. Run the demo under virtualenv. Please wake up respeaker with saying snowboy and we will see the direction.

(env) pi@raspberrypi:~/voice-engine cd ~/4mics_hat (env) pi@raspberrypi:~/4mics_hat python kws_doa.py

Play with Alexa, Baidu and Snowboy

1. Get Alexa or Baidu authorization

………

 

之設計目的,惟願先講『響度計』呦◎

 

Ebumeter – Quick guide

Ebumeter provides level metering according to the EBU R-128 recommendation. The current release implements all features required by the EBU document except the oversampled peak level monitoring. This will be added in a future release.

For more detailed info on R-128 see the EBU site or the papers section of my website.

The upper bargraph shows either the Momentary or the Short term loudness as selected by the M and S buttons to the right. The two thinner ones below display the Loudness range (LRA) and the Integrated loudness (I) which are also shown in numerical form.

The +9 and +18 buttons switch between the two ranges required for an EBU-mode meter. The LU and FS buttons select either the relative scale in LU or the absolute one in LUFS.

The Stop, Start and Reset buttons control the Integrated loudness measurement.