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)); endNFFT =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);
Best Answer