aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsara <sara.halter@gmx.ch>2021-12-22 17:41:45 +0100
committersara <sara.halter@gmx.ch>2021-12-22 17:41:45 +0100
commit2f3e5b0d6ff1c8f0fb1506413164bc975a0cbb36 (patch)
tree9af3e5a2bdfd66e9656baf528602728f89fe066e
parentdescription of the GUI (diff)
parentCreate makefile for slides (diff)
downloadFading-2f3e5b0d6ff1c8f0fb1506413164bc975a0cbb36.tar.gz
Fading-2f3e5b0d6ff1c8f0fb1506413164bc975a0cbb36.zip
Merge remote-tracking branch 'origin/master'
-rw-r--r--doc/slides/Makefile62
l---------doc/slides/figures1
l---------doc/slides/tex1
-rwxr-xr-xflowgraphs/qpsk_sim.py21
4 files changed, 69 insertions, 16 deletions
diff --git a/doc/slides/Makefile b/doc/slides/Makefile
new file mode 100644
index 0000000..912d603
--- /dev/null
+++ b/doc/slides/Makefile
@@ -0,0 +1,62 @@
+TEX := xelatex
+TEXARGS := --halt-on-error --interaction=nonstopmode --shell-escape=1 --enable-write18
+
+SOURCES := \
+ slides.tex \
+ \
+ tex/docmacros.sty \
+ \
+ figures/tikz/overview.tex \
+ figures/tikz/psk-constellation.tex \
+ figures/tikz/qam-modulator.tex \
+ figures/tikz/qam-constellation.tex \
+ figures/tikz/multipath-sketch.tex \
+ figures/tikz/multipath-impulse-response.tex \
+ figures/tikz/multipath-frequency-response-plots.tex \
+ figures/tikz/tapped-delay-line.tex \
+ figures/tikz/ring-of-scattering-objects.tex \
+ figures/tikz/rayleigh-rice-pdf-plots.tex \
+ figures/tikz/packet-frame.tex \
+ figures/tikz/qpsk-simulations-static.tex \
+ figures/tikz/qpsk-simulations-dynamic.tex \
+ figures/tikz/qam-simulations-dynamic.tex \
+ figures/tikz/hardware.tex
+
+DATA := \
+ figures/data/multipath_frequency_response.dat
+
+# Get the main file from the file
+MAIN := $(shell sed -ne 's/^.*\!TeX root =\(.*\)$$/\1/ p' $(SOURCES))
+PDF := $(patsubst %.tex, %.pdf, $(MAIN))
+
+ifeq ($(strip $(MAIN)),)
+MAIN := $(error Failed to identify TeX root, try adding \
+ `% !TeX root = <filename>` to your main tex file)
+endif
+
+.PHONY: all
+all: $(PDF)
+
+%.dat: %.py
+ /usr/bin/env python3 $<
+
+%.pdf: %.tex $(SOURCES) $(DATA)
+ $(TEX) $(TEXARGS) $<
+ $(TEX) $(TEXARGS) $<
+ # embed fonts
+ # gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dEmbedAllFonts=true -sOutputFile=$@_font_embedded.pdf -f $@
+
+.PHONY: clean cleanall
+clean:
+ @rm -vf *.aux *.aue *.lof *.log *.lot *.fls *.out *.toc *.fmt *.fot *.cb *.cb2 .*.lb *.dvi *.xdv *-converted-to.* *.bbl *.bcf *.blg *-blx.aux *-blx.bib *.run.xml *.fdb_latexmk *.synctex *.synctex\(busy\) *.synctex.gz *.synctex.gz\(busy\) *.pdfsync *.alg *.loa acs-*.bib *.thm *.nav *.pre *.snm *.vrb *.soc *.cut *.cpt *.spl *.ent *.lox *.mf *.acn *.acr *.glg *.glo *.gls *.glsdefs *.lzo *.lzs *.lol *.auxlock *.figlist
+ @rm -vf tex/*.aux
+ @rm -vf chapters/*.aux
+ @rm -vf figures/tikz/*.aux
+ @rm -vfrd figures/externalized
+
+cleanall: clean
+ @rm -vf $(PDF)
+
+.PHONY: continuous
+continuous:
+ ls $(SOURCES) | entr -d make
diff --git a/doc/slides/figures b/doc/slides/figures
new file mode 120000
index 0000000..ee014da
--- /dev/null
+++ b/doc/slides/figures
@@ -0,0 +1 @@
+../thesis/figures \ No newline at end of file
diff --git a/doc/slides/tex b/doc/slides/tex
new file mode 120000
index 0000000..3da1b64
--- /dev/null
+++ b/doc/slides/tex
@@ -0,0 +1 @@
+../thesis/tex \ No newline at end of file
diff --git a/flowgraphs/qpsk_sim.py b/flowgraphs/qpsk_sim.py
index 09a0741..b12e1a9 100755
--- a/flowgraphs/qpsk_sim.py
+++ b/flowgraphs/qpsk_sim.py
@@ -136,7 +136,6 @@ class qpsk_sim(gr.top_block, Qt.QWidget):
self.fadingui_netsink_1 = fadingui.netsink(address='udp://localhost:31418', dtype="complex", vlen=1)
self.fadingui_netsink_0_0 = fadingui.netsink(address='udp://localhost:31415', dtype="float", vlen=1)
self.fadingui_netsink_0 = fadingui.netsink(address='udp://localhost:31416', dtype="complex", vlen=1)
- self.fadingui_multipath_fading_0 = fadingui.multipath_fading(amplitudes=[0.2, 0.08, 0.5, 0.4], delays=[0.25, 3.25, 4, 6.3], los =False)
self.fadingui_ber_0 = fadingui.ber(vgl=list(np.zeros(frame_len)), vlen=frame_len,address='udp://localhost:31420')
self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf(sps, 2 * np.pi / 100, rrc_taps, 32, 16, 1.5, 1)
self.digital_corr_est_cc_0 = digital.corr_est_cc(access_code_symbols, 1, len(access_code_symbols) // 2, 0.9, digital.THRESHOLD_ABSOLUTE)
@@ -150,20 +149,13 @@ class qpsk_sim(gr.top_block, Qt.QWidget):
log=False)
self.digital_constellation_decoder_cb_0 = digital.constellation_decoder_cb(qpsk_const)
self.digital_cma_equalizer_cc_0 = digital.cma_equalizer_cc(15, 1, 2e-3, 1)
+ self.channels_selective_fading_model_0 = channels.selective_fading_model( 8, 5/samp_rate, True, 5, 0, (0,0.05e-6/samp_rate,0.12e-6/samp_rate,0.2e-6/samp_rate,0.23e-6/samp_rate,0.5e-6/samp_rate,1.6e-6/samp_rate,2.3e-6/samp_rate,5e-6/samp_rate), (0.7943282347242815,0.7943282347242815,0.7943282347242815,1,1,1,0.5011872336272722,0.31622776601683794,0.19952623149688797), 9 )
self.blocks_vector_source_x_0 = blocks.vector_source_b(testvec, True, 1, [])
self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True)
self.blocks_tagged_stream_align_0 = blocks.tagged_stream_align(gr.sizeof_char*1, 'frame_start')
self.blocks_stream_to_vector_0 = blocks.stream_to_vector(gr.sizeof_char*1, frame_len)
self.blocks_stream_mux_0 = blocks.stream_mux(gr.sizeof_char*1, [len(testvec), 4])
self.blocks_repack_bits_bb_0 = blocks.repack_bits_bb(2, 8, "", False, gr.GR_LSB_FIRST)
- self.blocks_file_sink_3 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/equalized_qpsk.dat', False)
- self.blocks_file_sink_3.set_unbuffered(False)
- self.blocks_file_sink_2 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/synchronized_qpsk.dat', False)
- self.blocks_file_sink_2.set_unbuffered(False)
- self.blocks_file_sink_1 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/locked_qpsk.dat', False)
- self.blocks_file_sink_1.set_unbuffered(False)
- self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_gr_complex*1, 'data/channel_qpsk.dat', False)
- self.blocks_file_sink_0.set_unbuffered(False)
self.blocks_complex_to_mag_0 = blocks.complex_to_mag(1)
self.analog_random_source_x_0 = blocks.vector_source_b(list(map(int, numpy.random.randint(0, 255, 400))), True)
@@ -178,23 +170,19 @@ class qpsk_sim(gr.top_block, Qt.QWidget):
self.connect((self.blocks_stream_mux_0, 0), (self.digital_constellation_modulator_0, 0))
self.connect((self.blocks_stream_to_vector_0, 0), (self.fadingui_ber_0, 0))
self.connect((self.blocks_tagged_stream_align_0, 0), (self.blocks_repack_bits_bb_0, 0))
- self.connect((self.blocks_throttle_0, 0), (self.fadingui_multipath_fading_0, 0))
+ self.connect((self.blocks_throttle_0, 0), (self.channels_selective_fading_model_0, 0))
self.connect((self.blocks_vector_source_x_0, 0), (self.blocks_stream_mux_0, 0))
- self.connect((self.digital_cma_equalizer_cc_0, 0), (self.blocks_file_sink_3, 0))
+ self.connect((self.channels_selective_fading_model_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0))
+ self.connect((self.channels_selective_fading_model_0, 0), (self.fadingui_netsink_0, 0))
self.connect((self.digital_cma_equalizer_cc_0, 0), (self.digital_corr_est_cc_0, 0))
self.connect((self.digital_cma_equalizer_cc_0, 0), (self.fadingui_netsink_1, 0))
self.connect((self.digital_constellation_decoder_cb_0, 0), (self.blocks_tagged_stream_align_0, 0))
self.connect((self.digital_constellation_modulator_0, 0), (self.blocks_throttle_0, 0))
self.connect((self.digital_corr_est_cc_0, 1), (self.blocks_complex_to_mag_0, 0))
self.connect((self.digital_corr_est_cc_0, 0), (self.fadingui_phasecorrection_0, 0))
- self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.blocks_file_sink_2, 0))
self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.digital_cma_equalizer_cc_0, 0))
self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.fadingui_netsink_4, 0))
self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.qtgui_const_sink_x_1, 1))
- self.connect((self.fadingui_multipath_fading_0, 0), (self.blocks_file_sink_0, 0))
- self.connect((self.fadingui_multipath_fading_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0))
- self.connect((self.fadingui_multipath_fading_0, 0), (self.fadingui_netsink_0, 0))
- self.connect((self.fadingui_phasecorrection_0, 0), (self.blocks_file_sink_1, 0))
self.connect((self.fadingui_phasecorrection_0, 0), (self.digital_constellation_decoder_cb_0, 0))
self.connect((self.fadingui_phasecorrection_0, 0), (self.fadingui_netsink_3, 0))
self.connect((self.fadingui_phasecorrection_0, 0), (self.qtgui_const_sink_x_1, 0))
@@ -240,6 +228,7 @@ class qpsk_sim(gr.top_block, Qt.QWidget):
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.blocks_throttle_0.set_sample_rate(self.samp_rate)
+ self.channels_selective_fading_model_0.set_fDTs(5/self.samp_rate)
def get_rrc_taps(self):
return self.rrc_taps