短时傅里叶变换计算一下

短时傅里叶变换计算一下_第1张图片

clear
clc
close all
fs=100;
frequency=0.5
t=1/fs:1/fs:10*60;
signal=0.2*sin(2*pi*frequency*t)+0.2*cos(2*pi*2*frequency*t);

figure(1)
plot(t,signal)

figure(2)
pwelch(signal,1024*5,[],[],100)
xlim([0.2 2])

figure(3)
window=128*32
[ss,ff,tt]=spectrogram(signal,window,[],0.1:0.01:2,100);
view(-10,45)
view(2)


figure(5)
waterfall(tt,ff,10*log10(abs(ss)))
view(-40,45)
view(2)

你可能感兴趣的:(matlab)