This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys, getopt, csv | |
class iftop_parser: | |
def __init__(self, fname, edge_ip, radiohead_ip): | |
self.fname = fname | |
self.edge_ip = edge_ip | |
self.radiohead_ip = radiohead_ip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scipy | |
def remove_zeroes_in_msg_stream(stream, start_of_msg, end_of_msg): | |
filtered = [] | |
num_msg = 0 | |
state="ZEROES" | |
for b in stream: | |
if state == "ZEROES": | |
if b != 0: | |
if b != start_of_msg: # this should not happen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
restype,fir | |
fs,1920000.0 | |
pbend,100000.0 | |
gain,1.0 | |
sbstart,120000.0 | |
filttype,lpf | |
ripple,1.0 | |
atten,40.0 | |
wintype,6 | |
ntaps,139 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='utf-8'?> | |
<?grc format='1' created='3.7.12'?> | |
<flow_graph> | |
<timestamp>Wed Mar 21 15:50:27 2018</timestamp> | |
<block> | |
<key>options</key> | |
<param> | |
<key>author</key> | |
<value></value> | |
</param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Inspired by http://mpastell.com/2010/01/18/fir-with-scipy/ | |
import sys, getopt | |
import numpy as np | |
from pylab import * | |
import scipy.signal as signal | |
from pathlib import Path | |
import csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::vector<std::pair<int,int> > d_chunks; | |
std::vector<std::pair<int,int> >::iterator chunks_it; | |
d_chunks.push_back(std::make_pair(0, 0));// Group carriers to chunks | |
chunks_it = d_chunks.end() - 1; | |
if ( chunks_it->second == carrier - 1) { | |
chunks_it->second = carrier; | |
std::cout << "Extending chunk. Carrier: " << carrier << std::endl; | |
} else { | |
d_chunks.push_back(std::make_pair(carrier, carrier)); | |
std::cout << "New chunk. Carrier: " << carrier << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
################################################## | |
# GNU Radio Python Flow Graph | |
# Title: Top Block | |
# Generated: Thu Mar 15 14:47:40 2018 | |
################################################## | |
from gnuradio import blocks | |
from gnuradio import eng_notation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import pyplot as plt | |
import numpy as np | |
from scipy.optimize import fsolve | |
from matplotlib.ticker import EngFormatter | |
def get_lobe(carrier, df, x_init, ncarriers=12,): | |
"Calculating the side lobe signal strength." | |
# Sinc function is by default scaled with pu cos is not | |
carrier = carrier - ncarriers/2 | |
func = lambda z : np.sinc(z) - np.cos(z*np.pi) |