fft関数に使用される窓関数について

181 vues (au cours des 30 derniers jours)
Jo Sasaki
Jo Sasaki le 23 Mai 2019
Modifié(e) : Kazuya le 23 Mai 2019
fft関数に使用されている窓関数は四角形窓がデフォルトなのでしょうか?
またマトラボではfftにハミング窓を使用されることはできるのでしょうか?

Réponse acceptée

Toshinobu Shintai
Toshinobu Shintai le 23 Mai 2019
Signal Processing Toolboxが必要になりますが、
「hamming」というコマンドで窓関数をかけることができます。
サンプルを作成し添付しましたのでご確認ください。
  1 commentaire
Kazuya
Kazuya le 23 Mai 2019
Modifié(e) : Kazuya le 23 Mai 2019
横からすいません。サンプル大変参考になりました。ありがとうございます。fft_window.m あとで参考にしやすいよう以下にコピペさせて頂きます。
clear;
Fs = 1000; % Sampling frequency
T = 1/Fs; % Sampling period
L = 1500; % Length of signal
t = (0:L-1)*T; % Time vector
S = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t);
X = S + 2*randn(size(t));
W = (hamming(L))';
X_h = X .* W;
plot(t,X,t,X_h);
figure;
plot(1000*t(1:50),X(1:50));
title('Signal Corrupted with Zero-Mean Random Noise');
xlabel('t (milliseconds)');
ylabel('X(t)');
Y = fft(X);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
Y_h = fft(X_h);
P2_h = abs(Y_h/L);
P1_h = P2_h(1:L/2+1);
P1_h(2:end-1) = 2*P1_h(2:end-1);
f = Fs*(0:(L/2))/L;
figure;
plot(f,P1,f,P1_h) ;
title('Single-Sided Amplitude Spectrum of X(t)');
xlabel('f (Hz)');
ylabel('|P1(f)|');

Connectez-vous pour commenter.

Plus de réponses (1)

Yoshio
Yoshio le 23 Mai 2019
matlab本体のfftは定義のままの変換となりますので、方形窓です。
各種窓については、信号処理ToolBoxに専用の関数があります。以下をご参照ください。

Community Treasure Hunt

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

Start Hunting!