如何求解信号s(t)在2秒内的最小值以计算AM信号Ac值
Got it, let's break this down into clear, actionable steps. I'll use Python (the go-to tool for signal processing tasks) to walk you through solving for the 2-second minimum, calculating the carrier amplitude ( A_c ), and plotting the conventional AM signal.
Since ( s(t) = 0 ) for ( t > 2 ), we only care about the signal values where ( t \leq 2 ). Here's how to isolate this segment and compute its minimum:
For discrete sampled signals (most common scenario):
import numpy as np # Example: Define your time array and known signal s(t) t = np.linspace(0, 3, 1000) # Time points from 0 to 3s (covers the 2s window) s = np.sin(2 * np.pi * t) - 0.6 # Replace this with your actual s(t) definition # Isolate the t ≤ 2 segment s_2sec = s[t <= 2] # Calculate the minimum value (using either Python's built-in min or np.min) min_s = np.min(s_2sec) # Faster for large arrays; use min(s_2sec) for small datasets
For continuous symbolic signals (if using analytical expressions):
import sympy as sp t_sym = sp.symbols('t') s_sym = sp.sin(2 * sp.pi * t_sym) - 0.6 # Replace with your symbolic s(t) # Compute the minimum value over t ∈ [0, 2] min_s = sp.minimum(s_sym, t_sym, sp.Interval(0, 2))
Conventional AM follows the formula:
( AM(t) = A_c \left[1 + k_a s(t)\right] \cos(\omega_c t) )
To avoid overmodulation (which causes envelope distortion), we need ( 1 + k_a s(t) \geq 0 ) for all ( t \leq 2 ). A common choice is to use full modulation (where the envelope just touches zero), which requires:
- ( k_a = \frac{1}{|max(s(t))|} ) (normalizes the signal to [-1, 1])
- ( A_c \geq |min_s| ) (ensures the term inside the brackets never goes negative)
For full modulation, simply set:
# For discrete signals max_s = np.max(s_2sec) k_a = 1 / max_s Ac = abs(min_s) # Guarantees 1 + k_a*s(t) ≥ 0 # For symbolic signals max_s = sp.maximum(s_sym, t_sym, sp.Interval(0, 2)) k_a = 1 / max_s Ac = abs(min_s)
If you want a safety margin (to avoid accidental overmodulation), multiply ( A_c ) by a small factor like 1.2:
Ac = 1.2 * abs(min_s)
Let's create the AM signal and visualize it alongside the original message signal:
import matplotlib.pyplot as plt # Define carrier parameters fc = 10 # Carrier frequency (Hz) omega_c = 2 * np.pi * fc # Generate the AM signal am_signal = Ac * (1 + k_a * s) * np.cos(omega_c * t) # Create the plot plt.figure(figsize=(10, 7)) # Plot original message signal plt.subplot(2, 1, 1) plt.plot(t, s, color='blue', label='Original signal $s(t)$') plt.axvline(x=2, color='red', linestyle='--', label='$t=2s$ cutoff') plt.title('Message Signal $s(t)$') plt.xlabel('Time (s)') plt.ylabel('Amplitude') plt.legend() plt.grid(True) # Plot AM signal with envelopes plt.subplot(2, 1, 2) plt.plot(t, am_signal, color='green', alpha=0.7, label='Conventional AM Signal') plt.plot(t, Ac*(1 + k_a*s), color='red', linestyle='--', label='Upper Envelope') plt.plot(t, -Ac*(1 + k_a*s), color='red', linestyle='--', label='Lower Envelope') plt.axvline(x=2, color='red', linestyle='--', label='$t=2s$ cutoff') plt.title('Conventional AM Signal') plt.xlabel('Time (s)') plt.ylabel('Amplitude') plt.legend() plt.grid(True) plt.tight_layout() plt.show()
内容的提问来源于stack exchange,提问作者Guy

