Effacer les filtres
Effacer les filtres

How to measure overlap area of peaks from different signals

4 vues (au cours des 30 derniers jours)
Wenlong
Wenlong le 6 Août 2014
Commenté : Star Strider le 7 Août 2014
Hi All, I wonder if there is a simple way to solve the following problem. There are two time-series signals S1 and S2 from two sensors and the signals were collected by the same frequency and time scale. If there are n peaks in S1 and m peaks in S2, how much area of peaks in S1 is overlapped with peaks in S2? Thanks in advance! Wenlong
  1 commentaire
Sara
Sara le 6 Août 2014
Can you provide an example of your signal an indicate what you mean?

Connectez-vous pour commenter.

Réponse acceptée

Star Strider
Star Strider le 6 Août 2014
I’m not quite certain what you want, but if you want the total overlap of the peak areas, use trapz (or cumtrapz) and subtract:
% Create Data:
pk = @(m,s,x) exp(-(x-m).^2./s); % Create peaks with centre=m, width=s
x= linspace(0,20);
s1 = pk(5,2,x) + pk(11,3,x) + pk(17,2,x);
s2 = pk(7,2,x) + pk(12,2,x) + pk(15,2,x);
% Integrate, Then Subtract:
Is1 = cumtrapz(x,s1);
Is2 = cumtrapz(x,s2);
Isd = Is1 - Is2;
figure(3)
plot(x,Isd)
grid
The final value of ‘Isd’ is the difference in the areas of the peaks between the two data vectors, ‘s1’ and ‘s2’.
Is this what you want to do?
  4 commentaires
Wenlong
Wenlong le 7 Août 2014
Thanks! Star.
Star Strider
Star Strider le 7 Août 2014
My pleasure!

Connectez-vous pour commenter.

Plus de réponses (1)

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh le 6 Août 2014
Hi Wenlong,
You didn't explain the problem in detail, so you probably looking for an idea.
What I understood and I would do is:
1- Define what's the accepted signal level as a peak (you may wanna use FWHM or any preferred definition), lets call it "threshold".
2- peakAreaS1 = S1 > threshold;
3- peakAreaS3 = S2 > threshold;
4 - overlapedArea = peakAreaS1 & peakAreaS2;
Hopefully this is a good enough hint.
Good luck!
  1 commentaire
Wenlong
Wenlong le 7 Août 2014
Thank you! Salaheddin, Your answer also helps.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Get Started with DSP System Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by