How can I plot time vs. frequency curve of time-series data?

조회 수: 9 (최근 30일)
Partha
Partha 2014년 11월 10일
편집: Partha 2015년 4월 5일
I want to plot time vs. frequency curve of time-series data. Can anybody help me?
N.B. Please see the attachment
  댓글 수: 3
Partha
Partha 2014년 11월 10일
Sorry Orion, now see the attachment please.
Partha
Partha 2015년 4월 5일
편집: Partha 2015년 4월 5일
Is there is any difference between the following codes?
NS = Noisy Signal; windowsize = 128; window = hanning(windowsize); nfft = windowsize; noverlap = windowsize-1; [S_NS F_NS T_NS P_NS] = spectrogram(NS,window,noverlap,nfft,Fs,'yaxis'); AMP_NS = 10*log10(abs(S_NS)); imagesc(T_NS*1e3,F_NS*1e-6,AMP_NS)
and
spectrogram(NS,window,noverlap,nfft,Fs,'yaxis');

댓글을 달려면 로그인하십시오.

답변 (1개)

Orion
Orion 2014년 11월 10일
Ok, I will not read this full paper.
But I guess you want to make figures like the number 5.
You need to use spectrogram
  댓글 수: 2
Youssef  Khmou
Youssef Khmou 2014년 11월 11일
spectrogram is the right function .
Partha
Partha 2015년 4월 5일
I use the following code
function FRQ_Plot(NS,DNS)
global Fs fn wname tt lcf hcf
% plotting of the spectrogram
window = 1024; %window = Hamming window of length nfft. noverlap = (3/4)*window; %noverlap = Number of samples that each segment overlaps. nfft = []; %nfft = FFT length and is the maximum of 256 or the next power of 2 greater than the length of each segment of x. F = [0 10e6 20e6 30e6]; %F = Vector of frequencies (Instead of nfft).
[S_NS F_NS T_NS P_NS] = spectrogram(NS,window,noverlap,nfft,Fs,'yaxis');AMP_NS = abs(S_NS); [S_DNS F_DNS T_DNS P_DNS] = spectrogram(DNS,window,noverlap,nfft,Fs,'yaxis');AMP_DNS = abs(S_DNS);
figure(fn) subplot(211),imagesc(T_NS*1e3,F_NS*1e-6,AMP_NS),colormap(gray);colormap(flipud(colormap)),colorbar('location','northoutside'),set(gca,'YDir','normal') subplot(212),imagesc(T_DNS*1e3,F_DNS*1e-6,AMP_DNS),colormap(gray);colormap(flipud(colormap)),colorbar('location','northoutside'),set(gca,'YDir','normal') fn = fn + 1;
figure(fn) subplot(211),spectrogram(NS,window,noverlap,nfft,Fs,'yaxis'),colormap(gray);colormap(flipud(colormap)),colorbar('location','northoutside') subplot(212),spectrogram(DNS,window,noverlap,nfft,Fs,'yaxis'),colormap(gray);colormap(flipud(colormap)),colorbar('location','northoutside') fn = fn + 1;
return
Please find the attachments for figures
Which one is correct?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Wavelet Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by