hanning window

114 ビュー (過去 30 日間)
oblivious
oblivious 2012 年 6 月 23 日
Hello,
what is the difference between hanning and hann? They are both supposed to be returning hanning window sequences.
-obli

採用された回答

Wayne King
Wayne King 2012 年 6 月 23 日
The Hann and Hanning window are both implemented in MATLAB by the same basic equation
w = 0.5 - 0.5*cos(2*pi*x);
There is a slight difference in the way they are calculated in hann.m and hanning.m based on the "x" vector that is evaluated in that equation.
For hann.m
hann(5) gives you
x = (0:2)'./4;
w = 0.5 - 0.5*cos(2*pi*x);
w = [w ; w(end-1:-1:1)]
whereas hanning(5) gives you
x = (1:3)'./6;
w = 0.5-0.5*cos(2*pi*x);
w = [w ; w(end-1:-1:1)];
Since the time vector in hann.m starts with 0, you get 0 as the first and last sample with hann.m, but not with hanning.m which starts with 1 as the first element of the time vector.
But they are the same equation and I think you can use which every implementation you want.

その他の回答 (1 件)

Wayne King
Wayne King 2012 年 6 月 23 日
There is no difference. The hanning window, or hann window, or von Hann window were named after Julius von Hann. The hamming window is in honor of Richard Hamming. People just refer to the hann window as hanning just for symmetry with hamming. They are both generalized cosine windows.
  1 件のコメント
oblivious
oblivious 2012 年 6 月 23 日
>> hann(5)
ans =
0
0.5000
1.0000
0.5000
0
>> hanning(5)
ans =
0.2500
0.7500
1.0000
0.7500
0.2500
then why does matlab returns different values?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeWindows についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by