Skip to content

Instantly share code, notes, and snippets.

View marcusmueller's full-sized avatar

Marcus Müller marcusmueller

View GitHub Profile
@marcusmueller
marcusmueller / continous_frequency_hopper
Last active December 21, 2015 04:48
Testcase for timed commands. That fails.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Marcus Müller.
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
@marcusmueller
marcusmueller / CMakeList.txt
Created December 4, 2013 07:31
Solution for the fftw3 finding disaster.
########################################################################
# Project setup
########################################################################
cmake_minimum_required(VERSION 2.6)
project(gr-ofdm_radar CXX C)
enable_testing()
#select the release build type by default to get optimization flags
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
@marcusmueller
marcusmueller / max_index.py
Created April 25, 2014 16:11
Max index filter block
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Marcus Müller.
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
<timestamp>Wed Jun 4 10:07:10 2014</timestamp>
<block>
<key>variable_qtgui_range</key>
<param>
<key>id</key>
<value>fftlen</value>
</param>
<param>
@marcusmueller
marcusmueller / Answer1.md
Last active August 29, 2015 14:13
Answers

The total sine table has a length of wave_table_len, which means that the original sine that is saved in that table has a period of wave_table_len samples.

Now, taking every single one of these samples, step=1, means that the resulting sine has a period of wave_table_len, too.

Now, we know that a single sample has a duration of 1.0/f_sample; thus, the generated sine has the real-world time period of wave_table_len/f_sample; it's frequency is the inverse, f_sample/wave_table_len.

step=wave_table_len/10:

consider the for loop:

    for (size_t n = 0; n < buff.size(); n++){
        buff[n] = wave_table(index += step);
    }

now, we see that we hit the wave_table_lenth item in wave_table when n==10; now remember that this wave table lookups happens modulo wavetable_len, ie. wave_table(n * wave_table_len)==wave_table(0) for n being any integer.

@marcusmueller
marcusmueller / analyze.py
Last active August 29, 2015 14:16
Minimal UHD N2x0 Packet sequence checker
#!/usr/bin/python2
import dpkt
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("file", help="pcap file to read", type=argparse.FileType("r"))
args = parser.parse_args()
reader = dpkt.pcap.Reader(args.file)
@marcusmueller
marcusmueller / gist:efc588405a62cc59f17c
Created April 6, 2015 15:01
swig warnings siwg 3.0.5
/home/marcus/psrc/gnuradio/gnuradio-runtime/swig/gr_ctrlport.i:68: Warning 401: Nothing known about base class 'rpcmanager_base'. Ignored.
/home/marcus/psrc/gnuradio/gr-blocks/include/gnuradio/blocks/random_pdu.h:38: Warning 401: Base class 'gr::block' ignored - unknown module name for base. Either import the appropriate module interface file or specify the name of the module in the %import directive.
/home/marcus/psrc/gnuradio/gr-blocks/include/gnuradio/blocks/regenerate_bb.h:45: Warning 401: Base class 'gr::sync_block' ignored - unknown module name for base. Either import the appropriate module interface file or specify the name of the module in the %import directive.
/home/marcus/psrc/gnuradio/gr-blocks/include/gnuradio/blocks/repack_bits_bb.h:48: Warning 401: Base class 'gr::tagged_stream_block' ignored - unknown module name for base. Either import the appropriate module interface file or specify the name of the module in the %import directive.
/home/marcus/psrc/gnuradio/gr-blocks/include/gnuradio/blocks/
@marcusmueller
marcusmueller / CMake Run
Created April 6, 2015 17:10
swig warnings swig 3.0.5
-- Build type set to RelWithDebInfo.
-- Extracting version information from git describe...
-- Compiler Version: cc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-- Compiler Flags: /usr/lib64/ccache/cc:::-O2 -g -DNDEBUG -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized
/usr/lib64/ccache/c++:::-O2 -g -DNDEBUG -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized
-- NO PERF COUNTERS
-- Building Static Libraries: OFF
@marcusmueller
marcusmueller / fading_test.grc
Last active August 29, 2015 14:20
Fading Model attenuation test
<?xml version='1.0' encoding='ASCII'?>
<?grc format='1' created='3.7.8'?>
<flow_graph>
<timestamp>Fri May 8 09:31:33 2015</timestamp>
<block>
<key>options</key>
<param>
<key>id</key>
<value>fading_test</value>
</param>