TWI837867B - Sound compensation method and head-mounted apparatus - Google Patents

Sound compensation method and head-mounted apparatus Download PDF

Info

Publication number
TWI837867B
TWI837867B TW111137995A TW111137995A TWI837867B TW I837867 B TWI837867 B TW I837867B TW 111137995 A TW111137995 A TW 111137995A TW 111137995 A TW111137995 A TW 111137995A TW I837867 B TWI837867 B TW I837867B
Authority
TW
Taiwan
Prior art keywords
transfer function
signal
sound
ideal
test
Prior art date
Application number
TW111137995A
Other languages
Chinese (zh)
Other versions
TW202416009A (en
Inventor
杜博仁
張嘉仁
曾凱盟
Original Assignee
宏碁股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 宏碁股份有限公司 filed Critical 宏碁股份有限公司
Priority to TW111137995A priority Critical patent/TWI837867B/en
Application granted granted Critical
Publication of TWI837867B publication Critical patent/TWI837867B/en
Publication of TW202416009A publication Critical patent/TW202416009A/en

Links

Images

Landscapes

  • Stereophonic System (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

A sound compensation method and a head-mounted apparatus are provided. The original sound signal passed through the compensation transfer function, to output the sound output signal. The receiving difference between the shift output signal and the actual receiving signal is determined. The receiving difference is minimized, so as to adjust the shift transfer function, so that the shift transfer function is closed to the transfer function between the speaker and the microphone. The production of the compensation transfer function and the shift transfer function is the ideal transfer function in the frequency domain. The ideal transfer function is the transfer function between the speaker and the microphone in the ideal environment. The actual receiving signal is obtained by receiving sound on the sound output signal played by the speaker in the actual environment. The shift output signal is the output signal from the shift transfer function by inputting the sound output signal. Accordingly, the listening experience could be improved.

Description

聲音補償方法及頭戴式裝置Sound compensation method and head mounted device

本發明是有關於一種聲音訊號處理,且特別是有關於一種聲音補償方法及頭戴式裝置。 The present invention relates to a sound signal processing, and in particular to a sound compensation method and a head-mounted device.

使用者每次使用耳機或具有揚聲器的頭戴式裝置對於其耳朵有不同的包覆狀況,從而造成低頻(例如是2千赫茲(KHz)以下)有各種不同的洩音情形,進而影響聆聽體驗。例如,圖1是一範例說明洩音情形。請參照圖1,頻率響應101為耳朵被完整包覆的理想狀況。而頻率響應102、103為耳朵未被完整包覆的實際狀況。由此可知,頻率響應102、103在2KHz以下的聲音位準(Sound Pressure Level,SPL)明顯低於頻率響應101。 Each time a user uses headphones or a head-mounted device with speakers, the ears are covered differently, resulting in various sound leakage at low frequencies (e.g., below 2 kHz), which in turn affects the listening experience. For example, FIG1 is an example of sound leakage. Referring to FIG1, frequency response 101 is an ideal condition where the ears are completely covered. Frequency responses 102 and 103 are actual conditions where the ears are not completely covered. It can be seen that the sound pressure level (SPL) of frequency responses 102 and 103 below 2 kHz is significantly lower than that of frequency response 101.

有鑑於此,本發明實施例提供一種聲音補償方法及頭戴式裝置,可透過自適性地修正轉移函數,讓使用者每次聽到的聲音都如同在理想環境下聆聽的聲音。 In view of this, the present invention provides a sound compensation method and a head-mounted device, which can adaptively modify the transfer function so that the sound heard by the user every time is like the sound heard in an ideal environment.

本發明實施例的聲音補償方法適用於頭戴式裝置,且頭戴式裝置包括揚聲器及麥克風。聲音補償方法包括(但不僅限於)下列步驟:將原始聲音訊號通過補償轉移函數,以輸出聲音輸出訊號;決定偏移輸出訊號與實際接收訊號之間的接收訊號差異;將接收訊號差異最小化,並據以調整偏移轉移函數,使偏移轉移函數接近真實環境中揚聲器至麥克風之間的轉移函數。補償轉移函數與偏移轉移函數在頻域的乘積是理想轉移函數,且理想轉移函數是在測試環境中揚聲器至麥克風之間的轉移函數。實際接收訊號是在真實環境中實際對播放聲音輸出訊號的揚聲器收音所得,且偏移輸出訊號是聲音輸出訊號通過偏移轉移函數的輸出訊號。 The sound compensation method of the embodiment of the present invention is applicable to a head-mounted device, and the head-mounted device includes a speaker and a microphone. The sound compensation method includes (but is not limited to) the following steps: passing the original sound signal through a compensation transfer function to output a sound output signal; determining the received signal difference between the offset output signal and the actual received signal; minimizing the received signal difference and adjusting the offset transfer function accordingly so that the offset transfer function is close to the transfer function between the speaker and the microphone in the real environment. The product of the compensation transfer function and the offset transfer function in the frequency domain is an ideal transfer function, and the ideal transfer function is the transfer function between the speaker and the microphone in the test environment. The actual received signal is the sound received by the speaker that plays the sound output signal in a real environment, and the offset output signal is the output signal of the sound output signal after the offset transfer function is applied.

本發明實施例的頭戴式裝置包括(但不僅限於)麥克風、揚聲器、記憶體及處理器。記憶體用以儲存程式碼。處理器耦接麥克風、揚聲器及記憶體。處理器經配置用以載入且執行程式碼以:將原始聲音訊號通過補償轉移函數,以輸出聲音輸出訊號;決定偏移輸出訊號與實際接收訊號之間的接收訊號差異;將接收訊號差異最小化,並據以調整偏移轉移函數,使偏移轉移函數接近真實環境中揚聲器至麥克風之間的轉移函數。補償轉移函數與偏移轉移函數在頻域的乘積是理想轉移函數,且理想轉移函數是在測試環境中揚聲器至麥克風之間的轉移函數。實際接收訊號是在真實環境中實際對播放聲音輸出訊號的揚聲器收音所得,且偏移輸出訊號是聲音輸出訊號通過偏移轉移函數的輸出訊號。 The head mounted device of the embodiment of the present invention includes (but is not limited to) a microphone, a speaker, a memory and a processor. The memory is used to store program codes. The processor is coupled to the microphone, the speaker and the memory. The processor is configured to load and execute program codes to: pass the original sound signal through the compensation transfer function to output the sound output signal; determine the received signal difference between the offset output signal and the actual received signal; minimize the received signal difference and adjust the offset transfer function accordingly so that the offset transfer function is close to the transfer function between the speaker and the microphone in the real environment. The product of the compensation transfer function and the offset transfer function in the frequency domain is the ideal transfer function, and the ideal transfer function is the transfer function between the speaker and the microphone in the test environment. The actual received signal is the sound received by the speaker that actually plays the sound output signal in the real environment, and the offset output signal is the output signal of the sound output signal through the offset transfer function.

基於上述,依據本發明實施例的聲音補償方法及頭戴式 裝置,透過最小化偏移輸出訊號及實際接收訊號之間的接收訊號差異來估測偏移轉移函數,使實際接收訊號可逼近測試環境下接收到的聲音訊號。使用者不用刻意調整頭戴式裝置的配戴條件,即可獲得較好的聆聽體驗。 Based on the above, according to the sound compensation method and head-mounted device of the embodiment of the present invention, the offset transfer function is estimated by minimizing the difference between the offset output signal and the actual received signal, so that the actual received signal can be close to the sound signal received in the test environment. The user does not need to deliberately adjust the wearing conditions of the head-mounted device to obtain a better listening experience.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。 In order to make the above features and advantages of the present invention more clearly understood, the following is a detailed description of the embodiments with the accompanying drawings.

101~103:頻率響應 101~103: Frequency response

10:頭戴式裝置 10: Head-mounted device

11:麥克風 11: Microphone

12:揚聲器 12: Speaker

13:記憶體 13: Memory

14:處理器 14: Processor

Er:人耳 Er: Human ear

S310~S330、S510~S530、S710~S730:步驟 S310~S330, S510~S530, S710~S730: Steps

s(n):原始聲音訊號 s(n): original sound signal

yC(n):聲音輸出訊號 y C (n): Sound output signal

WC(z):補償轉移函數 W C (z): compensation transfer function

WO(z):理想轉移函數 W O (z): ideal transfer function

WH(z):偏移轉移函數 W H (z): offset transfer function

H(z)、HO(z):真實轉移函數 H(z), H O (z): true transfer function

ts(n):測試聲音訊號 ts(n): test sound signal

tm(n):測試接收訊號 tm(n): Test received signal

y(n):模擬聲音訊號 y(n): analog sound signal

e(n):測試訊號差異 e(n): Test signal difference

eH(n):接收訊號差異 e H (n): Received signal difference

yH(n):偏移輸出訊號 y H (n): offset output signal

dC(n):理想接收訊號 d C (n): ideal received signal

eC(n):理想訊號差異 e C (n): ideal signal difference

m(n):實際接收訊號 m(n): Actual received signal

圖1是一範例說明洩音情形。 Figure 1 is an example of a sound leakage situation.

圖2A是依據本發明一實施例的頭戴式裝置的元件方塊圖。 FIG2A is a block diagram of components of a head mounted device according to an embodiment of the present invention.

圖2B是依據本發明一實施例的頭戴式裝置的示意圖。 Figure 2B is a schematic diagram of a head-mounted device according to an embodiment of the present invention.

圖3是依據本發明一實施例的聲音補償方法的流程圖。 Figure 3 is a flow chart of a sound compensation method according to an embodiment of the present invention.

圖4是依據本發明一實施例的聲音補償的訊號處理的示意圖。 FIG4 is a schematic diagram of signal processing for sound compensation according to an embodiment of the present invention.

圖5是依據本發明一實施例的決定理想轉移函數的流程圖。 FIG5 is a flow chart of determining an ideal transfer function according to an embodiment of the present invention.

圖6是依據本發明一實施例的訊號處理的示意圖。 Figure 6 is a schematic diagram of signal processing according to an embodiment of the present invention.

圖7是依據本發明一實施例的調整補償轉移函數的流程圖。 Figure 7 is a flow chart of adjusting the compensation transfer function according to an embodiment of the present invention.

圖8是依據本發明一實施例的訊號處理的示意圖。 FIG8 is a schematic diagram of signal processing according to an embodiment of the present invention.

圖2A是依據本發明一實施例的頭戴式裝置10的元件方塊圖。請參照圖2A,頭戴式裝置10數位眼鏡(或稱智慧眼鏡)、頭 戴式顯示器(Head-Mounted Display,HMD)、虛擬/擴增/混合實境裝置、耳罩/頭戴式耳機或其他供人類頭部配戴的電子裝置。頭戴式裝置10包括但不僅限於一個或更多個麥克風11、一個或更多個揚聲器12、記憶體13及處理器14。 FIG2A is a block diagram of components of a head-mounted device 10 according to an embodiment of the present invention. Referring to FIG2A , the head-mounted device 10 is a digital glasses (or smart glasses), a head-mounted display (HMD), a virtual/augmented/mixed reality device, an earmuff/headphone, or other electronic device for human head wear. The head-mounted device 10 includes but is not limited to one or more microphones 11, one or more speakers 12, a memory 13, and a processor 14.

麥克風11可以是動圈式(dynamic)、電容式(Condenser)、或駐極體電容(Electret Condenser)等類型的麥克風,麥克風11也可以是其他可接收聲波(例如,人聲、環境聲、機器運作聲等)而轉換為聲音訊號的電子元件、類比至數位轉換器、濾波器、及音訊處理器之組合。在一實施例中,麥克風11可設於頭戴式裝置10的第一側及第二側(例如,左、右兩側)。 The microphone 11 may be a dynamic, condenser, or electroconductor condenser microphone. The microphone 11 may also be a combination of other electronic components that can receive sound waves (e.g., human voice, ambient sound, machine operation sound, etc.) and convert them into sound signals, analog-to-digital converters, filters, and audio processors. In one embodiment, the microphone 11 may be disposed on the first side and the second side (e.g., the left and right sides) of the head-mounted device 10.

揚聲器12可以是喇叭或擴音器。 The speaker 12 may be a speaker or a loudspeaker.

記憶體13可以是任何型態的固定或可移動隨機存取記憶體(Radom Access Memory,RAM)、唯讀記憶體(Read Only Memory,ROM)、快閃記憶體(flash memory)、傳統硬碟(Hard Disk Drive,HDD)、固態硬碟(Solid-State Drive,SSD)或類似元件。在一實施例中,記憶體13用以儲存程式碼、軟體模組、資料(例如,聲音訊號、訊號差異、或轉移函數)或檔案,其詳細內容待後續實施例詳述。 The memory 13 can be any type of fixed or removable random access memory (RAM), read only memory (ROM), flash memory, traditional hard disk drive (HDD), solid-state drive (SSD) or similar components. In one embodiment, the memory 13 is used to store program code, software modules, data (e.g., sound signals, signal differences, or transfer functions) or files, and its details will be described in detail in subsequent embodiments.

處理器14耦接麥克風11、揚聲器12及記憶體13。處理器14可以是中央處理單元(Central Processing Unit,CPU),或是其他可程式化之一般用途或特殊用途的微處理器(Microprocessor)、數位信號處理器(Digital Signal Processor,DSP)、可程式化控制器、特殊應用積體電路(Application-Specific Integrated Circuit,ASIC) 或其他類似元件或上述元件的組合。在一實施例中,處理器14用以執行頭戴式裝置10的所有或部份作業,且可載入並執行記憶體13所儲存的程式碼、軟體模組、檔案及/或資料。在一些實施例中,記憶體13所記錄的那些軟體模組或程式碼也可能是實體電路所實現。 The processor 14 is coupled to the microphone 11, the speaker 12 and the memory 13. The processor 14 can be a central processing unit (CPU), or other programmable general-purpose or special-purpose microprocessor (Microprocessor), digital signal processor (Digital Signal Processor, DSP), programmable controller, application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC) or other similar components or combinations of the above components. In one embodiment, the processor 14 is used to execute all or part of the operations of the head-mounted device 10, and can load and execute the program code, software module, file and/or data stored in the memory 13. In some embodiments, the software modules or program codes recorded in the memory 13 may also be implemented by physical circuits.

圖2B是依據本發明一實施例的頭戴式裝置10的示意圖。請參照圖2B,頭戴式裝置10被配戴時,一側的麥克風11大致位於人耳Er與揚聲器12之間。須說明的是,麥克風11的設置位置可能是在頭戴式裝置10被配戴時接近於人耳Er,例如麥克風11與人耳Er相距1或2公分以內,以符合人耳Er收音的情況。然而,應用者仍可視實際需求而改變麥克風11的設置位置。 FIG2B is a schematic diagram of a head-mounted device 10 according to an embodiment of the present invention. Referring to FIG2B , when the head-mounted device 10 is worn, the microphone 11 on one side is roughly located between the human ear Er and the speaker 12. It should be noted that the microphone 11 may be located close to the human ear Er when the head-mounted device 10 is worn, for example, the microphone 11 is within 1 or 2 cm from the human ear Er to meet the situation of the human ear Er receiving sound. However, the user can still change the location of the microphone 11 according to actual needs.

下文中,將搭配頭戴式裝置10中的各項元件、模組及訊號說明本發明實施例所述之方法。本方法的各個流程可依照實施情形而隨之調整,且並不僅限於此。 In the following, the method described in the embodiment of the present invention will be described with the components, modules and signals in the head mounted device 10. The various processes of the method can be adjusted according to the implementation situation, but are not limited to this.

圖3是依據本發明一實施例的聲音補償方法的流程圖。請參照圖3,處理器14將原始聲音訊號通過補償轉移函數,以輸出聲音輸出訊號(步驟S310)。具體而言,原始聲音訊號可以是任何音樂、演講、環境聲音或測試聲音。原始聲音訊號可直接透過揚聲器12播放。然而,為了提升聆聽體驗,本發明實施例對原始聲音訊號進行處理。訊號通過補償轉移函數可理解成,在頻域(frequency domain)上訊號與補償轉移函數相乘或內積,或在時域(time domain)上進行卷積運算。舉例而言,圖4是依據本發明一實 施例的聲音補償的訊號處理的示意圖。請參照圖4,原始聲音訊號s(n)通過補償轉移函數WC(z)的輸出為聲音輸出訊號yC(n)。也就是,YC(z)=S(z).WC(z),其中S(z)為原始聲音訊號的頻率響應,且YC(z)為聲音輸出訊號的頻率響應。 FIG3 is a flow chart of a sound compensation method according to an embodiment of the present invention. Referring to FIG3 , the processor 14 passes the original sound signal through a compensation transfer function to output a sound output signal (step S310). Specifically, the original sound signal can be any music, speech, ambient sound or test sound. The original sound signal can be played directly through the speaker 12. However, in order to enhance the listening experience, the embodiment of the present invention processes the original sound signal. The signal can be understood as passing through the compensation transfer function, that is, the signal is multiplied or producted with the compensation transfer function in the frequency domain, or a convolution operation is performed in the time domain. For example, FIG4 is a schematic diagram of signal processing of sound compensation according to an embodiment of the present invention. Referring to FIG4, the original sound signal s(n) is output as a sound output signal yC (n) through the compensation transfer function WC (z). That is, YC (z)=S(z)· WC (z), where S(z) is the frequency response of the original sound signal, and YC (z) is the frequency response of the sound output signal.

此外,補償轉移函數與偏移轉移函數在頻域的乘積是理想轉移函數。也就是,理想轉移函數除以偏移轉移函數可得到補償轉移函數。以數學函數而言,WC(z)=WO(z)/WH(z)...(1),其中WC(z)為補償轉移函數,WO(z)為理想轉移函數,且WH(z)為偏移轉移函數。補償轉移函數是用於補償理想訊號與真實訊號之間的差異。偏移轉移函數是估測在實際環境中揚聲器12至麥克風11之間的轉移函數。實際環境可以是客廳、辦公室、戶外或使用者其他配戴頭戴式裝置10的環境。而理想轉移函數是在測試環境中揚聲器12至麥克風11之間的轉移函數。測試環境(或稱理想環境)是實驗室(例如,無響室)、密閉空間或無障礙物的環境。 In addition, the product of the compensation transfer function and the offset transfer function in the frequency domain is the ideal transfer function. That is, the ideal transfer function divided by the offset transfer function can obtain the compensation transfer function. In terms of mathematical functions, W C (z) = W O (z) / W H (z) ... (1), where W C (z) is the compensation transfer function, W O (z) is the ideal transfer function, and W H (z) is the offset transfer function. The compensation transfer function is used to compensate for the difference between the ideal signal and the real signal. The offset transfer function is an estimate of the transfer function between the speaker 12 and the microphone 11 in the actual environment. The actual environment may be a living room, an office, outdoors, or other environment where the user wears the head mounted device 10. The ideal transfer function is the transfer function between the speaker 12 and the microphone 11 in the test environment. The test environment (or ideal environment) is a laboratory (e.g., an anechoic room), a closed space, or an environment without obstacles.

圖5是依據本發明一實施例的決定理想轉移函數的流程圖。請參照圖5,在一實施例中,在測試環境中,處理器14可透過揚聲器12播放測試聲音訊號(步驟S510)。測試聲音訊號可以是白噪音、粉紅噪音或用於測試的其他聲音訊號。 FIG5 is a flow chart of determining an ideal transfer function according to an embodiment of the present invention. Referring to FIG5, in an embodiment, in a test environment, the processor 14 may play a test sound signal through the speaker 12 (step S510). The test sound signal may be white noise, pink noise, or other sound signals used for testing.

處理器14可決定模擬聲音訊號與測試接收訊號之間的測試訊號差異(步驟S520)。舉例而言,圖6是依據本發明一實施例的訊號處理的示意圖。請參照圖6,測試接收訊號tm(n)是在這測 試環境中透過麥克風11實際對播放測試聲音訊號ts(n)的揚聲器12收音所得的聲音訊號。模擬聲音訊號y(n)是測試聲音訊號ts(n)通過理想轉移函數WO(z)所得的聲音訊號。此外,測試訊號差異e(n)為測試接收訊號tm(n)與模擬聲音訊號y(n)的差異。例如,e(n)=tm(n)-y(n)。 The processor 14 may determine a test signal difference between the analog sound signal and the test received signal (step S520). For example, FIG6 is a schematic diagram of signal processing according to an embodiment of the present invention. Referring to FIG6 , the test received signal tm(n) is a sound signal obtained by actually receiving the speaker 12 that plays the test sound signal ts(n) through the microphone 11 in this test environment. The analog sound signal y(n) is a sound signal obtained by passing the test sound signal ts(n) through the ideal transfer function W O (z). In addition, the test signal difference e(n) is the difference between the test received signal tm(n) and the analog sound signal y(n). For example, e(n)=tm(n)-y(n).

請參照圖5,處理器14可將測試訊號差異最小化,並據以決定理想轉移函數(步驟S530)。處理器14可利用權重更新演算法來決定理想轉移函數。權重更新演算法有很多種。以最小均方(Least Mean Square,LMS)為例,其時域的表示為:W O (z,n+1)=W O (z,n)+μ O .ts(n).e(n)...(2)WO(z,n)為當前的理想轉移函數,WO(z,n+1)為調整的理想轉移函數,μ 0為常數(代表更新步階大小/步長,並影響收斂的準確度及速度),ts(n)為測試聲音訊號,e(n)為測試訊號差異。WO(z,n)與WO(z,n+1)對應到不同取樣時間點的理想轉移函數。例如,n+1是n的下一個取樣時間點。然而,本發明實施例不加以限制取樣頻率。而理想轉移函數收斂時,將接近或等於測試環境中揚聲器12至麥克風11之間的真實轉移函數HO(z)。處理器14可將求得的理想轉移函數儲存在記憶體13,以供後續使用。 Please refer to FIG. 5 , the processor 14 can minimize the test signal difference and determine the ideal transfer function accordingly (step S530). The processor 14 can use a weight update algorithm to determine the ideal transfer function. There are many weight update algorithms. Taking the Least Mean Square (LMS) as an example, its time domain representation is: W O ( z,n +1) = W O ( z,n ) + μ O . ts(n) . e ( n ) ... (2) W O (z,n) is the current ideal transfer function, W O (z,n+1) is the adjusted ideal transfer function, μ 0 is a constant (representing the update step size/step length, and affecting the accuracy and speed of convergence), ts(n) is the test sound signal, and e(n) is the test signal difference. W O (z,n) and W O (z,n+1) correspond to ideal transfer functions at different sampling time points. For example, n +1 is the next sampling time point of n . However, the embodiment of the present invention does not limit the sampling frequency. When the ideal transfer function converges, it will be close to or equal to the real transfer function HO (z) between the speaker 12 and the microphone 11 in the test environment. The processor 14 can store the obtained ideal transfer function in the memory 13 for subsequent use.

須說明的是,在其他實施例中,權重更新演算法也可能是基於訊號差異(作為誤差)的誤差最佳化(最小化)演算法。例如,最小均方(Least Square,LS)、或最小均方誤差估測演算法(Minimum Mean Square Error,MMSE)等演算法。 It should be noted that in other embodiments, the weight update algorithm may also be an error optimization (minimization) algorithm based on the signal difference (as error). For example, the least mean square (LS) or the minimum mean square error estimation algorithm (MMSE) and other algorithms.

在另一實施例中,處理器14可能透過下載或接收使用者的操作,以取得理想轉移函數。或者,已預先定義理想轉移函數。 In another embodiment, the processor 14 may obtain the ideal transfer function by downloading or receiving the user's operation. Alternatively, the ideal transfer function has been predefined.

請參照圖3,處理器14透過揚聲器12播放聲音輸出訊號。此外,處理器14決定偏移輸出訊號與實際接收訊號之間的接收訊號差異(步驟S320)。具體而言,實際接收訊號是在真實環境中透過麥克風11實際對播放聲音輸出訊號的揚聲器12收音所得的聲音訊號。偏移輸出訊號是聲音輸出訊號通過偏移轉移函數的輸出訊號。以圖4為例,聲音輸出訊號yC(n)通過偏移轉移函數WH(z)的輸出為偏移輸出訊號yH(n)。也就是,YH(z)=YC(z).WH(z),其中YC為聲音輸出訊號的頻率響應,且YH(z)為偏移輸出訊號的頻率響應。此外,接收訊號差異eH(n)為實際接收訊號m(n)與偏移輸出訊號yH(n)的差異。例如,eH(n)=m(n)-yH(n)。 Referring to FIG3 , the processor 14 plays the sound output signal through the speaker 12. In addition, the processor 14 determines the received signal difference between the offset output signal and the actual received signal (step S320). Specifically, the actual received signal is the sound signal actually received by the speaker 12 that plays the sound output signal through the microphone 11 in a real environment. The offset output signal is the output signal of the sound output signal through the offset transfer function. Taking FIG4 as an example, the output of the sound output signal y C (n) through the offset transfer function W H (z) is the offset output signal y H (n). That is, Y H (z)=Y C (z). W H (z), where Y C is the frequency response of the sound output signal, and Y H (z) is the frequency response of the offset output signal. In addition, the received signal difference e H (n) is the difference between the actual received signal m (n) and the offset output signal y H (n). For example, e H (n) = m (n) - y H (n).

請參照圖3,處理器14將接收訊號差異最小化,並據以調整偏移轉移函數(步驟S330),使偏移轉移函數接近真實環境中揚聲器12至麥克風11之間的轉移函數。具體而言,處理器14可利用權重更新演算法來決定新的偏移轉移函數。權重更新演算法以LMS為例,其時域的表示為:W H (z,n+1)=W H (z,n)+μ H y C (n).e H (n)...(3)WH(z,n)為當前的偏移轉移函數,WH(z,n+1)為調整的偏移轉移函數,μ H為常數(代表更新步階大小/步長,並影響收斂的準確度及速度),yc(n)為聲音輸出訊號,eH(n)為接收訊號差異。WH(z,n)與WH(z,n+1)對應到不同取樣時間點的偏移轉移函數。而偏移轉移函 數收斂時,將接近或等於真實環境中揚聲器12至麥克風11之間的真實轉移函數H(z)。處理器14可將求得的偏移轉移函數儲存在記憶體13,以供後續使用。而基於新的偏移轉移函數的聲音輸出訊號經揚聲器12播放後,將可讓使用者領聽到如同在測試環境中播放的聲音訊號。 3, the processor 14 minimizes the received signal difference and adjusts the offset transfer function accordingly (step S330) so that the offset transfer function is close to the transfer function between the speaker 12 and the microphone 11 in the real environment. Specifically, the processor 14 can use a weight update algorithm to determine a new offset transfer function. The weight update algorithm takes LMS as an example, and its time domain representation is: W H ( z,n +1) = W H ( z,n ) + μ H. y C ( n ). e H ( n )...(3)W H (z,n) is the current offset transfer function, W H (z,n+1) is the adjusted offset transfer function, μ H is a constant (representing the update step size/step length and affecting the accuracy and speed of convergence), y c (n) is the sound output signal, and e H (n) is the received signal difference. W H (z,n) and W H (z,n+1) correspond to the offset transfer functions at different sampling time points. When the offset transfer function converges, it will be close to or equal to the real transfer function H(z) between the speaker 12 and the microphone 11 in the real environment. The processor 14 can store the obtained offset transfer function in the memory 13 for subsequent use. After the sound output signal based on the new offset transfer function is played through the speaker 12, the user can hear the sound signal as if it were played in the test environment.

須說明的是,在其他實施例中,權重更新演算法也可能是基於訊號差異(作為誤差)的誤差最佳化(最小化)演算法。例如,LS、或MMSE演算法。 It should be noted that in other embodiments, the weight update algorithm may also be an error optimization (minimization) algorithm based on the signal difference (as error). For example, LS or MMSE algorithm.

在一實施例中,為了避免無限脈衝響應(Infinite Impulse Response,IIR)系統造成的不穩定狀態,本發明實施例更提出了有限脈衝響應(Finite Impulse Response,FIR)系統。 In one embodiment, in order to avoid the unstable state caused by the infinite impulse response (IIR) system, the embodiment of the present invention further proposes a finite impulse response (FIR) system.

圖7是依據本發明一實施例的調整補償轉移函數的流程圖。請參照圖7,處理器14可將原始聲音訊號通過理想轉移函數,以輸出理想接收訊號(步驟S710)。也就是,理想接收訊號是原始聲音訊號通過理想轉移函數的輸出訊號。舉例而言,圖8是依據本發明一實施例的訊號處理的示意圖。請參照圖8,原始聲音訊號s(n)通過理想轉移函數WO(z)的輸出為理想接收訊號dC(n)。也就是,DC(z)=S(z).WO(z),其中S(z)為原始聲音訊號的頻率響應,且DC(z)為理想接收訊號的頻率響應。 FIG. 7 is a flow chart of adjusting the compensation transfer function according to an embodiment of the present invention. Referring to FIG. 7 , the processor 14 may pass the original sound signal through the ideal transfer function to output the ideal received signal (step S710). That is, the ideal received signal is the output signal of the original sound signal through the ideal transfer function. For example, FIG. 8 is a schematic diagram of signal processing according to an embodiment of the present invention. Referring to FIG. 8 , the output of the original sound signal s(n) through the ideal transfer function WO (z) is the ideal received signal dC (n). That is, dC (z)=S(z)· WO (z), where S(z) is the frequency response of the original sound signal, and dC (z) is the frequency response of the ideal received signal.

請參照圖7,處理器14可決定理想接收訊號與實際接收訊號之間的理想訊號差異(步驟S720)。具體而言,以圖8為例,理想訊號差異eC(n)為理想接收訊號dC(n)與實際接收訊號m(n)的 差異。例如,eC(n)=dC(n)-m(n)。 7 , the processor 14 may determine an ideal signal difference between the ideal received signal and the actual received signal (step S720). Specifically, taking FIG8 as an example, the ideal signal difference e C (n) is the difference between the ideal received signal d C (n) and the actual received signal m (n). For example, e C (n) = d C (n) - m (n).

請參照圖7,處理器14可將理想訊號差異最小化,並據以調整補償轉移函數(步驟S730)。處理器14可利用權重更新演算法來決定新的補償轉移函數。權重更新演算法以LMS為例,其時域的表示為:W C (z,n+1)=W C (z,n)+μ C W H (z,n).s(n).e C (n)...(4)WC(z,n)為當前的補償轉移函數,WC(z,n+1)為調整的補償轉移函數,μ C為常數(代表更新步階大小/步長,並影響收斂的準確度及速度),s(n)為原始聲音訊號,eC(n)為理想訊號差異。WC(z,n)與WC(z,n+1)對應到不同取樣時間點的補償轉移函數。而補償轉移函數收斂時,偏移轉移函數將接近或等於真實環境中揚聲器12至麥克風11之間的真實轉移函數H(z)。處理器14可將求得的補償移轉移函數儲存在記憶體13,以供後續使用。而基於新的補償轉移函數的聲音輸出訊號經揚聲器12播放後,將可讓使用者領聽到如同在測試環境中播放的聲音訊號。 Referring to FIG. 7 , the processor 14 can minimize the ideal signal difference and adjust the compensation transfer function accordingly (step S730). The processor 14 can use a weight update algorithm to determine a new compensation transfer function. The weight update algorithm takes LMS as an example, and its time domain representation is: W C ( z,n +1) = W C ( z,n ) + μ C W H ( z,n ) . s(n) . e C ( n ) ... (4) W C (z,n) is the current compensation transfer function, W C (z,n+1) is the adjusted compensation transfer function, μ C is a constant (representing the update step size/step length, and affecting the accuracy and speed of convergence), s(n) is the original sound signal, and e C (n) is the ideal signal difference. W C (z,n) and W C (z,n+1) correspond to compensation transfer functions at different sampling time points. When the compensation transfer function converges, the offset transfer function will be close to or equal to the real transfer function H(z) between the speaker 12 and the microphone 11 in the real environment. The processor 14 can store the obtained compensation transfer function in the memory 13 for subsequent use. After the sound output signal based on the new compensation transfer function is played through the speaker 12, the user can hear the sound signal as if it were played in the test environment.

須說明的是,在其他實施例中,權重更新演算法也可能是基於訊號差異(作為誤差)的誤差最佳化(最小化)演算法。例如,LS、或MMSE演算法。 It should be noted that in other embodiments, the weight update algorithm may also be an error optimization (minimization) algorithm based on the signal difference (as error). For example, LS or MMSE algorithm.

綜上所述,在本發明實施例的聲音補償方法及頭戴式裝置中,建立理想轉移函數,即時量測真實環境中的偏移轉移函數,並據以得出補償轉移函數。原始聲音訊號經過補償轉移函數調整,即可讓聆聽者如同在理想環境中聆聽原始聲音訊號。藉此,可提升 聆聽體驗。 In summary, in the sound compensation method and head-mounted device of the embodiment of the present invention, an ideal transfer function is established, the offset transfer function in the real environment is measured in real time, and the compensation transfer function is obtained accordingly. The original sound signal is adjusted by the compensation transfer function, so that the listener can listen to the original sound signal as if in an ideal environment. In this way, the listening experience can be improved.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。 Although the present invention has been disclosed as above by the embodiments, it is not intended to limit the present invention. Anyone with ordinary knowledge in the relevant technical field can make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of the attached patent application.

S310~S330:步驟 S310~S330: Steps

Claims (8)

一種聲音補償方法,適用於一頭戴式裝置,該頭戴式裝置包括一揚聲器及一麥克風,該聲音補償方法包括:將一原始聲音訊號通過一補償轉移函數,以輸出一聲音輸出訊號,其中該補償轉移函數與一偏移轉移函數在頻域的乘積是一理想轉移函數,且該理想轉移函數是在一測試環境中該揚聲器至該麥克風之間的轉移函數;決定一偏移輸出訊號與一實際接收訊號之間的一接收訊號差異,其中該實際接收訊號是在一真實環境中實際對播放該聲音輸出訊號的該揚聲器收音所得,且該偏移輸出訊號是該聲音輸出訊號通過該偏移轉移函數的輸出訊號;將該接收訊號差異最小化,並據以調整該偏移轉移函數,使該偏移轉移函數接近該真實環境中該揚聲器至該麥克風之間的轉移函數;將該原始聲音訊號通過該理想轉移函數,以輸出一理想接收訊號;決定該理想接收訊號與該實際接收訊號之間的一理想訊號差異;以及將該理想訊號差異最小化,並據以調整該補償轉移函數。 A sound compensation method is applicable to a head-mounted device, the head-mounted device including a speaker and a microphone, the sound compensation method comprising: passing an original sound signal through a compensation transfer function to output a sound output signal, wherein the product of the compensation transfer function and an offset transfer function in the frequency domain is an ideal transfer function, and the ideal transfer function is a transfer function between the speaker and the microphone in a test environment; determining a received signal difference between an offset output signal and an actual received signal, wherein the actual received signal is a signal of an actual playback in a real environment; The sound output signal is obtained by the speaker receiving the sound, and the offset output signal is the output signal of the sound output signal through the offset transfer function; the received signal difference is minimized, and the offset transfer function is adjusted accordingly to make the offset transfer function close to the transfer function between the speaker and the microphone in the real environment; the original sound signal passes through the ideal transfer function to output an ideal received signal; an ideal signal difference between the ideal received signal and the actual received signal is determined; and the ideal signal difference is minimized, and the compensation transfer function is adjusted accordingly. 如請求項1所述的聲音補償方法,其中將該接收訊號差異最小化的數學函數為:W H (z,n+1)=W H (z,n)+μ H y C (n).e H (n), WH(z,n)為當前的偏移轉移函數,WH(z,n+1)為調整的偏移轉移函數,μ H為常數,yc(n)為該聲音輸出訊號,eH(n)為該接收訊號差異。 As described in claim 1, the mathematical function that minimizes the received signal difference is: W H ( z,n +1) = W H ( z,n )+ μ H y C ( n ) . e H ( n ), W H (z,n) is the current offset transfer function, W H (z,n+1) is the adjusted offset transfer function, μ H is a constant, y c (n) is the sound output signal, and e H (n) is the received signal difference. 如請求項1所述的聲音補償方法,其中將該理想訊號差異最小化的數學函數為:W C (z,n+1)=W C (z,n)+μ C W H (z,n).s(n).e C (n),WH(z,n)為當前的偏移轉移函數,WC(z,n)為當前的補償轉移函數,WC(z,n+1)為調整的補償轉移函數,μ C為常數,s(n)為該原始聲音訊號,eC(n)為該理想訊號差異。 The sound compensation method as described in claim 1, wherein the mathematical function that minimizes the ideal signal difference is: W C ( z,n +1) = W C ( z,n ) + μ C W H ( z,n ) . s(n) . e C ( n ), W H (z,n) is the current offset transfer function, W C (z,n) is the current compensation transfer function, W C (z,n+1) is the adjusted compensation transfer function, μ C is a constant, s(n) is the original sound signal, and e C (n) is the ideal signal difference. 如請求項1所述的聲音補償方法,更包括:在該測試環境中,透過該揚聲器播放一測試聲音訊號;決定一模擬聲音訊號與一測試接收訊號之間的一測試訊號差異,其中該測試接收訊號是在該測試環境中實際對播放該測試聲音訊號的該揚聲器收音所得,且該模擬聲音訊號是該測試聲音訊號通過該理想轉移函數所得;以及將該測試訊號差異最小化,並據以決定該理想轉移函數。 The sound compensation method as described in claim 1 further includes: in the test environment, playing a test sound signal through the speaker; determining a test signal difference between a simulated sound signal and a test received signal, wherein the test received signal is actually received by the speaker playing the test sound signal in the test environment, and the simulated sound signal is obtained by the test sound signal passing through the ideal transfer function; and minimizing the test signal difference and determining the ideal transfer function accordingly. 一種頭戴式裝置,包括:一麥克風;一揚聲器;一記憶體,用以儲存一程式碼;以及一處理器,耦接該麥克風、該揚聲器及該記憶體,經配置用以載入且執行該程式碼以: 將一原始聲音訊號通過一補償轉移函數,以輸出一聲音輸出訊號,其中該補償轉移函數與一偏移轉移函數在頻域的乘積是一理想轉移函數,且該理想轉移函數是在一測試環境中該揚聲器至該麥克風之間的轉移函數;決定一偏移輸出訊號與一實際接收訊號之間的一接收訊號差異,其中該實際接收訊號是在一真實環境中透過該麥克風實際對播放該聲音輸出訊號的該揚聲器收音所得,且該偏移輸出訊號是該聲音輸出訊號通過該偏移轉移函數的輸出訊號;以及將該接收訊號差異最小化,並據以調整該偏移轉移函數,使該偏移轉移函數接近該真實環境中該揚聲器至該麥克風之間的轉移函數,其中該處理器更經配置用以:將該原始聲音訊號通過該理想轉移函數,以輸出一理想接收訊號;決定該理想接收訊號與該實際接收訊號之間的一理想訊號差異;以及將該理想訊號差異最小化,並據以調整該補償轉移函數。 A head mounted device includes: a microphone; a speaker; a memory for storing a program code; and a processor coupled to the microphone, the speaker and the memory, configured to load and execute the program code to: pass an original sound signal through a compensation transfer function to output a sound output signal, wherein the product of the compensation transfer function and an offset transfer function in the frequency domain is an ideal transfer function, and the ideal transfer function is a transfer function between the speaker and the microphone in a test environment; determine a received signal difference between an offset output signal and an actual received signal, wherein the actual received signal is a signal transmitted through a real environment; The processor is further configured to: pass the original sound signal through the ideal transfer function to output an ideal received signal; determine an ideal signal difference between the ideal received signal and the actual received signal; and minimize the ideal signal difference and adjust the compensation transfer function accordingly. 如請求項5所述的頭戴式裝置,其中將該接收訊號差異最小化的數學函數為:W H (z,n+1)=W H (z,n)+μ H y C (n).e H (n),WH(z,n)為當前的偏移轉移函數,WH(z,n+1)為調整的偏移轉移函數,μ H為常數,yc(n)為該聲音輸出訊號,eH(n)為該接收訊號差異。 A head-mounted device as described in claim 5, wherein the mathematical function that minimizes the received signal difference is: W H ( z,n +1) = W H ( z,n )+ μ H y C ( n ) . e H ( n ), W H (z,n) is the current offset transfer function, W H (z,n+1) is the adjusted offset transfer function, μ H is a constant, y c (n) is the sound output signal, and e H (n) is the received signal difference. 如請求項5所述的頭戴式裝置,其中將該理想訊號差異最小化的數學函數為:W C (z,n+1)=W C (z,n)+μ C W H (z,n).s(n).e C (n),WH(z,n)為當前的偏移轉移函數,WC(z,n)為當前的補償轉移函數,WC(z,n+1)為調整的補償轉移函數,μ C為常數,s(n)為該原始聲音訊號,eC(n)為該理想訊號差異。 A head-mounted device as described in claim 5, wherein the mathematical function that minimizes the ideal signal difference is: W C ( z,n +1) = W C ( z,n ) + μ C W H ( z,n ) . s(n) . e C ( n ), W H (z,n) is the current offset transfer function, W C (z,n) is the current compensation transfer function, W C (z,n+1) is the adjusted compensation transfer function, μ C is a constant, s(n) is the original sound signal, and e C (n) is the ideal signal difference. 如請求項5所述的頭戴式裝置,其中該處理器更經配置用以:在該測試環境中,透過該揚聲器播放一測試聲音訊號;決定一模擬聲音訊號與一測試接收訊號之間的一測試訊號差異,其中該測試接收訊號是在該測試環境中透過該麥克風實際對播放該測試聲音訊號的該揚聲器收音所得,且該模擬聲音訊號是該測試聲音訊號通過該理想轉移函數所得;以及將該測試訊號差異最小化,並據以決定該理想轉移函數。 The head mounted device as described in claim 5, wherein the processor is further configured to: play a test sound signal through the speaker in the test environment; determine a test signal difference between a simulated sound signal and a test received signal, wherein the test received signal is obtained by actually receiving the speaker playing the test sound signal through the microphone in the test environment, and the simulated sound signal is obtained by passing the test sound signal through the ideal transfer function; and minimize the test signal difference and determine the ideal transfer function accordingly.
TW111137995A 2022-10-06 2022-10-06 Sound compensation method and head-mounted apparatus TWI837867B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW111137995A TWI837867B (en) 2022-10-06 2022-10-06 Sound compensation method and head-mounted apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW111137995A TWI837867B (en) 2022-10-06 2022-10-06 Sound compensation method and head-mounted apparatus

Publications (2)

Publication Number Publication Date
TWI837867B true TWI837867B (en) 2024-04-01
TW202416009A TW202416009A (en) 2024-04-16

Family

ID=91618907

Family Applications (1)

Application Number Title Priority Date Filing Date
TW111137995A TWI837867B (en) 2022-10-06 2022-10-06 Sound compensation method and head-mounted apparatus

Country Status (1)

Country Link
TW (1) TWI837867B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7885417B2 (en) * 2004-03-17 2011-02-08 Harman Becker Automotive Systems Gmbh Active noise tuning system
US8693699B2 (en) * 2008-07-29 2014-04-08 Dolby Laboratories Licensing Corporation Method for adaptive control and equalization of electroacoustic channels
CN111694156A (en) * 2020-05-26 2020-09-22 Oppo广东移动通信有限公司 Glasses and sound effect control method thereof
CN111771239A (en) * 2018-02-27 2020-10-13 哈曼贝克自动***股份有限公司 Feed forward active noise control
CN111988690A (en) * 2019-05-23 2020-11-24 北京小鸟听听科技有限公司 Earphone wearing state detection method and device and earphone
CN113711626A (en) * 2019-04-22 2021-11-26 脸谱科技有限责任公司 Remote inference of sound frequencies for determining head-related transfer functions of a user of a head-mounted device
CN114303388A (en) * 2019-09-04 2022-04-08 脸谱科技有限责任公司 Personalized equalization of audio output using identified characteristics of a user's ear
CN114730564A (en) * 2019-11-22 2022-07-08 高通股份有限公司 Priority-based sound field coding and decoding for virtual reality audio

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7885417B2 (en) * 2004-03-17 2011-02-08 Harman Becker Automotive Systems Gmbh Active noise tuning system
US8693699B2 (en) * 2008-07-29 2014-04-08 Dolby Laboratories Licensing Corporation Method for adaptive control and equalization of electroacoustic channels
CN111771239A (en) * 2018-02-27 2020-10-13 哈曼贝克自动***股份有限公司 Feed forward active noise control
CN113711626A (en) * 2019-04-22 2021-11-26 脸谱科技有限责任公司 Remote inference of sound frequencies for determining head-related transfer functions of a user of a head-mounted device
CN111988690A (en) * 2019-05-23 2020-11-24 北京小鸟听听科技有限公司 Earphone wearing state detection method and device and earphone
CN114303388A (en) * 2019-09-04 2022-04-08 脸谱科技有限责任公司 Personalized equalization of audio output using identified characteristics of a user's ear
CN114730564A (en) * 2019-11-22 2022-07-08 高通股份有限公司 Priority-based sound field coding and decoding for virtual reality audio
CN111694156A (en) * 2020-05-26 2020-09-22 Oppo广东移动通信有限公司 Glasses and sound effect control method thereof

Also Published As

Publication number Publication date
TW202416009A (en) 2024-04-16

Similar Documents

Publication Publication Date Title
EP2202998B1 (en) A device for and a method of processing audio data
US8081769B2 (en) Apparatus for rectifying resonance in the outer-ear canals and method of rectifying
JP6102179B2 (en) Audio processing apparatus and method, and program
US7889872B2 (en) Device and method for integrating sound effect processing and active noise control
WO2016153825A1 (en) System and method for improved audio perception
US11405723B2 (en) Method and apparatus for processing an audio signal based on equalization filter
TWI713374B (en) Audio adjustment method and associated audio adjustment device for active noise cancellation
KR20140006394A (en) Noise reduction processing device of earphone and headphone.
CN110313188B (en) Off-head positioning device, off-head positioning method, and storage medium
TW201118719A (en) System and method for modifying an audio signal
TWI837867B (en) Sound compensation method and head-mounted apparatus
TWI746001B (en) Head-mounted apparatus and stereo effect controlling method thereof
US11853642B2 (en) Method and system for adaptive volume control
CN113613122B (en) Volume adjusting method, volume adjusting device, earphone and storage medium
CN115396774A (en) Active noise reduction method and active noise reduction earphone
JP7031543B2 (en) Processing equipment, processing method, reproduction method, and program
JP7115353B2 (en) Processing device, processing method, reproduction method, and program
US20230370765A1 (en) Method and system for estimating environmental noise attenuation
WO2021129196A1 (en) Voice signal processing method and device
CN115175046A (en) Earphone noise reduction method and device, electronic equipment and computer readable storage medium
JP6295988B2 (en) Sound field reproduction apparatus, sound field reproduction method, and sound field reproduction program
CN116264658A (en) Audio adjusting system and audio adjusting method
CN116419111A (en) Earphone control method, parameter generation method, device, storage medium and earphone
TW200813978A (en) Audio player with decreasing environmental noise function