Python : comment supprimer l'offset DC des signaux avec UliEngineering
Vous pouvez facilement supprimer l’offset DC (valeur moyenne) d’un signal grâce à la bibliothèque Python UliEngineering :
remove_mean.py
import numpy as np
from UliEngineering.SignalProcessing.Utils import *
# Créer un signal avec offset DC
signal = np.array([1.0, 2.0, 3.0, 4.0, 5.0]) + 10.0
# Supprimer l'offset DC
signal_centered = remove_mean(signal)
print(f"Moyenne du signal original : {np.mean(signal)}")
print(f"Moyenne du signal centré : {np.mean(signal_centered)}")
print(f"Signal centré : {signal_centered}")Exemple de sortie
remove_mean_output.txt
Moyenne du signal original : 12.0
Moyenne du signal centré : 0.0
Signal centré : [-2. -1. 0. 1. 2.]La fonction remove_mean() soustrait la moyenne arithmétique du signal, le centrant ainsi efficacement autour de zéro.
Check out similar posts by category:
Signal Processing, Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow