1
$\begingroup$

I'm using MATLAB to make a spectrogram of some milling vibration data (units of m/s^2) and I had a few questions because I'm a bit out of my depth.

  1. Using the built in MATLAB spectrogram function I get units of Power/frequency (dB/Hz). Are these the correct units or, alternatively, how do I calculate what the proper units should be? Some of the examples have those units, others merely have units of Power (dB).

  2. How does MATLAB define 0dB i.e. is it a set constant or does it change based on the data you feed into the spectrogram? I'm trying to compare multiple spectrograms and if the scale is changing each time I run data then I need to find a different way to run the data.

  3. As a bonus question, I'm trying to compare the vibration magnitude and the frequencies they occur at across different cutting conditions. Outside of visually saying "They're different," is there a way to quantify the differences? I've tried subtracting the two greyscale images and playing around with that to get numbers but I'd like a better way to compare them if possible.

Here is my MATLAB code if it's helpful.

figure(1007) spectrogram(Xacc,windowx,noverlap,nfft,fs,'yaxis') %Acceleration data in X direction and predefined variables for the spectrogram. ylim([0 5]) colormap(jet); caxis([-70 10]) %Colorbar Axis range title('Spectrogram of X') s1=base + "SPEC_Acc_ X_FULL"; saveas(gca,s1,'jpg') 

Thanks so much for the help!

$\endgroup$

1 Answer 1

1
$\begingroup$

Handling units properly with PSD calculation is tricky and depends a lot on your specific application and requirements. Most "off the shelf" tools like MATLAB's spectrogram() will use the concept of "signal power" which sometimes is useful but frequently bears little correlation with actual physical power.

... Are these the correct units or, alternatively, how do I calculate what the proper units should be? ...

That depends on what exactly you want to do. Actual mechanical power is force times velocity. Since you only have an acceleration signal, you will need to integrate this and make some assumptions about the mechanical impedance where the acceleration was measure. Ideally you have the measured force as well. That's the only way to get to something you could call "Watts" or "Watts/Hz". If you want/need something else, you need to specify what exactly that is.

How does MATLAB define 0dB ...

It's a based on the assumption that a value of 1 in your signal is the reference. A sine wave with an amplitude of 1 has a signal power of -3dB. If you feed this into spectrogram() and set the "SPECTRUMTYPE" to "power, you will actually get a vertical line with a value around 3 dB.

... is there a way to quantify the differences? ...

Of course there is. In fact, there a 100s of ways of quantifying differences. However, you need to define what is the most relevant for your specific application. For vibration stuff it could be "everything below a certain threshold is fine", "no vibration close the resonance frequency of the chassis", etc. It really depends on your goal.

$\endgroup$
1
  • $\begingroup$ Thanks so much! If my signal has the units of m/s^2 does that mean the units of the color bar are (m/s^2)^2/Hz? And that MATLAB represents it using dB log scaling? $\endgroup$ Commented Sep 13, 2024 at 15:39

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.