• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Matlab中加汉明窗 ahmming 作用

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

转自: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

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap