קובץ:Detection pic savitzky Golay.svg
לקובץ המקורי (קובץ SVG, הגודל המקורי: 610 × 460 פיקסלים, גודל הקובץ: 69 ק"ב)
זהו קובץ שמקורו במיזם ויקישיתוף. תיאורו בדף תיאור הקובץ המקורי (בעברית) מוצג למטה. |
תקציר
תיאורDetection pic savitzky Golay.svg |
English: Peak detection using the Savitzky-Golay smoothing and derivation algorithm. The peak width is given by the local extrema of the first derivative. The peak position is given by the local minima of the second derivative.
Français : Détection de pics par l'algorithme de lissage et de dérivation de Savitzky-Golay. La largeur des pics est donnée par les extrema locaux de la dérivée première. La position des pics est donnée par les minima locaux de la dérivée seconde. |
תאריך יצירה | |
מקור | נוצר על־ידי מעלה היצירה; created with Scilab, processed with Inkscape (addition of the dashed lines). |
יוצר | Christophe Dang Ngoc Chan(cdang) |
גרסאות אחרות | File:Desommation trois pics gaussiens 21pts.svg (stronger filtering: width = 21 points) |
Scilab source
This media was created with Scilab, a free open-source software. Here is a listing of the Scilab source used to create this file. |
File three_gaussian_peaks_generator.sce
: creates a data set and saves it in the three_gaussian_peaks.txt
file. Similar to File:Detection pic derivee seconde.png.
clear;
chdir('mypath/')
// Parameters of the function
step = 0.02;
X = [0:step:10]';
speak = 0.1; // sigma peaks
varnoise = 0.01; // variance of the noise
// Gauss function
function [y]=gauss(x, sigma)
y=1/(sqrt(2*%pi*sigma))*exp(-x^2/(2*sigma));
endfunction
// global function
function [y]=f(x, sigma, variancenoise)
for i = 1:size(x,'*')
y (i) = gauss(x(i) - 2, sigma) + 0.5*gauss(x(i) - 6.2, sigma)...
+ gauss(x(i)-7, sigma) + variancenoise*rand(1,'normal');
end
endfunction
// Data generation
Y = f(X, speak, varnoise);
// plot(X,Y);
// Saving
write('three_gaussian_peaks.txt', [X,Y]);
File savitztygolay.sce
: processes the data. Similar to File:Savitzky-golay pic gaussien bruite.svg (see this page if the sampling step is not constant).
// **********
// Constants and initialisation
// **********
clear;
clf;
chdir('mypath/')
// smoothing parameters :
width = 9; // width of the sliding window (number of pts)
poldeg = 3; // degree of the polynomial
// **********
// Functions
// **********
// Convolution coefficients
function [a]=convolcoefs(m, d)
// m : width of the window
// d : degree of the polynomial
l = (m-1)/2; // half-width of the window
a = ones(3,m);
z = (-l:l)'; // standardised abscissa
J = ones(m,d+1);
for i = 2:d+1
J(:,i) = z.^(i-1); // jacobian matrix
end
A = (J'*J)^{-1}*J';
a = A(1:3,:);
endfunction
// smoothing, determination of the first and second derivatives
function [y, yprime, ysecond] = savitzkygolay(X, Y, wdt, deg)
// X, Y: collection of data
// wdt: width of the window
// deg : degree of the polynomial
n = size(X,'*');
l = floor(wdt/2);
step = (X($) - X(1))/(n - 1);
y=Y;
yprime = zeros(Y);
ysecond = yprime;
a = convolcoefs(wdt, deg);
a(2,:) = 1/step*a(2,:);
a(3,:) = 2/step^2*a(3,:);
for i=(l+1):(n-l)
y(i) = a(1,:)*Y(i-l:i+l);
yprime(i) = a(2,:)*Y(i-l:i+l);
ysecond(i) = a(3,:)*Y(i-l:i+l);
end
endfunction
// **********
// Main program
// **********
// data reading
data = read('three_gaussian_peaks.txt', -1, 2)
Xinit = data(:,1);
Yinit = data(:,2);
//subplot(3,1,1)
//plot(Xdef, Ydef, "b")
// Data processing
[Ysmooth, Yprime, Ysecond] = savitzkygolay(Xinit, Yinit, width, poldeg);
// Display
offset = floor(width/2);
nbpts=size(Xinit,'*');
X1=Xinit((offset+1):(nbpts-offset));
X2=Xinit((2*offset+1):(nbpts-2*offset));
Y1=Yprime((offset+1):(nbpts-offset));
Y2=Ysecond((2*offset+1):(nbpts-2*offset));
subplot(3,1,1)
plot(Xinit, Yinit, "b")
plot(Xinit, Ysmooth, "r")
subplot(3,1,2)
plot(X1, Y1, "b")
subplot(3,1,3)
plot(X2, Y2, "b")
רישיון
מוענקת בכך הרשות להעתיק, להפיץ או לשנות את המסמך הזה, לפי תנאי הרישיון לשימוש חופשי במסמכים של גנו, גרסה 1.2 או כל גרסה מאוחרת יותר שתפורסם על־ידי המוסד לתוכנה חופשית; ללא פרקים קבועים, ללא טקסט עטיפה קדמית וללא טקסט עטיפה אחורית. עותק של הרישיון כלול בפרק שכותרתו הרישיון לשימוש חופשי במסמכים של גנו.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
- הנכם רשאים:
- לשתף – להעתיק, להפיץ ולהעביר את העבודה
- לערבב בין עבודות – להתאים את העבודה
- תחת התנאים הבאים:
- ייחוס – יש לתת ייחוס הולם, לתת קישור לרישיון, ולציין אם נעשו שינויים. אפשר לעשות את זה בכל צורה סבירה, אבל לא בשום צורה שמשתמע ממנה שמעניק הרישיון תומך בך או בשימוש שלך.
- שיתוף זהה – אם תיצרו רמיקס, תשנו, או תבנו על החומר, חובה עליכם להפיץ את התרומות שלך לפי תנאי רישיון זהה או תואם למקור.
פריטים שמוצגים בקובץ הזה
מוצג
ערך כלשהו ללא פריט ויקינתונים
12 בנובמבר 2012
היסטוריית הקובץ
ניתן ללחוץ על תאריך/שעה כדי לראות את הקובץ כפי שנראה באותו זמן.
תאריך/שעה | תמונה ממוזערת | ממדים | משתמש | הערה | |
---|---|---|---|---|---|
נוכחית | 16:08, 12 בנובמבר 2012 | 460 × 610 (69 ק"ב) | Cdang | {{Information | description = {{en|1=Peak detection using the Savitzky-Golay smoothing and derivation algorithm. The peak width is given by the local extrema of the first derivative. The peak position is given by the local minima of the second derivati... |
שימוש בקובץ
אין בוויקיפדיה דפים המשתמשים בקובץ זה.
מטא־נתונים
קובץ זה מכיל מידע נוסף, שכנראה הגיע ממצלמה דיגיטלית או מסורק שבהם הקובץ נוצר או עבר דיגיטציה.
אם הקובץ שונה ממצבו הראשוני, כמה מהנתונים להלן עלולים שלא לשקף באופן מלא את הקובץ הנוכחי.
כותרת קצרה | Détection de pics avec l'algorithme de Savitzky-Golay |
---|---|
כותרת התמונה | Creator: GL2PS 1.3.2, (C) 1999-2006 Christophe Geuzaine (geuz@geuz.org)
For: Scilab CreationDate: Mon Nov 12 13:50:42 2012 |
רוחב | 610px |
גובה | 460px |