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

9 vues (au cours des 30 derniers jours)
Partha
Partha le 10 Nov 2014
Modifié(e) : Partha le 5 Avr 2015
I want to plot time vs. frequency curve of time-series data. Can anybody help me?
N.B. Please see the attachment
  3 commentaires
Partha
Partha le 10 Nov 2014
Sorry Orion, now see the attachment please.
Partha
Partha le 5 Avr 2015
Modifié(e) : Partha le 5 Avr 2015
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');

Connectez-vous pour commenter.

Réponses (1)

Orion
Orion le 10 Nov 2014
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 commentaires
Youssef  Khmou
Youssef Khmou le 11 Nov 2014
spectrogram is the right function .
Partha
Partha le 5 Avr 2015
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?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Wavelet Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by