Can I set a range for spectrogram Analysis
显示 更早的评论
Hi All,
my signal data has a variable frequency(around 50HZ). Can I set a frequency range for spectrogram analysis?
I want to determine the exact frequency according to time
My code is listed below.
Thank you ALL!
Ivy
clear all;
clc;
Fs=1000;
T=1/Fs;
L=1000;
t=(0:L-1)*T;
for i=1:1:10000 %variable frquency signal.
x(i)=0.7*sin(2*pi*(50+rand)*T*(i-1));
end
NFFT =1024;
[S,F,T,P] = spectrogram(x,1024,1000,1024,1E3);
[c,index]=max(P);
surf(T,F,10*log10(P),'edgecolor','none'); axis tight;
view(0,90);
采纳的回答
更多回答(1 个)
Daniel Shub
2011-8-1
1 个投票
You cannot set the frequency range for spectrogram analysis using the spectrogram function. You can, however, perform a short-time Fourier analysis with the freqz function. The freqz function lets you focus your NFFT frequency bins where you want them, as opposed to uniformly throughout the entire frequency range. This approach would require you to write code for the windowing of your signal.
类别
在 帮助中心 和 File Exchange 中查找有关 Time-Frequency Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!