[solved] difference between 2 spectrograms
Mostrar comentarios más antiguos
Hello,
Here is the situation:
I have a dynamic system equipped with a vibration sensor.
this system has 2 configurations; I have 1 record of 10 minutes in each configuration
I plot spectrogram for each. So far, everything is fine
[s,f,t]=spectrogramspectrogram(data,hamming(wdw),overlap,[],10240);
[s2,f,t]=spectrogram(data2,hamming(wdw),overlap,[],10240);
Now I want to compare (make a difference) of these spectrograms, but
I can do s-s2, but before
I can't plot back the spectrogram from s
I tried several thing such as
im=imagesc(h/1000,(t/60),(abs((s')))) ; % tested with imag real and with image
colorbar
ylabel('Time (mins)');
xlabel('Frequency (kHz)');
but the result is different from
spectrogram(data,hamming(wdw),overlap,[],10240);
thank you for your answer
Respuesta aceptada
Más respuestas (5)
Bjorn Gustavsson
el 25 de Sept. de 2019
Spectrogram called without input arguments seems to plot log10 of the power. try this:
im = pcolor(h/1000,(t/60),log10(abs((s'))));
shading flat
colorbar
ylabel('Time (mins)');
xlabel('Frequency (kHz)');
HTH
bryan
el 25 de Sept. de 2019
0 votos
1 comentario
Bjorn Gustavsson
el 25 de Sept. de 2019
That has something to do with what your red curve is, and not that much with the spectrogram-plot, I think.
A completely different question is if you need this spectral resolution - you might get more useful results if you reduce the length of your window. That would reduce the frequency-resolution but will give you improved time-resolution.
bryan
el 2 de Oct. de 2019
1 comentario
Bjorn Gustavsson
el 25 de Oct. de 2019
Yes, that is true, but the "red curve" of yours varies at shorter time-scales than your time-resolution of your spectrogram - to try to resolve that you could try to run spectrogram with a shorter window, wdw, and overlap (this will reduce the spectral resolution, but you have plenty of that already.)
HTH
bryan
el 28 de Oct. de 2019
0 votos
2 comentarios
Bjorn Gustavsson
el 28 de Oct. de 2019
You will not get more data in your spectrogram if you increase the time-resolution and reduce the spectral resolution - this is Heisenberg! As your spectrogram looks now you have "too high" spectral resolution and too low temporal resolution.
bryan
el 28 de Feb. de 2020
Categorías
Más información sobre Time-Frequency Analysis en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

