📖 Scenario: Imagine you are working with radio signals. You want to understand how different modulation methods change a simple message signal so it can be sent over the airwaves. This project will help you see how Amplitude Modulation (AM), Frequency Modulation (FM), and Phase Modulation (PM) work by creating and plotting these signals.
🎯 Goal: You will create a simple message signal and then generate its AM, FM, and PM modulated versions. Finally, you will plot all signals to see how modulation changes the message.
📋 What You'll Learn
Create a time array for the signal
Create a message signal as a sine wave
Define modulation parameters like carrier frequency and modulation index
Generate AM, FM, and PM signals using the message signal
Plot the original and modulated signals for comparison
💡 Why This Matters
🌍 Real World
Radio and communication systems use modulation to send information over long distances by changing a carrier wave.
💼 Career
Understanding modulation is important for roles in telecommunications, signal processing, and electronics engineering.
Progress0 / 4 steps
1
Create the time array and message signal
Create a numpy array called t that goes from 0 to 1 second with 1000 points. Then create a message signal called message as a sine wave with frequency 5 Hz using t.
Signal Processing
Hint
Use np.linspace to create t. Use np.sin and multiply by 2 * np.pi * 5 * t to create the message.
2
Define carrier frequency and modulation index
Create a variable called carrier_freq and set it to 50. Create another variable called mod_index and set it to 0.5.
Signal Processing
Hint
Just assign the numbers 50 and 0.5 to the variables carrier_freq and mod_index.
3
Generate AM, FM, and PM signals
Create three variables: am_signal, fm_signal, and pm_signal. Use the formulas: AM: (1 + mod_index * message) * np.cos(2 * np.pi * carrier_freq * t) FM: np.cos(2 * np.pi * carrier_freq * t + mod_index * np.sin(2 * np.pi * 5 * t)) PM: np.cos(2 * np.pi * carrier_freq * t + mod_index * message)
Signal Processing
Hint
Use the given formulas exactly to create the three signals.
4
Plot the original and modulated signals
Import matplotlib.pyplot as plt. Plot t vs message, am_signal, fm_signal, and pm_signal on the same figure with labels 'Message', 'AM', 'FM', and 'PM'. Add a legend and show the plot.
Signal Processing
Hint
Use plt.plot for each signal with the correct label, then call plt.legend() and plt.show().
Practice
(1/5)
1. Which type of modulation changes the amplitude of the carrier wave to transmit information?
easy
A. Frequency Modulation (FM)
B. Amplitude Modulation (AM)
C. Phase Modulation (PM)
D. Pulse Modulation
Solution
Step 1: Understand modulation types
Amplitude Modulation (AM) changes the amplitude of the carrier wave to carry information.
Step 2: Compare with other modulation types
Frequency Modulation changes frequency, Phase Modulation changes phase, so they are not correct here.
Final Answer:
Amplitude Modulation (AM) -> Option B
Quick Check:
Amplitude change = AM [OK]
Hint: Amplitude change means AM modulation [OK]
Common Mistakes:
Confusing amplitude change with frequency or phase
Choosing FM or PM instead of AM
Thinking pulse modulation is amplitude modulation
2. Which of the following is the correct way to represent Frequency Modulation (FM) mathematically for a carrier wave c(t) = A_c cos(2πf_c t) with message signal m(t)?
easy
A. s(t) = A_c cos(2πf_c t + k_f m(t))
B. s(t) = A_c (1 + k_a m(t)) cos(2πf_c t)
C. s(t) = A_c cos(2π(f_c + k_f m(t)) t)
D. s(t) = A_c cos(2πf_c t) + m(t)
Solution
Step 1: Recall FM formula
Frequency Modulation changes the frequency of the carrier. The instantaneous frequency is f_c + k_f m(t).
B. The carrier frequency f_c is too high for sampling frequency fs
C. The amplitude A_c should be multiplied inside the cosine argument
D. The modulation term should be k_p * m_t, not k_p * np.sin(m_t)
Solution
Step 1: Analyze modulation term in PM formula
Phase modulation uses k_p * m_t inside the cosine argument, not k_p * np.sin(m_t).
Step 2: Identify the error in code
The code incorrectly applies np.sin(m_t) instead of directly using m_t as the phase modulation signal.
Final Answer:
The modulation term should be k_p * m_t, not k_p * np.sin(m_t) -> Option D
Quick Check:
PM uses message signal directly in phase [OK]
Hint: PM uses message signal directly inside cosine phase [OK]
Common Mistakes:
Applying sine twice on message signal
Confusing amplitude with phase modulation
Incorrect time vector or sampling frequency
5. You want to transmit a message signal m(t) that has sudden jumps (discontinuities). Which modulation technique among AM, FM, and PM is best to minimize distortion caused by these jumps, and why?
hard
A. FM, because frequency changes are less affected by amplitude noise
B. PM, because phase changes handle discontinuities smoothly
C. AM, because amplitude changes are less sensitive to sudden jumps
D. None, all modulation types distort sudden jumps equally
Solution
Step 1: Understand effect of sudden jumps on modulation
Sudden jumps cause rapid changes in signal. AM changes amplitude, which is sensitive to noise and distortion.
Step 2: Compare FM and PM for handling jumps
FM changes frequency, which is more robust to amplitude noise and sudden jumps than AM. PM also changes phase but can be more sensitive to rapid phase shifts.
Final Answer:
FM, because frequency changes are less affected by amplitude noise -> Option A
Quick Check:
FM resists distortion from sudden jumps [OK]
Hint: FM resists noise and sudden jumps better than AM or PM [OK]
Common Mistakes:
Choosing AM thinking amplitude is always best
Assuming PM handles jumps better than FM
Ignoring noise sensitivity differences
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.