Gaussian Fitting under peaks
18 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
1804Hz
il 15 Apr 2022
Commentato: Image Analyst
il 16 Apr 2022
Is there a specific matlab function that would allow my program to estimate a guassian distrubution for each of the peaks found (in this case 5 peaks).
0 Commenti
Risposta accettata
Image Analyst
il 15 Apr 2022
Yes. I'm attaching a demo that can fit any number of Gaussians. It's setup for 6 in the demo but you can adapt it to 5 by changing the proper variable. Attach your data if you can't figure it out.
4 Commenti
Image Analyst
il 16 Apr 2022
As long as there are definite valleys between the peaks (and it's not just like a skewed hump) then you can use findpeaks(). Just negate the signal to find valleys instead of peaks
[valleyValues, indexesOfValleys] = findpeaks(-signal);
valleyValues = -valleyValues;
findpeaks() has lots of parameters to control how big or small the peaks is so you might have to tweak some of those.
Più risposte (1)
the cyclist
il 15 Apr 2022
Modificato: the cyclist
il 15 Apr 2022
If you have the underlying data the fitgmdist function in the Statistics and Machine Learning Toolbox does this sort of fit. Here is some code I wrote, that fits an example (with just two peaks):
MU1 = 1;
SIGMA1 = 1;
MU2 = -3;
SIGMA2 = 1;
X = [mvnrnd(MU1,SIGMA1,1000);mvnrnd(MU2,SIGMA2,1000)];
figure
histogram(X,51)
options = statset('Display','final');
obj = fitgmdist(X,2,'Options',options)
The output obj has more stats in it.
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!