diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-01-03 12:28:08 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-01-03 12:28:08 +0100 |
commit | 38ef609475a25143640bf8d2d1df5ad6a68b7403 (patch) | |
tree | 2dcd2e4fc289aa21d74b48f70f4f93aabe13f027 /plot.py | |
parent | 255119ae911e65ed5b579034c1d965d770851a1e (diff) | |
download | fl2k_ampliphase-38ef609475a25143640bf8d2d1df5ad6a68b7403.tar.gz fl2k_ampliphase-38ef609475a25143640bf8d2d1df5ad6a68b7403.tar.bz2 fl2k_ampliphase-38ef609475a25143640bf8d2d1df5ad6a68b7403.zip |
Simplify DDS, add plots
Diffstat (limited to 'plot.py')
-rwxr-xr-x | plot.py | 55 |
1 files changed, 55 insertions, 0 deletions
@@ -0,0 +1,55 @@ +#!/usr/bin/env python +import matplotlib.pyplot as plt +import numpy as np + +debug_pd = np.loadtxt("debug-pd.csv", delimiter=",") +sample, slope, pd, pdslope = np.split(debug_pd, 4, 1) + +debug_dds = np.loadtxt("debug-dds.csv", delimiter=",") +dds_ix, dds_phase, dds_phase_delta, dds_phase_idx_i, dds_phase_idx_q = np.split(debug_dds, 5, 1) + +out = np.fromfile("debug-out.i8", dtype="i1") +out_r, out_g = np.split(np.reshape(out, newshape=(out.shape[0]//2, 2)), 2, 1) + +samp_rate = 10000 +input_rate = 1000 +assert(samp_rate % input_rate == 0) +rf_to_baseband_sample_ratio = samp_rate // input_rate; + +L = 200 + +L_out = L * rf_to_baseband_sample_ratio + +plt.figure() +plt.subplot(3, 1, 1) +plt.title("sample") +plt.plot(sample[0:L]) + +plt.subplot(3, 1, 2) +plt.title("pd") +plt.plot(pd[0:L]) + +plt.subplot(3, 1, 3) +plt.title("pdslope") +plt.plot(pdslope[0:L]) + + +plt.figure() +plt.subplot(4, 1, 1) +plt.title("dds ix") +plt.plot(dds_ix[0:L_out]) + +plt.subplot(4, 1, 2) +plt.title("dds phase") +plt.plot(dds_phase[0:L_out]) + +plt.subplot(4, 1, 3) +plt.title("dds phase_delta") +plt.plot(dds_phase_delta[0:L_out]) + +plt.subplot(4, 1, 4) +plt.title("output") +plt.plot(out_r[0:L_out]) +plt.plot(out_g[0:L_out]) + +plt.show() |