diff options
author | sara <sara.halter@gmx.ch> | 2021-11-18 18:49:17 +0100 |
---|---|---|
committer | sara <sara.halter@gmx.ch> | 2021-11-18 18:49:17 +0100 |
commit | 4d1b64fec463d6f44deccdf94adf44615ac8c419 (patch) | |
tree | 7bd909824020f385d66604ac8b0b6264fbfb6bfc | |
parent | FIR filter weitergearbeitet (diff) | |
parent | Add PDFs (diff) | |
download | Fading-4d1b64fec463d6f44deccdf94adf44615ac8c419.tar.gz Fading-4d1b64fec463d6f44deccdf94adf44615ac8c419.zip |
Merge remote-tracking branch 'origin/master'
-rw-r--r-- | doc/slides/slides.pdf | bin | 0 -> 10248 bytes | |||
-rw-r--r-- | doc/thesis/Fading.pdf | bin | 0 -> 469520 bytes | |||
-rw-r--r-- | doc/thesis/Makefile | 2 | ||||
-rw-r--r-- | doc/thesis/chapters/implementation.tex | 148 | ||||
-rw-r--r-- | doc/thesis/chapters/theory.tex | 17 | ||||
-rw-r--r-- | doc/thesis/tex/docstyle.sty | 3 | ||||
-rw-r--r-- | notebooks/FrameSynchronization.ipynb | 73 | ||||
-rw-r--r-- | src/gr-fadingui/grc/fadingui_xor_frame_sync.block.yml | 37 | ||||
-rw-r--r-- | src/gr-fadingui/python/datasource.py | 3 | ||||
-rw-r--r-- | src/gr-fadingui/python/xor_frame_sync.py | 58 | ||||
-rw-r--r-- | tests/fadingui/QAM/qam_nogui.grc | 25 | ||||
-rwxr-xr-x | tests/fadingui/QAM/qam_nogui.py | 4 |
12 files changed, 209 insertions, 161 deletions
diff --git a/doc/slides/slides.pdf b/doc/slides/slides.pdf Binary files differnew file mode 100644 index 0000000..9e7e104 --- /dev/null +++ b/doc/slides/slides.pdf diff --git a/doc/thesis/Fading.pdf b/doc/thesis/Fading.pdf Binary files differnew file mode 100644 index 0000000..9896dc4 --- /dev/null +++ b/doc/thesis/Fading.pdf diff --git a/doc/thesis/Makefile b/doc/thesis/Makefile index c207a17..be2b4bb 100644 --- a/doc/thesis/Makefile +++ b/doc/thesis/Makefile @@ -47,7 +47,7 @@ all: $(PDF) biber $(basename $(MAIN)) $(TEX) $(TEXARGS) $< # embed fonts - gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dEmbedAllFonts=true -sOutputFile=$@_font_embedded.pdf -f $@ + # gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dEmbedAllFonts=true -sOutputFile=$@_font_embedded.pdf -f $@ .PHONY: clean cleanall clean: diff --git a/doc/thesis/chapters/implementation.tex b/doc/thesis/chapters/implementation.tex index 1052f6b..21235ea 100644 --- a/doc/thesis/chapters/implementation.tex +++ b/doc/thesis/chapters/implementation.tex @@ -2,11 +2,72 @@ \chapter{Implementation} -\section{Simulaton} -%%TO DO: quelle https://wiki.gnuradio.org/ +\section{Overview} +% TODO: quelle https://wiki.gnuradio.org/ For the simulation task and after for the Hardware part, the open-source Software GNU Radio has been chosen. This software uses toolboxes for signal processing systems too simulate or/and implement a software-defined radio, based on Python and some C++ implementations for some rapid-application-development environments. The toolboxes can simply, with the help of the graphical user interface, used by drag-and-drop. The Boxes are used to write applications, to receive or to transmit date for a digital system. Some blocks like different filters, channel codes or demodulator elements and a lot more are already implemented. For missing application new elements can be added by coding own blocks. With the help of the GNU Radio software those toolboxes can easily get connected to each other, creating data streams. +\section{Sender chain} +\subsection{Data source} + +%% TODO: replace with file file +In this simulation a random source has been chosen. + +\subsection{Modulation} + +The constellation modulator block is used for a root-raised-cosine-filtered basis modulation. The block gives an input of a byte stream as complex modulated signal in the baseband back. +Further more it's possible to chose the modulation type here, in this example it is 16QAM, but QPSK, 8PSK and BPSK would also be possible. + +\section{Receiver chain} + +\subsection{Envelope detector} + +\paragraph{Polyphase Clock Sync} +%% To Do : nochmals anschauen ob dieese erklärung verständlich ist und richtig interpretiert wurde. +With the the polyphase clock sync the symbols can be synchronized by preforming a time synchronization with the help of multiple filterbanks. For that the derivation of the filtered signal should be minimized whish turns to a better SNR. This works with the help of two filterbanks, one of them contains the filters of the signal adapted to the pulse shaping with several phases. The other contains its derivative. So in the time domain it has a sinc shape, for the output Signal the sinc peak should be on a sample, with the fact that sinc(0) = 1 and sinc(0)' = 0 an error signal can be generated which tells how far away from the peak it is. This error Signal should be zero this is possible with the help of a loop second order whish constants the number of the filterbank and the rate. This rate is generated because of the clock difference between the transmitter and reviver to synchronies the receiver the filter goes through the phases. For the output one sample per symbol is enough. + +\paragraph{Equalizer} + +\paragraph{Costas Loop} + +The Costas Loop is used for frequency and phase adjustment it locks the center frequency of the signal additional it converts it back to de baseband. For different modulation types different orders of the loop had to be chosen + +\paragraph{Constellation decoder} + +From the complex space the constellation points are decode to bits. + +\subsection{Frame synchronization} + +\section{Channel simulations} + +Here its possible to add some AWGN noise in the channel line. Different parameters can be changed like the noise voltage, time or the frequency offset. + +\skelpar[5]{ + Discuss the multitap FIR model we used. How it is possible to set the delay etc. Also mathematics for the interpolation. +} + +To get a basic line for further simulations a 16QAM has been made. The results of this simulation are shown in \figref{fig:simul16QAM} and \figref{fig:simul16QAM_1} as the red Signal. In \tabref{tab:modulation_settings} some importer Parameter settings for a different modulation scheme are mentioned. + +A FIR-Filter was added in the Channel to create a time delay between tow paths. In \figref{fig:simul16QAM} the result includes a direct path and a delayed one. In the plot of \figref{fig:simul16QAM_1} the transmission line dosn't include a direct path. It's impotent to mention that the delay should be smaller than the symbol rate or a multiple of it. + +For the a first simulation with some fading the 16QAM simulation model has been extended with a FIR-Filter in the Chanel. The results of this simulation are shown in \figref{fig:simul16QAM} and \figref{fig:simul16QAM_1} as the blue Signal. + + +\section{Hardware} + +As Hardware we chosen the USRP B210 from Ettus Research, with the following specifications shown in \tabref{tab:USRP B210 specifications}. Because this SDR is more than enough for our requires. + +For the Hardware setup up some changes are made in the file from the 16QAM simulation to fit with the SDRs. For the first test a coaxial cable was used as transmission line, after the cabel were been replaced with two antennas. The gnu radio block scheme is shown in \figref{fig:simul16QAM_Hardware_Aufbau}. The results for s anntena set uo with a transmission line of 20cm are plotted in \figref{fig:simul16QAM__Hardware}. + +Instead of the channel modeling block the USRP blocks are used. The sink as transmitter and the source as resiver. The Signal is sended on a center frequency of 2.4GHz. + +\subsection{Empirical BER} +\subsection{Measurements} + +% +% +% + \begin{figure} \includegraphics[width=\linewidth]{./figures/pdfs/qam_nogui.pdf} \caption{GNU Radio Blocks} @@ -25,9 +86,6 @@ For the simulation task and after for the Hardware part, the open-source Softwar \label{fig:simul16QAM_1} \end{figure} -\subsection{16QAM Simulation} -To get a basic line for further simulations a 16QAM has been made. The results of this simulation are shown in \figref{fig:simul16QAM} and \figref{fig:simul16QAM_1} as the red Signal. In \tabref{tab:modulation_settings} some importer Parameter settings for a different modulation scheme are mentioned. - \begin{table}[] \centering \caption{Modulation settings for different scheme} @@ -44,59 +102,6 @@ To get a basic line for further simulations a 16QAM has been made. The results o \label{tab:modulation_settings} \end{table} - -\subsubsection{Transmitter} -\paragraph{Source} -In this simulation a random source has been chosen. -\paragraph{Modulator} -The constellation modulator block is used for a root-raised-cosine-filtered basis modulation. The block gives an input of a byte stream as complex modulated signal in the baseband back. -Further more it's possible to chose the modulation type here, in this example it is 16QAM, but QPSK, 8PSK and BPSK would also be possible. - -\subsubsection{Channel} -\paragraph{Channel Mode} -Here its possible to add some AWGN noise in the channel line. Different parameters can be changed like the noise voltage, time or the frequency offset. - -\subsubsection{Receiver} -\paragraph{Polyphase Clock Sync} -%% To Do : nochmals anschauen ob dieese erklärung verständlich ist und richtig interpretiert wurde. -With the the polyphase clock sync the symbols can be synchronized by preforming a time synchronization with the help of multiple filterbanks. For that the derivation of the filtered signal should be minimized whish turns to a better SNR. This works with the help of two filterbanks, one of them contains the filters of the signal adapted to the pulse shaping with several phases. The other contains its derivative. So in the time domain it has a sinc shape, for the output Signal the sinc peak should be on a sample, with the fact that sinc(0) = 1 and sinc(0)' = 0 an error signal can be generated which tells how far away from the peak it is. This error Signal should be zero this is possible with the help of a loop second order whish constants the number of the filterbank and the rate. This rate is generated because of the clock difference between the transmitter and reviver to synchronies the receiver the filter goes through the phases. - -For the output one sample per symbol is enough. - -\paragraph{Equalizer} -? - - -\paragraph{Costas Loop} - -The Costas Loop is used for frequency and phase adjustment it locks the center frequency of the signal additional it converts it back to de baseband. For different modulation types different orders of the loop had to be chosen - -\paragraph{Decoder} - -From the complex space the constellation points are decode to bits. - - - -\subsection{Simulation Fading} -For the a first simulation with some fading the 16QAM simulation model has been extended with a FIR-Filter in the Chanel. The results of this simulation are shown in \figref{fig:simul16QAM} and \figref{fig:simul16QAM_1} as the blue Signal. - -\subsubsection{Channel} -\subsubsection{FIR-Filter} -A FIR-Filter was added in the Channel to create a time delay between tow paths. In \figref{fig:simul16QAM} the result includes a direct path and a delayed one. In the plot of \figref{fig:simul16QAM_1} the transmission line dosn't include a direct path. It's impotent to mention that the delay should be smaller than the symbol rate or a multiple of it. - -\newpage -\section{Hardware} - -As Hardware we chosen the USRP B210 from Ettus Research, with the following specifications shown in \tabref{tab:USRP B210 specifications}. Because this SDR is more than enough for our requires. - - -\subsection{16QAM Hardware setup} -For the Hardware setup up some changes are made in the file from the 16QAM simulation to fit with the SDRs. For the first test a coaxial cable was used as transmission line, after the cabel were been replaced with two antennas. The gnu radio block scheme is shown in \figref{fig:simul16QAM_Hardware_Aufbau}. The results for s anntena set uo with a transmission line of 20cm are plotted in \figref{fig:simul16QAM__Hardware}. - -\subsubsection{Channel} -\paragraph{UHD: USRP Sink and Source} -Instead of the channel modeling block the USRP blocks are used. The sink as transmitter and the source as resiver. The Signal is sended on a center frequency of 2.4GHz. - \begin{figure} \includegraphics[width=\linewidth]{./figures/pdfs/qam_Hardware_1711.pdf} \caption{GNU Radio Blocks Hardware} @@ -109,34 +114,21 @@ Instead of the channel modeling block the USRP blocks are used. The sink as tran \label{fig:simul16QAM__Hardware} \end{figure} - - % To Do: Picture of the setup - \begin{table}[] %To DO sepzifikationen ampssen / genauer? https://www.ettus.com/wp-content/uploads/2019/01/b200-b210_spec_sheet.pdf %https://kb.ettus.com/B200/B210/B200mini/B205mini#FAQ \centering \caption{USRP B210 specifications} - \begin{tabular}{ccc} - \midrule - Dimensions & 9.7 x 15.5 x 1.5 cm \\ - Ports & - 2 TX , 2 RX, Half or Full Duplex\\ - RF frequencies & from 70MHz to 6GHz\\ - Bandwidth & 200kHz-56MHz\\ - External reference input & 10 MHz \\ + \begin{tabular}{ll} + \toprule + Dimensions & \(9.7 \times 15.5 \times 1.5\) cm \\ + Ports & 2 TX, 2 RX, Half or Full Duplex \\ + RF frequencies & from 70MHz to 6GHz \\ + Bandwidth & 200kHz -- 56MHz \\ + External reference input & 10 MHz \\ \bottomrule \end{tabular} \label{tab:USRP B210 specifications} \end{table} - - - - -\section{Measurements} - - - -\section{Results} diff --git a/doc/thesis/chapters/theory.tex b/doc/thesis/chapters/theory.tex index 9d61b60..92dea24 100644 --- a/doc/thesis/chapters/theory.tex +++ b/doc/thesis/chapters/theory.tex @@ -314,20 +314,3 @@ Because as mentioned earlier it is difficult to estimate the time-dependent para \sim \mathcal{N} \left( \frac{A_l}{\sqrt{2}}, \frac{1}{2} \sigma_l^2 \right) \end{equation} \skelpar[4] - -\section{Receiver DSP chain} - -\skelpar[3]{Overview of the DSP chain.} - -\begin{figure} - \centering - \skelfig[width = .8\linewidth] - \caption{ - Signal processing chain of the receiver. - \label{fig:rx-dsp-chain} - } -\end{figure} - -\paragraph{Synchronization} \skelpar[4]{Polyphase filter bank.} -\paragraph{Equalization} \skelpar[4]{CMA Equalizer.} -\paragraph{Fine tuning} \skelpar[4]{Costas Loop.} diff --git a/doc/thesis/tex/docstyle.sty b/doc/thesis/tex/docstyle.sty index b9a0b8d..def2495 100644 --- a/doc/thesis/tex/docstyle.sty +++ b/doc/thesis/tex/docstyle.sty @@ -45,6 +45,7 @@ \RequirePackage{roboto} % Bera for monospaced font \setmonofont[Path=misc/, + Scale=0.85, BoldFont = VeraMoBd, ItalicFont = VeraMoIt, BoldItalicFont = VeraMoBI, @@ -116,7 +117,7 @@ language = TeX, showstringspaces = false, % font - basicstyle = \ttfamily\small, + basicstyle = \ttfamily, identifierstyle = \color{black}, keywordstyle = \bfseries \color{blue!70!black}, commentstyle = \color{gray}, diff --git a/notebooks/FrameSynchronization.ipynb b/notebooks/FrameSynchronization.ipynb index a659a7b..e0187b2 100644 --- a/notebooks/FrameSynchronization.ipynb +++ b/notebooks/FrameSynchronization.ipynb @@ -3,7 +3,7 @@ { "cell_type": "code", "execution_count": 1, - "id": "5d5acf43", + "id": "57a55a8c", "metadata": {}, "outputs": [], "source": [ @@ -16,7 +16,7 @@ }, { "cell_type": "markdown", - "id": "4b294887", + "id": "dc4b9dfd", "metadata": {}, "source": [ "# Digital Frame Synchronization\n" @@ -24,22 +24,21 @@ }, { "cell_type": "code", - "execution_count": 2, - "id": "5bec50ff", - "metadata": {}, + "execution_count": 27, + "id": "025c6919", + "metadata": { + "scrolled": false + }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Header sequence (N=16): [1 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1]\n", - "Cross correlation: [ 3. 4. 5. 5. 6. 4. 4. 6. 4. 4. 5. 8. 7. 10. 8. 7. 8. 10.\n", - " 7. 8. 8. 9. 14. 11. 9. 10. 12. 9. 13. 9. 9. 11. 13. 9. 12. 11.\n", - " 9. 9. 13. 10. 9. 11. 9. 14. 12. 9. 10. 11. 8. 11. 6. 9. 8. 11.\n", - " 6. 7. 9. 8. 7. 4. 4. 9. 9. 7. 6. 7. 9. 11. 8. 7. 10. 12.\n", - " 10. 11. 11. 10. 9. 10. 9. 7. 10. 7. 9. 6. 7. 6. 5. 4. 5. 2.\n", - " 4. 3.]\n", - "Correlation peak value: 14.0\n" + "Header (N=16): [1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1]\n", + "Stream (N=80): [0 0 1 1 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 1 1 0 1 1 1\n", + " 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 0 1 0 1 1 0 0 1 1 1 0 0 1 1 1 1 1 0\n", + " 0 1 1 1 0 1]\n", + "Correlation peak value: 16 at i=47\n" ] }, { @@ -48,13 +47,13 @@ "<StemContainer object of 3 artists>" ] }, - "execution_count": 2, + "execution_count": 27, "metadata": {}, "output_type": "execute_result" }, { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAABZUAAAEvCAYAAAA90y+qAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAhwklEQVR4nO3df4we6UEf8O/TtQOb0GihMRBvkl6o0EIEapdaLYYKRYRqA0SJhUBN1KCUFt1VKhAo7JEFqWn/4Ee1iIIKQjpBCIjIHDKuiRBlifgh2j/I4WThnOSyAgFxbn0hjtACoq9qZ+/pH7u+2rk9e/bdeWd2Zj8f6WTv7I7n+zzzvs87/so3U2qtAQAAAACAJv5e3wEAAAAAABgOpTIAAAAAAI0plQEAAAAAaEypDAAAAABAY0plAAAAAAAaUyoDAAAAANDYqS4P9rKXvaw+9NBDXR4SAAAAAIBD+sAHPvCpWuuZg77Xaan80EMP5erVq10eEgAAAACAQyqlfOyFvuf2FwAAAAAANKZUBgAAAACgMaUyAAAAAACNKZUBAAAAAGhMqQwAAAAAQGNKZQAAAAAAGlMqAwAAAADQ2KkH/UAp5V1J3pDkk7XWL/uM731fkvUkZ2qtn5pNRAD6dmVzO+sbW7mxM8nZhfmsrizlwvJi37GAE8qaBAAA/WryL5XfneT1n7mxlPLKJP8yyfWWMwFwjFzZ3M7a5WvZ3pmkJtnemWTt8rVc2dzuOxpwAlmTAACgfw8slWutv5/krw741n9L8miS2nYoAI6P9Y2tTG7v3rNtcns36xtbPSUCTjJrEgAA9G+qeyqXUt6YZLvW+scNfvbhUsrVUsrVmzdvTnM4AHp0Y2dyqO0As2RNAgCA/h26VC6lvDjJDyb5T01+vtb6WK31XK313JkzZw57OAB6dnZh/lDbAWbJ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oTKAAAAAAB0JlQGAAAAAKAzoTIAAAAAAJ0JlQEAAAAA6Ow/AF/VxqC7bv8qAAAAAElFTkSuQmCC\n", "text/plain": [ "<Figure size 1800x360 with 1 Axes>" ] @@ -67,42 +66,40 @@ ], "source": [ "# Create test data\n", - "seq = np.array([(0xbeef >> i) & 0x1 for i in range(4 * 4)])\n", - "# seq = np.array([1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1])\n", - "\n", + "seq = np.unpackbits(np.array([0xbe, 0xef], dtype=np.dtype(\"uint8\")))\n", "stream = np.concatenate([\n", - " np.random.randint(low=0, high=2, size=30), seq, np.random.randint(low=0, high=2, size=30)\n", + " np.random.randint(low=0, high=2, size=32), seq, np.random.randint(low=0, high=2, size=32)\n", "])\n", "\n", - "print(f\"Header sequence (N={len(seq)}): {seq}\")\n", - "# print(f\"Data stream: {stream}\")\n", + "print(f\"Header (N={len(seq)}): {seq}\")\n", + "print(f\"Stream (N={len(stream)}): {stream}\")\n", "\n", - "# compute cross correlation\n", - "def distance(v):\n", - " return len(seq) - sum(np.logical_xor(v, seq))\n", - "\n", - "fifo = RingBuffer(len(seq))\n", - "xcorr = RingBuffer(len(stream) + len(seq))\n", + "# Create buffers for cross correlation\n", + "fifo = RingBuffer(len(seq), dtype=np.dtype(\"uint8\"))\n", + "xcorr = RingBuffer(len(stream) + len(seq), dtype=np.dtype(\"uint8\"))\n", "\n", "## fill FIFO with zeros\n", "fifo.extend(np.zeros(fifo.maxlen))\n", "\n", - "for i in range(len(stream) + len(seq)):\n", - " #print(np.array(fifo))\n", - " xcorr.append(distance(np.array(fifo)))\n", + "def correlation(v):\n", + " n = len(seq)\n", + " d = np.logical_xor(v, seq) # or bitwise_xor, no difference in this case\n", + " return n - sum(d)\n", + " \n", + "for i in range(len(stream) + len(seq) + 1):\n", + " xcorr.append(correlation(np.array(fifo)))\n", " \n", + " # append stream data\n", " # if the stream is finished use zeros\n", - " fifo.pop()\n", - " if i < len(stream):\n", - " fifo.appendleft(stream[i])\n", - " else:\n", - " fifo.appendleft(0)\n", + " fifo.append(stream[i] if i < len(stream) else 0)\n", "\n", - "print(f\"Cross correlation: {np.array(xcorr)}\")\n", - "print(f\"Correlation peak value: {max(np.array(xcorr))}\")\n", + "# unwrap values\n", + "xc = np.array(xcorr)\n", + "# print(f\"Cross correlation: {xc}\")\n", + "print(f\"Correlation peak value: {np.amax(xc)} at i={np.argmax(xc)}\")\n", "\n", "plt.figure(figsize = (25, 5))\n", - "plt.stem(np.array(xcorr))" + "plt.stem(xc)" ] } ], diff --git a/src/gr-fadingui/grc/fadingui_xor_frame_sync.block.yml b/src/gr-fadingui/grc/fadingui_xor_frame_sync.block.yml index 92be2a8..35eb132 100644 --- a/src/gr-fadingui/grc/fadingui_xor_frame_sync.block.yml +++ b/src/gr-fadingui/grc/fadingui_xor_frame_sync.block.yml @@ -1,10 +1,10 @@ id: fadingui_xor_frame_sync -label: xor_frame_sync +label: XOR Correlation Synchronizer category: '[fadingui]' templates: imports: import fadingui - make: fadingui.xor_frame_sync() + make: fadingui.xor_frame_sync(sync_pattern=${pattern}, buffer_size=${buffer_size}) # Make one 'parameters' list entry for every parameter you want settable from the GUI. # Keys include: @@ -12,12 +12,17 @@ templates: # * label (label shown in the GUI) # * dtype (e.g. int, float, complex, byte, short, xxx_vector, ...) parameters: -- id: ... - label: ... - dtype: ... -- id: ... - label: ... - dtype: ... +- id: pattern + label: Bit pattern + dtype: raw + +- id: pattern_len + label: Pattern length + dtype: raw + +- id: buffer_size + label: Delay buffer size + dtype: int # Make one 'inputs' list entry per input and one 'outputs' list entry per output. # Keys include: @@ -27,18 +32,14 @@ parameters: # * vlen (optional - data stream vector length. Default is 1) # * optional (optional - set to 1 for optional inputs. Default is 0) inputs: -- label: ... - domain: ... - dtype: ... - vlen: ... - optional: ... +- label: in + domain: stream + dtype: byte outputs: -- label: ... - domain: ... - dtype: ... - vlen: ... - optional: ... +- label: out + domain: stream + dtype: byte # 'file_format' specifies the version of the GRC yml format used in the file # and should usually not be changed. diff --git a/src/gr-fadingui/python/datasource.py b/src/gr-fadingui/python/datasource.py index 764b4d5..ab2f441 100644 --- a/src/gr-fadingui/python/datasource.py +++ b/src/gr-fadingui/python/datasource.py @@ -10,7 +10,8 @@ from gnuradio import gr class datasource(gr.sync_block): """ - Loads data from a file choosen in the graphical user interface. + Loads data from a file choosen in the graphical user interface, splits into + chunks and puts a preamble in front of it(frame). """ HEADER_LEN = 11; diff --git a/src/gr-fadingui/python/xor_frame_sync.py b/src/gr-fadingui/python/xor_frame_sync.py index 9d9064f..735a031 100644 --- a/src/gr-fadingui/python/xor_frame_sync.py +++ b/src/gr-fadingui/python/xor_frame_sync.py @@ -4,24 +4,76 @@ # Copyright 2021 Naoki Pross. -import numpy +import numpy as np +from numpy_ringbuffer import RingBuffer + from gnuradio import gr + class xor_frame_sync(gr.sync_block): """ docstring for block xor_frame_sync """ - def __init__(self, sync_pattern): + def __init__(self, sync_pattern, buffer_size): gr.sync_block.__init__(self, name="xor_frame_sync", in_sig=[np.byte], out_sig=[np.byte]) + # binary pattern to match + self.pattern = np.array(sync_pattern, dtype=np.dtype("uint8")) + self.nbits = len(sync_pattern) + + # buffer to delay the data + self.delay_fifo = RingBuffer(buffer_size, dtype=np.byte) + + # buffers to store cross correlation data + self.xcorr = RingBuffer(buffer_size, dtype=np.dtype("uint8")) + + # synchronization state + self.synchronized = False + self.delay = 0 + + def xcorrelation(self): + """ + Compute the binary correlation between the stream and the stored + pattern. Binary correlation between two bit vectors is just size of the + vector(s) minus the number of bits that differ. + """ + unpacked = np.unpackbits(self.delay_fifo[0]) + return self.nbits - sum(np.logical_xor(unpacked, self.pattern)) + def work(self, input_items, output_items): + """ + Process the inputs, that means: + + - Check that the buffer is synchronized, i.e. there is the sync + pattern appears every k bits, where k is the size of the packet. + + - If the buffer is not synchronized, compute a binary cross + correlation to find how by much the stream should be delayed. + """ inp = input_items[0] out = output_items[0] - out[:] = inp + # Add data to delay buffer + self.delay_fifo.appendleft(inp) + + # TODO: check for synchronization, else compute + + # Compute correlation + if not self.synchronized: + self.xcorr.append(self.xcorrelation()) + + peak = np.argmax(self.xcorr) + if self.xcorr[peak] != self.nbits: + print(f"Warning! XOR correlation is not perfect (peak value = {self.xcorr[peak]})") + + self.delay = peak + self.synchronized = True + + # return data with delay + out[:] = self.delay_fifo[self.delay] return len(output_items[0]) diff --git a/tests/fadingui/QAM/qam_nogui.grc b/tests/fadingui/QAM/qam_nogui.grc index 2c6abf8..e9028b6 100644 --- a/tests/fadingui/QAM/qam_nogui.grc +++ b/tests/fadingui/QAM/qam_nogui.grc @@ -265,7 +265,7 @@ blocks: bus_sink: false bus_source: false bus_structure: null - coordinate: [2336, 424.0] + coordinate: [2584, 456.0] rotation: 0 state: true - name: blocks_throttle_0 @@ -429,7 +429,7 @@ blocks: bus_sink: false bus_source: false bus_structure: null - coordinate: [2136, 420.0] + coordinate: [2144, 452.0] rotation: 0 state: true - name: digital_pfb_clock_sync_xxx_0 @@ -489,6 +489,24 @@ blocks: coordinate: [2096, 180.0] rotation: 0 state: true +- name: fadingui_xor_frame_sync_0 + id: fadingui_xor_frame_sync + parameters: + affinity: '' + alias: '' + buffer_size: '128' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + pattern: '[]' + pattern_len: '10' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [2304, 436.0] + rotation: 0 + state: true connections: - [blocks_throttle_0, '0', channels_channel_model_0, '0'] @@ -500,9 +518,10 @@ connections: - [digital_costas_loop_cc_0, '0', digital_constellation_decoder_cb_0, '0'] - [digital_costas_loop_cc_0, '0', fadingui_dearpygui_sink_0, '0'] - [digital_diff_decoder_bb_0, '0', digital_map_bb_0, '0'] -- [digital_map_bb_0, '0', blocks_null_sink_0, '0'] +- [digital_map_bb_0, '0', fadingui_xor_frame_sync_0, '0'] - [digital_pfb_clock_sync_xxx_0, '0', digital_cma_equalizer_cc_0, '0'] - [fadingui_datasource_0, '0', blocks_vector_to_stream_0, '0'] +- [fadingui_xor_frame_sync_0, '0', blocks_null_sink_0, '0'] metadata: file_format: 1 diff --git a/tests/fadingui/QAM/qam_nogui.py b/tests/fadingui/QAM/qam_nogui.py index e9aa15b..56fc49b 100755 --- a/tests/fadingui/QAM/qam_nogui.py +++ b/tests/fadingui/QAM/qam_nogui.py @@ -52,6 +52,7 @@ class qam_nogui(gr.top_block): ################################################## # Blocks ################################################## + self.fadingui_xor_frame_sync_0 = fadingui.xor_frame_sync(sync_pattern=[], buffer_size=128) self.fadingui_dearpygui_sink_0 = fadingui.dearpygui_sink(sock_addr='udp://localhost:31415', ui_element_id=0) self.fadingui_datasource_0 = fadingui.datasource(vec_len=2037, header_len=11, sock_addr='udp://', file_list=["./lena512color.tiff"]) self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf(sps, timing_loop_bw, rrc_taps, nfilts, nfilts/2, 1.5, 1) @@ -93,9 +94,10 @@ class qam_nogui(gr.top_block): self.connect((self.digital_costas_loop_cc_0, 0), (self.digital_constellation_decoder_cb_0, 0)) self.connect((self.digital_costas_loop_cc_0, 0), (self.fadingui_dearpygui_sink_0, 0)) self.connect((self.digital_diff_decoder_bb_0, 0), (self.digital_map_bb_0, 0)) - self.connect((self.digital_map_bb_0, 0), (self.blocks_null_sink_0, 0)) + self.connect((self.digital_map_bb_0, 0), (self.fadingui_xor_frame_sync_0, 0)) self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.digital_cma_equalizer_cc_0, 0)) self.connect((self.fadingui_datasource_0, 0), (self.blocks_vector_to_stream_0, 0)) + self.connect((self.fadingui_xor_frame_sync_0, 0), (self.blocks_null_sink_0, 0)) def get_sps(self): |