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!