Exercises
ex-sp-ch16-01
EasyCreate a box plot of BER values for 3 modulation schemes (BPSK, QPSK, 16-QAM) using Seaborn. Generate 100 samples per modulation with appropriate noise levels.
Use sns.boxplot(data=df, x="modulation", y="ber").
Implementation
import numpy as np, pandas as pd, seaborn as sns
import matplotlib.pyplot as plt
rng = np.random.default_rng(42)
records = []
for mod, base in [('BPSK', -4), ('QPSK', -3), ('16-QAM', -2)]:
bers = 10**(base + 0.3 * rng.standard_normal(100))
for b in bers:
records.append({'modulation': mod, 'ber': b})
df = pd.DataFrame(records)
fig, ax = plt.subplots(figsize=(6, 4))
sns.boxplot(data=df, x='modulation', y='ber', ax=ax)
ax.set_yscale('log')
ax.set_title('BER by Modulation')
ex-sp-ch16-02
EasyCreate a correlation heatmap of a 5-column simulation result DataFrame
using sns.heatmap with annotations.
ex-sp-ch16-03
EasyCreate an interactive scatter plot with Plotly Express showing throughput vs. SNR, colored by modulation type.
ex-sp-ch16-04
EasyAnimate a traveling sine wave using FuncAnimation and save as GIF.
ex-sp-ch16-05
EasyCreate a polar plot of a dipole antenna pattern in dB scale.
ex-sp-ch16-06
MediumCreate a violin plot comparing throughput distributions across
3 scheduling algorithms and 2 channel conditions, using hue
for the channel type.
ex-sp-ch16-07
MediumBuild a Plotly dashboard with two linked plots: a scatter plot of users and a histogram of their BER values. Selecting points in the scatter should filter the histogram.
ex-sp-ch16-08
MediumAnimate gradient descent on the function showing contours and the optimizer path. Compare standard GD with momentum.
ex-sp-ch16-09
MediumGenerate an eye diagram for 4-PAM signaling with a root-raised cosine pulse at rolloff and SNR = 20 dB.
ex-sp-ch16-10
MediumCreate a waterfall spectrum plot showing 30 seconds of spectrum monitoring data with frequency-hopping interference.
ex-sp-ch16-11
HardImplement a Smith chart from scratch using Matplotlib circles for constant-resistance and constant-reactance lines. Plot the impedance trajectory of a matching network.
ex-sp-ch16-12
HardCreate an animated constellation diagram showing the effect of carrier frequency offset: the constellation rotates, then a PLL corrects it. Show both raw and corrected constellations.
ex-sp-ch16-13
HardBuild a faceted plot (Seaborn FacetGrid) showing BER curves across 4 channel models and 3 coding rates, with shared y-axis (log scale).
ex-sp-ch16-14
ChallengeBuild a complete signal analysis dashboard in Plotly Dash that takes a recorded IQ file and shows: spectrogram, constellation, eye diagram, and BER estimate with interactive parameter tuning.
ex-sp-ch16-15
ChallengeCreate an animated waterfall spectrum showing a 5G NR frame structure with different numerologies (15 kHz, 30 kHz, 60 kHz subcarrier spacing) occupying different bandwidth parts.