Matlab中加漢明窗 ahmming 作用


轉自:http://www.cnblogs.com/lxy2017/p/4049124.html

1.什么是漢明窗?

 

語音信號一般在10ms到30ms之間,我們可以把它看成是平穩的。為了處理語音信號,我們要對語音信號進行加窗,也就是一次僅處理窗中的數據。因為實際的語音信號是很長的,我們不能也不必對非常長的數據進行一次性處理。明智的解決辦法就是每次取一段數據,進行分析,然后再取下一段數據,再進行分析。

怎么僅取一段數據呢?一種方式就是構造一個函數。這個函數在某一區間有非零值,而在其余區間皆為0.漢明窗就是這樣的一種函數。它主要部分的形狀像sin(x)在0到pi區間的形狀,而其余部分都是0.這樣的函數乘上其他任何一個函數f,f只有一部分有非零值。

為什么漢明窗這樣取呢?因為之后我們會對漢明窗中的數據進行FFT,它假設一個窗內的信號是代表一個周期的信號。(也就是說窗的左端和右端應該大致能連在一起)而通常一小段音頻數據沒有明顯的周期性,加上漢明窗后,數據形狀就有點周期的感覺了。

因為加上漢明窗,只有中間的數據體現出來了,兩邊的數據信息丟失了,所以等會移窗的時候,只會移1/3或1/2窗,這樣被前一幀或二幀丟失的數據又重新得到了體現。

簡單的說漢明窗就是個函數,它的形狀像窗,所以類似的函數都叫做窗函數。

 

2.加Hanmming窗的作用

現在在看G.723.1,對語音編碼剛入門,

發現在對信號進行LPC分析前,對信號乘以一個Hamming 窗,

 

典型的窗口大小是25ms,幀移是10ms。漢明窗函數為

 

            W(n,α ) = (1 -α ) - α cos(2*PI*n/(N-1)),0≦n≦N-1

 

    一般情況下,α取0.46

轉自:https://ww2.mathworks.cn/help/signal/ref/hamming.html

用法:

hamming

 

Hamming window

collapse all in page

 

Syntax

w = hamming(L)
w = hamming(L,sflag)

 

 

 

Description

 

example

w = hamming(L)                returns an L-point symmetric Hamming window.

w = hamming(L,sflag)                returns a Hamming window using the window sampling specified by                     sflag.

 

 

 

Examples

collapse all

Hamming Window

Create a 64-point Hamming window. Display the result using wvtool.

L = 64;
wvtool(hamming(L))

 
 

 

Input Arguments

collapse all

LWindow length positive integer

Window length, specified as a positive integer.

Data Types: single | double

sflagWindow sampling 'symmetric' (default) | 'periodic'

Window sampling, specified as one of the following:

  • 'symmetric' — Use this option when using                                    windows for filter design.

  • 'periodic' — This option is useful for                                    spectral analysis because it enables a windowed signal to have                                    the perfect periodic extension implicit in the discrete Fourier                                    transform. When 'periodic' is specified,                                         hamming computes a window of length                                         L + 1 and returns the first                                         L points.

 

 

Output Arguments

collapse all

w — Hamming window column vector

Hamming window, returned as a column vector.

 

Algorithms

The following equation generates the coefficients of a Hamming window:

w(n)=0.540.46cos(2πn

The window length L = N + 1.

 

References

[1] Oppenheim, Alan V., Ronald W. Schafer, and John R. Buck.                 Discrete-Time Signal Processing. Upper Saddle River, NJ:            Prentice Hall, 1999.

 

Extended Capabilities

C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.

 

See Also

Apps

Functions

 

Introduced before R2006a

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM