How to provide gaussian fitting of spectrums with multiple peaks ?
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Kiryl Zhaliazka
le 8 Oct 2021
Réponse apportée : Star Strider
le 8 Oct 2021
I have a plot of my Signal to wavenumber, and i want to saw can one pic containe several subpeks or not using gaussian fitting. could you help me find solution for this task?

0 commentaires
Réponse acceptée
Star Strider
le 8 Oct 2021
A version of that is actually provided in the findpeaks documentation (see Determine Peak Widths) and by getting all the outputs (see Peak Prominences) suitable initial parameter estimates for the widths.
The objective funciton could be something like this —
gausfit = @(b,x) b(1) .* exp(-(x-b(2)).^2/b(3));
x = linspace(0, 10)
y = gausfit([2,4,3],x) + randn(size(x))*0.5;
[B,fv] = fminsearch(@(b)norm(y-gausfit(b,x)), rand(3,1))
figure
plot(x, y, '.')
hold on
plot(x, gausfit(B,x), '-r')
hold off
grid
Use the peak locations, amplitudes, and widths, and use a for loop to fit each peak. Much depends on how well the peaks are defined in the data, so it may not be possible to fit all of them accurately.
.
0 commentaires
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
