Skip to content

Commit

Permalink
Add images and equations for migration to wiki.
Browse files Browse the repository at this point in the history
  • Loading branch information
bemasher committed May 19, 2018
1 parent cbd4df4 commit 4540f7d
Show file tree
Hide file tree
Showing 13 changed files with 334 additions and 0 deletions.
35 changes: 35 additions & 0 deletions assets/complex_magnitude.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions assets/filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal
import math

pktlen = 38144 / 4

raw = np.memmap("sample.bin", dtype=np.uint8, offset=(17600<<1)+2048+256, mode='r')

window = raw[:pktlen].copy()
level = 127.4
iq = ((level-(window.astype(np.float64))) / level).view(np.complex128)

fig, subplots = plt.subplots(nrows=2)
fig.set_size_inches(9,9*0.6180339887)

(mag_plot, spec_plot) = subplots

mag = np.abs(iq)

filtered = np.correlate(mag, np.append(np.ones(78), -np.ones(78)))

kernel = np.append(np.ones(78), -np.ones(78))
mag_plot.step(np.arange(kernel.size), kernel)
mag_plot.grid(axis='both')
mag_plot.autoscale(tight=True)
mag_plot.set_ylim(-1.125, 1.125)
mag_plot.set_xlim(-5, 78*2 + 5)
mag_plot.xaxis.set_ticks([0,39, 78, 117, 156])

spec_plot.plot(filtered)
spec_plot.grid(axis='both')
spec_plot.autoscale(tight=True)

plt.savefig('filter.png', dpi=96, transparent=True, bbox_inches="tight")
# plt.show()
Loading

0 comments on commit 4540f7d

Please sign in to comment.