Overlapping with Flat-top window

5 ビュー (過去 30 日間)
Claire
Claire 2014 年 9 月 19 日
回答済み: Star Strider 2014 年 9 月 19 日
I am using the following MATLAB code to determine the fft using a flat-top window of the whole data:
time = 0:0.1:50000;
data = 1.8*sin(2*pi*0.2003*time);
Fs = 10;
N = length(data);
w = flattopwin(N);
wdata = data(:).*w;
ws = sum(w);
Y = fft(wdata)/ws;
freq = 0:Fs/N:Fs/2-Fs/N;
freq = freq';
amplitude = 2*abs(Y(1:floor(N/2)));
plot(freq,amplitude);
Now, I wish to overlap windows prior to performing fft. Can someone please tell me how to modify the above code to perform overlapping and fft? Thanks in advance.

回答 (1 件)

Star Strider
Star Strider 2014 年 9 月 19 日
I would use the spectrogram function for what you want to do. You can specify the window you want. You can get data from it if you ask it:
[S,F,T] = spectrogram(data, flattopwin(N), ...)
and if you want to plot it, use:
surf(T,F,abs(S));
axis tight;
view(0,90);

カテゴリ

Help Center および File ExchangeGet Started with Signal Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by