Effacer les filtres
Effacer les filtres

Spectrogram - How to divide signal ?

3 vues (au cours des 30 derniers jours)
RuiQi
RuiQi le 8 Avr 2016
Commenté : Rab Nawaz le 14 Jan 2023
Hello
I have a signal 120 seconds long with sampling frequency 1KHz. How do I compute the spectrogram with 120 time segments ? Each segment 1000 samples. The code below gives me t = 136 not 120
segments = 120;
windowsize = 1000;
nfft = 1000;
[S,F,T,P] = spectrogram(data,windowsize,segments,nfft,Fs);

Réponse acceptée

Rick Rosson
Rick Rosson le 8 Avr 2016
Modifié(e) : Rick Rosson le 8 Avr 2016
The third input argument of spectrogram expects the number of samples to overlap each window, not the number of segments. Please try:
winSize = 1000;
overlap = 0;
fftSize = winSize;
[S,F,T,P] = spectrogram(data,winSize,overlap,fftSize,Fs);
It is common practice, however, to set the overlap to half of the window size:
overlap = floor(winSize/2);
but it is not required if you don't want it.
HTH.
  1 commentaire
Rab Nawaz
Rab Nawaz le 14 Jan 2023
@Rick Rosson! Please let me know how can I get wavelet coefficients in the same manner i.e. by dividing the signal in 'N' number of segments and with or without overlap. Alternatively, is there any way to get wavelet coefficients from this spectrogram function.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Time-Frequency Analysis 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