import matplotlib.pyplot as plt
from Mod2 import process_signal

result = process_signal()
if result:
    X, X1, anomalies = result

    plt.figure(figsize=(10, 6))

    plt.subplot(2, 1, 1)
    plt.plot(X, 'b-')
    if anomalies:
        anomaly_values = [X[i] for i in anomalies]
        plt.plot(anomalies, anomaly_values, 'ro')
    plt.title('Исходный сигнал')
    plt.grid(True)

    if X1 is not None:
        plt.subplot(2, 1, 2)
        plt.plot(X1, 'g-')
        plt.title('Исправленный сигнал')
        plt.grid(True)

    plt.tight_layout()
    plt.show()