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

2 ビュー (過去 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 Center および File ExchangeTime-Frequency Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by