stft(短時間フー​リエ変換)で自動生成​される図の作成方法

12 ビュー (過去 30 日間)
toshinori
toshinori 2023 年 1 月 25 日
コメント済み: toshinori 2023 年 2 月 6 日
ライブエディターで
stft (短時間フーリエ変換)を実行すると図が出てきますが同じ図を作成することが出来ません。
やってみたコマンド
[x]=stft(M);
XA=abs(x/L) :フーリエ変換で得られた複素数を絶対値に、LはLength of signal
for i
for j
Xd=mag2db(XA)
end
end
image(Xd)

採用された回答

Hernia Baby
Hernia Baby 2023 年 1 月 27 日
% edit stft
で中身が見れます。例を見てみましょう。
% EXAMPLE 4:
% Compute and display the STFT of a set of intermittent sinusoid
% signals.
データの用意
clc,clear,close all;
silence = zeros(1,1500);
fs = 1e3;
t = (0:1000-1)/fs;
yStep = [sin(2*pi*50*t) silence sin(2*pi*100*t) silence sin(2*pi*150*t)].';
t = seconds((0:length(yStep)-1)/fs).';
xTable = timetable(t,yStep);
出力数なし
stft(xTable);
出力ありで再現
[S,F,T] = stft(xTable);
smag = mag2db(abs(S));
pcolor(seconds(T),F,smag)
xlabel('Time (s)')
ylabel('Frequency (Hz)')
shading flat
colorbar
clim(max(smag(:)) + [-60 0])
  1 件のコメント
toshinori
toshinori 2023 年 2 月 6 日
大変参考になりました。ありがとうございました。

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDigital Input and Output についてさらに検索

Community Treasure Hunt

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

Start Hunting!