I have a sine wave whose frequency is changing in irergular intervals from 50HZ to 55HZ and back to 50HZ.i need to extract the frequency information from the sin wave I need to plot the frequency vs time in a graph..
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I have a sin wave whose frequency is changing in irregular intervals from 0 to 10 sec the frequency is 50 HZ sec.From 10 sec to 25 HZ the frequency is 55HZ, its again becoming 50HZ from 25 sec to 30 sec. I need to extract the frequency information (not spectrum analysis) from sin wave itself,that from what time to till what time 50 HZ,55 HZ is persisting and at what time onwards 50 Hz is again coming and persisting,just a frequency (y axis) vs time(x axis) plot, means suppose a 50 Hz frequency is exciting from 0 to 10 sec i need to plot a straight line in 50 HZ till 10 sec and if the frequency is changing to 55 HZ from 10 sec to 25 sec i need to see that change in my graph and again going back to 55 HZ at 25 sec.i tried lots of methodS..Its showing error, and its not plotting correctly, Can any one help me in this issue?
댓글 수: 0
채택된 답변
Wayne King
2012년 7월 29일
In this simple example, you can use the short-time Fourier transform to do this. You're really after something called the instantaneous frequency, which is not a trivial thing to estimate in most cases.
Fs = 1000;
t = 0:1/Fs:30-(1/Fs);
x = cos(2*pi*50*t).*(t<=10)+cos(2*pi*55*t).*(t>10 & t<=25)+...
cos(2*pi*50*t).*(t>25 & t<30);
plot(t,x)
[y,f,T,p] = spectrogram(x,250,200,200,Fs);
preduced = p(11:12,:);
subplot(211)
plot(T,preduced(1,:))
title('50-Hz Component')
subplot(212)
plot(T,preduced(2,:))
title('55-Hz Component');
xlabel('Seconds')
댓글 수: 4
Bjorn Gustavsson
2012년 7월 31일
Well time-frequency analysis is not my core field of work, so my expertise in the more technical details is vague, but there is a good matlab toolbox for time-frequency analysis (with good documentation!) that I've used:
There they describe the hows and ifs about instantaneous frequency. In short w(t) is defined as the time derivative of the instantaneous phase. The instantaneous phase (and amplitude) you get by way of the Hilbert transform. But have a look at the time-frequency toolbox.
HTH,
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!