import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hilbert # Assuming 'script.signal' refers to scipy's hilbert
# Parameters
fs = 27000 # Sampling frequency
t = np.linspace(0, 1, fs, endpoint=False) # Time
fm = 160 # Frequency of the modulating signal
fc = 1625 # Frequency of the carrier
Am = 1 # Amplitude of the modulating signal
Ac = 1 # Amplitude of the carrier
# Modulating signal
moduladora = Am * np.cos(2 * np.pi * fm * t)
# Carrier signal
portadora = Ac * np.cos(2 * np.pi * fc * t)
# Modulation BLU using the Hilbert transform
analitica = hilbert(moduladora) # Hilbert transform
blu_signal = np.real(analitica) * portadora
# Visualization
plt.figure(figsize=(10, 4))
plt.plot(t[:1000], blu_signal[:1000])
plt.title('Señal BLU-Ps')
plt.xlabel('Tiempo (s)')
plt.ylabel('Amplitud')
plt.grid()
plt.show()