Conduct STFT analysis for chirp signal for 25% overlapping

11 visualizaciones (últimos 30 días)
Magdalena Bartoszek
Magdalena Bartoszek el 12 de Mayo de 2020
Comentada: Magdalena Bartoszek el 12 de Mayo de 2020
Hello everyone, I really could use some help with chirp signal in matlab.. I need to visualize the result on spectogram, however i have no idea how to do the overlapping part. I really would be grateful for every hint :)
That is the code i got to import the chirp signal:
N = 4096;
N_DFT = 256;
n = 0:N-1;
fs = 8000;
t = n/fs;
f0 = 0;
f1 = 100;
x = chirp(t,f0,t(150),f1);
spectrogram(x, hamming(N_DFT), 3*N_DFT/4);

Respuestas (1)

Bjorn Gustavsson
Bjorn Gustavsson el 12 de Mayo de 2020
From the help for spectrogram:
S = spectrogram(X,WINDOW,NOVERLAP) NOVERLAP is the number of samples
each segment of X overlaps. NOVERLAP must be an integer smaller than
WINDOW if WINDOW is an integer. NOVERLAP must be an integer smaller
than the length of WINDOW if WINDOW is a vector. If NOVERLAP is not
specified, the default value is used to obtain a 50% overlap.
So if you want 25% overlap you should use something like this:
spectrogram(x, hamming(N_DFT), N_DFT*1/4);
Remember to read the help and documentation carefully, then play around with the different inputs and look at the results.
HTH

Categorías

Más información sobre Time-Frequency Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by