Chapter 4 Implement an Alias Suppressed Triangle Wave
Total Page:16
File Type:pdf, Size:1020Kb
國 立 交 通 大 學 工學院聲音與音樂創意科技碩士學位學程 碩 士 論 文 虛擬類比電子琴聲源探討:可運用於聲音合成之 三角波型實作 Virtual Analog Synthesizer Discussion: Implementation of Triangle Wave Used in Sound Synthesis 研 究 生:林育德 指導教授:黃志方 教授 成維華 教授 中 華 民 國 一 百 零 一 年 七 月 虛擬類比電子琴聲源探討: 可運用於聲音合成之三角波型實作 Virtual Analog Synthesizer Discussion: Implementation of Triangle Wave Used in Sound Synthesis 研 究 生:林育德 Student:Yu-Der Lin 指導教授:黃志方 Advisor:Chih-Fang Huang 成維華 Wei-Hua Chieng 國 立 交 通 大 學 工學院聲音與音樂創意科技碩士學位學程 碩 士 論 文 A Thesis Submitted to Master Program of Sound and Music Innovative Technologies College of Engineering National Chiao Tung University in partial Fulfillment of the Requirements for the Degree of Master in Engineering July 2012 Hsinchu, Taiwan, Republic of China 中 華 民 國 一 百 零 一 年 七 月 虛擬類比電子琴聲源探討: 可運用於聲音合成之三角波型實作 學生:林育德 指導教授:黃志方 成維華 國立交通大學工學院聲音與音樂創意科技碩士學位學程 摘要 隨著數位訊號處理的發展,近年來許多用於音樂創作的電腦音源軟體針對早期 產量少、不易取得之類比電子琴進行模擬,將其特有聲響和操作方式以數位形式重 現與普及。此類電子琴運用濾波器過濾一擁有豐富頻率成分的聲源作為聲音設計的 方法,稱之減法合成。減法合成聲源部分以鋸齒波、方波、三角波和正弦波四種基 礎波型最常被使用。虛擬類比電子琴其一重要的議題為找出一有效率的演算法產生 週期性的基礎波型聲源,並在音質方面減少失真現象造成聽覺上的干擾。 眾多以數位產生基礎波型運用於聲音合成的研究中,鋸齒波及方波之生成方法 最常被討論與研究。本論文欲對另一種常用之基礎波型三角波做一探討與模擬。從 正弦波出發,利用一波型成形器塑型後運用濾波器修改諧波大小生成三角波。並使 用聽覺閥和聽覺遮蔽效應兩種聽覺感知模型作為音質評斷方法,判定音質是否失真。 由模擬所得之三角波在此評斷方法下無失真音最高可達G7 (MIDI number 103),涵 蓋了常使用的樂音範圍。在減法合成聲音設計的架構下,許多只運用三角波為初始 聲源的合成聲響可以運用此方法作為聲源產生部分。 關鍵字: 類比電子琴、減法合成、虛擬類比、聲音合成、基礎波型。 i Virtual Analog Synthesizer Discussion: Implementation of Triangle Wave Used in Sound Synthesis Student:Yu-Der Lin Advisor:Chih-Fang Huang Wei-Hua Chieng Master Program of Sound and Music Innovative Technologies National Chiao Tung University Abstract This thesis discuss the source geometric waveforms in early analog synthesizer which use subtractive synthesis as sound designing principle. Implement the classical synthesizer triangle waveforms with reduced aliasing. This method are base on the concept of waveshaping a sine wave and modify the harmonic contents with a filter. Sound quality evaluation using masking effect and hearing threshold models shows that waveshape triangle wave method is perceptually alias-free over almost whole register of the grand piano to note G7 (MIDI number 103). It is applicable in digital implementations of subtractive sound synthesizer. Keywords: Analog Synthesizer, Virtual Analog (V.A), Subtractive Synthesis, Sound Synthesis, Classic Waveforms. ii 致 謝 感謝我的指導教授黃志方、成維華教授。特別感謝黃志方老師支持我朝著喜愛的 題目進行研究。成維華老師的教導不只在研究方面,讓我反省許多問題並且受益 良多。感謝學程的同學、系主任曾毓忠老師以及系辦何小姐一路相伴讓我得以順 利完成學業。感謝我的家人與朋友。 iii Contents Abstract……………………………………………………………………………….i Acknowledgement………………………………………………...…………………iii Contents….……………………...…………………………………………………...iv List of Figures .............................................................................................................. vi List of Tables ................................................................................................................ vi Chapter 1 Introduction .................................................................................................. 1 1.1 Background ................................................................................................... 1 1.2 Research of Virtual Analog Synthesis ........................................................... 2 1.3 Goals and Outline of the Thesis .................................................................... 3 Chapter 2 Subtrctive Synthesis and Virtual Analog ..................................................... 4 2.1 Subtractive Synthesis .................................................................................... 4 2.2 Subtractive Synthesizer ................................................................................. 4 2.2.1 Sound Processing Modules ................................................................... 5 2.2.2 Modulation Modules ............................................................................. 5 2.3 Classic Waveform ......................................................................................... 6 2.3.1 Sawtooth Wave ..................................................................................... 8 2.3.2 Square and Triangle Wave .................................................................... 9 2.4 Digital Implement of Classic Waveform ......................................................... 9 Chapter 3 Algorithms Review .................................................................................... 13 3.1 Lane’s method ................................................................................................ 13 3.2 Differentiate Parabolic Wave ......................................................................... 16 3.3 Differentiate polynomial wave ...................................................................... 18 3.4 Bandlimited Impulse Train (BLIT) ................................................................ 19 3.4.1 Discrete Summation Formula ............................................................. 20 3.4.2 Sum of Windowed Sincs (BLIT-SWS) ............................................... 21 Chapter 4 Implement an Alias Suppressed Triangle wave ......................................... 22 4.1 Nonlinear Waveshaping ................................................................................. 22 4.2 Hyperbolic Tangent Waveshaper ................................................................... 23 4.3 Waveshaper used in Triangle Wave Algorithm .............................................. 24 iv 4.4 Triangle wave algorithm ................................................................................ 26 4.5 Comparison .................................................................................................... 28 4.6 Perceptual Evaluation .................................................................................... 31 Chapter 5 Conclusions and Future Works .................................................................. 34 Bibliography ............................................................................................................... 35 v List of Figures Fig 2-1 Basic form of subtractive synthesis .................................................................. 5 Fig 2-2 Analog VCO module with classic waveforms .................................................. 7 Fig 2-3 Classic waveforms. Sawtooth, triangle, square and sine wave. ....................... 7 Fig 2-4 Sawtooth wave spectrum .................................................................................. 8 Fig 2-5 Modulo counter generating trivial sawtooth. .................................................. 10 Fig 2-6 Aliasing of trivial sawtooth generate using Eq.2. ........................................... 11 Fig 3-1 Block diagram of Lane’s method .................................................................... 13 Fig 3-2 Sawtooth wave and spectrum of Lane’s method ............................................ 15 Fig 3-3 Flow chart of Differential parabolic wave ...................................................... 16 Fig 3-4 Parabolic waveform by squaring the modulo counter. ................................... 17 Fig 3-5 (a) DPW sawtooth wave, 880hz (b)Trivial sawtooth...................................... 18 Fig 3-6 Generate sawtooth wave using Order-N DPW ............................................... 18 Fig 4-1 Hyperbolic tangent function. .......................................................................... 23 Fig 4-2 (a)Sine wave shaped by tanh(x), (b) It’s spectrum. ........................................ 24 Fig 4-3 Plot of Eq.8 with a=0.1 and a=0.9 .................................................................. 25 Fig 4-4 Sine wave distorted by Eq.8. .......................................................................... 26 Fig 4-5 Block diagram of waveshape triangle............................................................. 27 Fig 4-6 Spectrum of waveshape triangle and DPW triangle wave order N=1 to 3. .... 29 Fig 4-7 Block diagrams of waveshape triangle compare to DPW triangle [21]. ........ 30 Fig 4-8 Evaluation of waveshape triangle wave with hearing threshold and masking curve. .............................................................................................................. 33 List of Tables Table 1. Virtual Analog Publications (From Pekonen and Välimäki, 2011.[4])..............2 Table 2. DPW triangle wave order N=1 to 3, [21]. ........................................................ 28 vi Chapter 1 Introduction 1.1 Background Due to the development of digital signal processing (DSP) and continuously increasing computing power of microprocessors, musical tone synthesized by digital computer with various methods like frequency modulation (FM) [1], sampling and wavetable synthesizer [2] [3] both in the category of sample based synthesis became vary popular after 1980s. The futuristic and complex sound of digital synthesis techniques make big difference to the early synthesizers based on analog electronics used subtractive synthesis as their sound production principle. Vintage synth was almost overtaken by digital synthesis for a decade since 1980s. But in the mid-1990s the ”warm“ sound of analog subtractive synthesis started again to show interest by musicians. Research on digital simulation of the early analog synthesizer increased in mid 90s. A term Virtual Analog (V.A) represent the digital simulation of the analog audio devices. Implement subtractive synthesizer on digital domain has many advantages. Heavy analog equipment can be constructed to a smaller size, the tuning drift problem caused by temperature in early voltage controlled oscillator