aboutsummaryrefslogtreecommitdiffstats
path: root/tests/correlator
diff options
context:
space:
mode:
Diffstat (limited to 'tests/correlator')
-rw-r--r--tests/correlator/acgen.dat15
-rw-r--r--tests/correlator/acgen.grc198
-rwxr-xr-xtests/correlator/acgen.py125
-rwxr-xr-xtests/correlator/acproc.py73
4 files changed, 0 insertions, 411 deletions
diff --git a/tests/correlator/acgen.dat b/tests/correlator/acgen.dat
deleted file mode 100644
index a13db8e..0000000
--- a/tests/correlator/acgen.dat
+++ /dev/null
@@ -1,15 +0,0 @@
-s9s9tytyRRP8|!P8|!99)Eס)Eס
-
-""bI:bI:T¡T¡SS٦"٦"o:o:̟w̟wS픺S픺Nj#Nj#8:8:]]XźXź"#"#E:E:ŢŢKKдk#дk#9;9;BBZZU2}#U2}#&4;&4;N
-N
-q?q?##lbZ;lbZ; 颓 vgvga#a#f;f;33##.;.;m=m=xxT#T#P";P";Y~]Y~]ȻȻ(!$(!$;;??DDj$$j$$`<`<3nѣ3nѣ u uĜ&$Ĝ&$#<#<E3E33&$3&$PI<PI<מ/מ/^^V#$V#$/|</|<aa$$G<G<C’C’$$~ <~ <ĤĤר#ר##"=#"= +N+N֟ $֟ $ᚋ=ᚋ=FFrнrн_w$_w$@>@>NN33''&dο&dο''ŮŮ''''DD''^^''''jj''(ǰ(ǰ''ڸڸ''}}''&F&F''''߷߷''gOgO''..''''ZZ''IJIJ'',,''''
-
-''zz''鶿鶿''`*`*''϶϶''AA'''':V:V''EE''gg''ᖶᖶ''ww''xx''''{{''''RpRp''~~''Yuf''<2''|!l''t''}t''
-q''p''p{''˙''d}''Ո''Kv''m̶''%/^o''۶''f'' G''\''#''вS?''Pڶ''''wﶿ''t''''(.ٲ''E;''ֱѲ''>ig''nd''ܸ&''Xܰ9:'']$''4ر''I*{''Ů6'',UC''9''y }''i''{ſ''֛Xિ''_¿''Ҽq'?'?B߿'?'4Փ?'?'?t?I_?'?'???'?'? ?d?'?'?C=<''B''3>Y7'?'?jd?@'?'?G?'?'QD?@޿'?'Ϝ?n'?'L??5ǿ'?'>֣''ȿ''f>q'?'?u'?'ߝ?U'?'? ?v-?'?'?
-??'?'?'?Y?'?'?|>qZ<''D(~''>mZ'?'??{@'?'?鉞?@'?'>C?x ߿'?'~?ޜ'?'y?xǿ'?'S!> <''}ީȿ''!">.'?'o?3'?'?HG'?'??2?'?'?c??'?'?\U??'?'?
-#><''R>''w%$>C
-'?'?22?x@'?'?O!?tv'?'?K߿'?'L!?'?'"?hȿ'?' $>''NDȿ''!$>ʚ'?'"?'?'O!?E'?'??x?'?'?L!? ?'?'?"?t?'?'? $><''N>''!$>C
-'?'?"?x@'?'?O!?tv'?'?K߿'?'L!?'?'"?hȿ'?' $>''NDȿ''!$>ʚ'?'"?'?'O!?E'?'??x?'?'?L!? ?'?'?"?t?'?'? $><''N>''!$>C
-'?'?"?x@'?'?O!?tv'?'?K߿'?'L!?'?'"?hȿ'?' $>''NDȿ''!$>ʚ'?'"?'?'O!?E'?'??x?'?'?L!? ?'?'?"?t?'?'? $><''N>''!$>C
-'?'?"?x@'?'?O!?tv'?'?K߿'?'L!?'?'"?hȿ'?' $>''NDȿ''!$>ʚ'?'"?'?'O!?E'?'??x?'?'?L!? ?'?'?"?t?'?'? $><''N>''!$>C
-'?'?"?x@'?'?O!?tv'?'?K߿'?'L!?'?'"?hȿ'?' $>''NDȿ''!$>ʚ'?'"?'?'O!?E'?'? \ No newline at end of file
diff --git a/tests/correlator/acgen.grc b/tests/correlator/acgen.grc
deleted file mode 100644
index abdc3bc..0000000
--- a/tests/correlator/acgen.grc
+++ /dev/null
@@ -1,198 +0,0 @@
-options:
- parameters:
- author: Naoki Pross
- category: '[GRC Hier Blocks]'
- cmake_opt: ''
- comment: ''
- copyright: ''
- description: ''
- gen_cmake: 'On'
- gen_linking: dynamic
- generate_options: no_gui
- hier_block_src_path: '.:'
- id: acgen
- max_nouts: '0'
- output_language: python
- placement: (0,0)
- qt_qss_theme: ''
- realtime_scheduling: ''
- run: 'True'
- run_command: '{python} -u {filename}'
- run_options: run
- sizing_mode: fixed
- thread_safe_setters: ''
- title: Access Code Symbols Generator
- window_size: ''
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [8, 8]
- rotation: 0
- state: enabled
-
-blocks:
-- name: access_code
- id: variable
- parameters:
- comment: ''
- value: '[ 0xaa, 0xff, 0xff ]'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [40, 292.0]
- rotation: 0
- state: true
-- name: const
- id: variable_constellation
- parameters:
- comment: ''
- const_points: '[-1-1j, -1+1j, 1+1j, 1-1j]'
- dims: '1'
- precision: '8'
- rot_sym: '4'
- soft_dec_lut: None
- sym_map: '[0, 1, 3, 2]'
- type: qpsk
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [464, 124.0]
- rotation: 0
- state: true
-- name: excess_bw
- id: variable
- parameters:
- comment: ''
- value: '1'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [464, 308.0]
- rotation: 0
- state: true
-- name: padding_zeros
- id: variable
- parameters:
- comment: ''
- value: '10'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [40, 364.0]
- rotation: 0
- state: true
-- name: samp_rate
- id: variable
- parameters:
- comment: ''
- value: '32000'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [208, 12.0]
- rotation: 0
- state: enabled
-- name: sps
- id: variable
- parameters:
- comment: ''
- value: '4'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [304, 12.0]
- rotation: 0
- state: true
-- name: blocks_file_sink_0
- id: blocks_file_sink
- parameters:
- affinity: ''
- alias: ''
- append: 'False'
- comment: ''
- file: acgen.dat
- type: complex
- unbuffered: 'False'
- vlen: '1'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [752, 204.0]
- rotation: 0
- state: true
-- name: blocks_throttle_0
- id: blocks_throttle
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- ignoretag: 'True'
- maxoutbuf: '0'
- minoutbuf: '0'
- samples_per_second: samp_rate
- type: byte
- vlen: '1'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [264, 220.0]
- rotation: 0
- state: true
-- name: blocks_vector_source_x_0
- id: blocks_vector_source_x
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- maxoutbuf: '0'
- minoutbuf: '0'
- repeat: 'False'
- tags: '[]'
- type: byte
- vector: '[0x00] * padding_zeros + access_code * 10'
- vlen: '1'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [40, 204.0]
- rotation: 0
- state: true
-- name: digital_constellation_modulator_0
- id: digital_constellation_modulator
- parameters:
- affinity: ''
- alias: ''
- comment: ''
- constellation: const
- differential: 'False'
- excess_bw: excess_bw
- log: 'False'
- maxoutbuf: '0'
- minoutbuf: '0'
- samples_per_symbol: sps
- verbose: 'False'
- states:
- bus_sink: false
- bus_source: false
- bus_structure: null
- coordinate: [464, 196.0]
- rotation: 0
- state: true
-
-connections:
-- [blocks_throttle_0, '0', digital_constellation_modulator_0, '0']
-- [blocks_vector_source_x_0, '0', blocks_throttle_0, '0']
-- [digital_constellation_modulator_0, '0', blocks_file_sink_0, '0']
-
-metadata:
- file_format: 1
diff --git a/tests/correlator/acgen.py b/tests/correlator/acgen.py
deleted file mode 100755
index 4d18b92..0000000
--- a/tests/correlator/acgen.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-#
-# SPDX-License-Identifier: GPL-3.0
-#
-# GNU Radio Python Flow Graph
-# Title: Access Code Symbols Generator
-# Author: Naoki Pross
-# GNU Radio version: 3.8.2.0
-
-from gnuradio import blocks
-from gnuradio import digital
-from gnuradio import gr
-from gnuradio.filter import firdes
-import sys
-import signal
-from argparse import ArgumentParser
-from gnuradio.eng_arg import eng_float, intx
-from gnuradio import eng_notation
-
-
-class acgen(gr.top_block):
-
- def __init__(self):
- gr.top_block.__init__(self, "Access Code Symbols Generator")
-
- ##################################################
- # Variables
- ##################################################
- self.sps = sps = 4
- self.samp_rate = samp_rate = 32000
- self.padding_zeros = padding_zeros = 10
- self.excess_bw = excess_bw = 1
- self.const = const = digital.constellation_qpsk().base()
- self.access_code = access_code = [ 0xaa, 0xff, 0xff ]
-
- ##################################################
- # Blocks
- ##################################################
- self.digital_constellation_modulator_0 = digital.generic_mod(
- constellation=const,
- differential=False,
- samples_per_symbol=sps,
- pre_diff_code=True,
- excess_bw=excess_bw,
- verbose=False,
- log=False)
- self.blocks_vector_source_x_0 = blocks.vector_source_b([0x00] * padding_zeros + access_code * 10, False, 1, [])
- self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char*1, samp_rate,True)
- self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_gr_complex*1, 'acgen.dat', False)
- self.blocks_file_sink_0.set_unbuffered(False)
-
-
-
- ##################################################
- # Connections
- ##################################################
- self.connect((self.blocks_throttle_0, 0), (self.digital_constellation_modulator_0, 0))
- self.connect((self.blocks_vector_source_x_0, 0), (self.blocks_throttle_0, 0))
- self.connect((self.digital_constellation_modulator_0, 0), (self.blocks_file_sink_0, 0))
-
-
- def get_sps(self):
- return self.sps
-
- def set_sps(self, sps):
- self.sps = sps
-
- def get_samp_rate(self):
- return self.samp_rate
-
- def set_samp_rate(self, samp_rate):
- self.samp_rate = samp_rate
- self.blocks_throttle_0.set_sample_rate(self.samp_rate)
-
- def get_padding_zeros(self):
- return self.padding_zeros
-
- def set_padding_zeros(self, padding_zeros):
- self.padding_zeros = padding_zeros
- self.blocks_vector_source_x_0.set_data([0x00] * self.padding_zeros + self.access_code * 10, [])
-
- def get_excess_bw(self):
- return self.excess_bw
-
- def set_excess_bw(self, excess_bw):
- self.excess_bw = excess_bw
-
- def get_const(self):
- return self.const
-
- def set_const(self, const):
- self.const = const
-
- def get_access_code(self):
- return self.access_code
-
- def set_access_code(self, access_code):
- self.access_code = access_code
- self.blocks_vector_source_x_0.set_data([0x00] * self.padding_zeros + self.access_code * 10, [])
-
-
-
-
-
-def main(top_block_cls=acgen, options=None):
- tb = top_block_cls()
-
- def sig_handler(sig=None, frame=None):
- tb.stop()
- tb.wait()
-
- sys.exit(0)
-
- signal.signal(signal.SIGINT, sig_handler)
- signal.signal(signal.SIGTERM, sig_handler)
-
- tb.start()
-
- tb.wait()
-
-
-if __name__ == '__main__':
- main()
diff --git a/tests/correlator/acproc.py b/tests/correlator/acproc.py
deleted file mode 100755
index 50c9a38..0000000
--- a/tests/correlator/acproc.py
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/env python3
-
-import numpy as np
-import matplotlib.pyplot as plt
-from acgen import acgen
-
-# parameters
-access_code_bits = [ 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, ]
-access_code = list(np.packbits([0] * 3 + access_code_bits))
-padding_zeros = 10
-
-# Create samples
-print(f"Modulating symbols for access code {access_code_bits} = {access_code} with after {padding_zeros} empty bytes")
-gen = acgen()
-gen.set_access_code(access_code)
-gen.set_padding_zeros(padding_zeros)
-
-gen.start()
-gen.wait()
-
-# Extract one sequence
-print("Extracting symbol sequence")
-
-# raw data
-data = np.fromfile("acgen.dat", dtype=np.complex64)
-plt.plot(data.real)
-plt.plot(data.imag)
-plt.title("Raw Data (time domain)")
-plt.show()
-
-# take only symbols
-symbols = data[1::gen.sps]
-
-plt.plot(symbols.real, symbols.imag)
-plt.title("Symbols only (constellation)")
-plt.show()
-
-# where ac symbols start, in symbols
-ac_start = (padding_zeros) * 8 + 3 # plus three because code is 13 bits
-ac_end = ac_start + int(np.ceil(len(access_code_bits) / 2.)) # divided by two because QPSK
-
-ac = symbols[ac_start:ac_end]
-
-print(f"Generated {len(ac)} (left padded) symbols from a {len(access_code_bits)} bit sequence")
-print(list(ac))
-
-print(f"Upsampled to {gen.sps} samples per symbos")
-print(sum([[i, i, i, i] for i in ac], []))
-
-fig, (ax1, ax2) = plt.subplots(2, 1)
-fig.tight_layout()
-
-ax1.plot(ac.real, ac.imag)
-ax1.set_title("Symbols of Access Code (constellation)")
-
-ax2.plot(ac.real, ".-")
-ax2.plot(ac.imag, ".-")
-ax2.set_title("Symbols of Access Code (time)")
-plt.show()
-
-fir = list(np.conj(ac[::-1]))
-
-# Print the symbols
-print("Reversed complex conjugate symbols (for FIR filter):")
-print(fir)
-
-# Compute cross correlation
-
-xc = np.convolve(fir, ac)
-
-plt.plot(np.abs(xc))
-plt.title("Cross correlation (FIR)")
-plt.show()