How to quantify spectrogram comparison

75 ビュー (過去 30 日間)
James
James 2017 年 1 月 5 日
回答済み: Ignas A. 2018 年 11 月 19 日
Given: Two spectrogram plots (spec1.png and spec2.png attached)
Looking for: A method to quantify the difference between the two spectrograms
Purpose: Fault detection and fault severity classification
Previously tried: Substracting the two spectrograms on a point by point basis using: (See specDifference.png)
[S1,F1,T1,S1] = spectrogram(y1,window, noverlap,2048, Fs, 'yaxis');
[S2,F2,T2,P2] = spectrogram(y2,window, noverlap,2048, Fs, 'yaxis');
surf(T2,F2,abs(abs(S1)-abs(S2)),'edgecolor','none'); axis tight; colormap(hot), view(0,90);
This specDifference.png plot allows differences between spectrograms to be visualized. The objective however is to quantify the difference in order to automate the data collection and analysis.
The rationale for using the spectrogram vs comparing the 2-D FFT or PSD plot and calculating the cross correlation or other metric is because this is a mechanism's open-closing event. Visualizing in 2D potentially hides frequency signatures at specific points in time which may serve as fault indicators. Additionally the goal is to quantitatively differentiate normal condition from varying degrees of degraded condition.

回答 (2 件)

Zhao Wang
Zhao Wang 2017 年 1 月 10 日
I understand that you want to quantify the difference between two spectrograms and use this quantitative information in fault diagnosis. With regards to the objective, the difference should be with respect to a range of frequencies. You may want to calculate the average power at a particular frequency based on the power spectral density (PSD) obtained using the "spectrogram" function. In addition, the spectral moments may also help in the fault diagnosis application.
In order to obtain a relationship between the two signals with respect to frequency, you can compute the cross power spectral density using the "cpsd" function, such as
>> cpsd(y1,y2,window, noverlap,2048, Fs);
For more details about the "cpsd" function, see the following link:

Ignas A.
Ignas A. 2018 年 11 月 19 日
Hello James,
after analysing your question I have made few remarks.
First of all there is mistake in your code naming power spectral density as S1 insted of P1:
[S1,F1,T1,S1] = spectrogram(y1,window, noverlap,2048, Fs, 'yaxis'); % You have named PSD as S1 insted of P1 (your style)
[S2,F2,T2,P2] = spectrogram(y2,window, noverlap,2048, Fs, 'yaxis');
Next you should consider ploting results in log scale 10*log10(abs(difference)).
Good luck
Ignas

カテゴリ

Help Center および File ExchangeSpectral Estimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by