MATLAB: [solved] difference between 2 spectrograms

MATLABspectrogram

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

Best Answer

Hello,
thank you for your answer, this is great help
here is the result
Sans titre.png
this is the best result I got so far. :D
some possible improvments
-the last time index is deleted
-Z data is different (but I will make comparisons, si not very important)
-the pscolor give a flat image, when spectrogram give a 3D I can rotate