Comment calculer les valeurs peak-to-peak en Python avec UliEngineering
Vous pouvez facilement calculer la valeur peak-to-peak d’un signal en utilisant la bibliothèque Python UliEngineering :
peak_to_peak.py
import numpy as np
from UliEngineering.SignalProcessing.Utils import *
# Créer un signal
signal = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
# Calculer la valeur peak-to-peak
pp_value = peak_to_peak(signal)
print(f"Signal : {signal}")
print(f"Valeur peak-to-peak : {pp_value}")Exemple de sortie
peak_to_peak_output.txt
Signal : [1. 2. 3. 4. 5.]
Valeur peak-to-peak : 4.0La fonction peak_to_peak() calcule $\max(arr) - \min(arr)$, qui est la différence entre les valeurs maximale et minimale du signal.
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