Download Load_and_Inspect_Waveforms.py from OCEAN-Lab/CTS-PADC_Dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/datasets/OCEAN-Lab/CTS-PADC_Dataset/resolve/main/Load_and_Inspect_Waveforms.py
- Command line
-
hf download hf://datasets/OCEAN-Lab/CTS-PADC_Dataset/Load_and_Inspect_Waveforms.py
-
curl -L -o Load_and_Inspect_Waveforms.py https://huggingface.co/datasets/OCEAN-Lab/CTS-PADC_Dataset/resolve/main/Load_and_Inspect_Waveforms.py
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() |