CTS-PADC_Dataset / Load_and_Inspect_Waveforms.py
OCEAN-Lab's picture
Upload 4 files
c89047a verified
Raw History Blame Contribute Delete
1.04 kB
from datasets import load_dataset
import numpy as np
import matplotlib.pyplot as plt
# Load training split
dataset = load_dataset("OCEAN-Lab/CTS-PADC_Dataset", split="train")
# Extract sample 0
sample = dataset[0]
x_distorted = np.array(sample["arcsin_results"]) # Length: 400
y_ground_truth = np.array(sample["test_data"]) # Length: 400
rf_freq = sample["Frequencies"] # Frequency in GHz
rf_power = sample["Power"] # Power in dBm
print(f"Sample 0 -> RF Frequency: {rf_freq} GHz | RF Power: {rf_power} dBm")
print(f"Input shape: {x_distorted.shape} | Target shape: {y_ground_truth.shape}")
# Plot time-domain waveform
plt.figure(figsize=(9, 3.5))
plt.plot(y_ground_truth, label="Ground Truth", color="black", linestyle="--")
plt.plot(x_distorted, label="Distorted Input", color="crimson", alpha=0.7)
plt.title(f"PTS-ADC Capture: {rf_freq} GHz at {rf_power} dBm")
plt.xlabel("Sample Index n")
plt.ylabel("Amplitude (V)")
plt.legend()
plt.grid(True, linestyle=":")
plt.tight_layout()
plt.show()