File:Comparaison filtres median savitzky golay scipy.svg

Original file(SVG file, nominally 900 × 540 pixels, file size: 48 KB)

Captions

Captions

Comparison between the median and Savitzky-Golay filters implemented in the signal module of the Python SciPy library.

Summary edit

Description
Français : Comparaison des filtres médian et de Savitzky-Golay mis en œuvre dans le module signal de la bibliothèque SciPy pour Python.
  • Gauche : filtre médian pour une fenêtre de largeur 7 points ;
  • droite : filtre de Savitzky-Golay pour un polynôme d'ordre 3 et une fenêtre de 7 points.
English: Comparison between the median and Savitzky-Golay filters implemented in the signal module of the Python SciPy library.
  • Left : median for a 7 points wide window;
  • droite : Savitzky-Golay for a 3rd order polynomial and a 7 points wide window.
Date
Source Own work
Author Cdang
W3CiThe source code of this SVG is invalid due to 10 errors.
 
This W3C-invalid plot was created with Matplotlib.
 
The source code of this SVG is invalid due to 10 errors.
 
This W3C-invalid vector image was created with Python by cdang.

Source code

InfoField

Python code

import numpy as np
import scipy.signal as signal
import matplotlib.pyplot as plt

epsilon = 0.1 # amplitude du bruit

x = np.linspace(0, 2, 40) # points d'abscisse

# Génération d'un signal gaussien bruité
y = 0.1*np.exp(-(10*(x - 1)*x + 0.125)) + epsilon*np.random.normal(x)

# Lissage
ylissemf = signal.medfilt(y, 7)
ylissesg = signal.savgol_filter(y, 7, 3)

# Affichage
fig, liste_axes = plt.subplots(1, 2, constrained_layout=True, figsize = [10, 6])
#fig = plt.figure(figsize = [10, 6])
liste_axes[0].plot(x, y, "b.")
liste_axes[0].plot(x, ylissemf, "k-", linewidth="0.5")
liste_axes[0].set_title("scipy.signal.medfilt(y, 7)")

liste_axes[1].plot(x, y, "b.")
liste_axes[1].plot(x, ylissesg, "k-", linewidth="0.5")
liste_axes[1].set_title("scipy.signal.savgol_filter(y, 7, 3)")

plt.savefig("comparaison_filtres_median_savitzky_golay_scipy.svg", format="svg")

Licensing edit

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current10:18, 10 May 2023Thumbnail for version as of 10:18, 10 May 2023900 × 540 (48 KB)Cdang (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Metadata