Why peak of main-lobe in spectrum of hanning window is not equal to zero?

9 ビュー (過去 30 日間)
Le Dung
Le Dung 2018 年 2 月 2 日
編集済み: Le Dung 2018 年 2 月 2 日
Hi everyone! I'm trying to plot a spectrum of a hanning window. But when i have plotted it, i recognized that, peak of main-lobe of it is not equal to zero (image below). So, why? could you explain to me what i was wrong in my code? Thank you so much! P/s: I think peak of main-lobe in a spectrum (in dB) of window function MUST be zero.
My code:
t=0:0.001:0.5;
N=length(t);
x=1*sin(2*pi*51*t); % f of sine = 51 Hz
plot(t,x);
han=hann(N); % create a hanning window
taxis=-N/2:N/2-1; % time axis
figure;
plot(taxis,han); % Plots hanning window in time domain.
ffthan=fftshift(fft(han,N*10))/N; % calculate spectrum of windows function
faxis1= -0.5:1/N:0.5-1/N; % for case: f=-Fs/2:df:Fs/2-df => f_normalized = f/Fs
figure;
plot(20*log10(abs(ffthan))) % Plot rectangular windows in frequency domain.

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by