0% found this document useful (0 votes)
2 views113 pages

CA250 Cookbook En

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 113

R&S®CA250

Bit Stream Analysis Cookbook


Features and Functions

(XÚÀ93)
4076.5009.03 ─ 01
Radiomonitoring & Radiolocation

Features and Functions


This manual describes the following R&S®CA250 models:
● R&S®CA250 (4076.5009.K03)

The software contained in this product uses several valuable open source software packages. For information, see the "Open
Source Acknowledgment" on the user documentation CD-ROM (included in delivery).
Rohde & Schwarz would like to thank the open source community for their valuable contribution to embedded computing.

© 2016 Rohde & Schwarz GmbH & Co. KG


Mühldorfstr. 15, 81671 München, Germany
Phone: +49 89 41 29 - 0
Fax: +49 89 41 29 12 164
Email: info@rohde-schwarz.com
Internet: www.rohde-schwarz.com
Subject to change – Data without tolerance limits is not binding.
R&S® is a registered trademark of Rohde & Schwarz GmbH & Co. KG.
Trade names are trademarks of their owners.

The following abbreviations are used throughout this manual: R&S®CA250 is abbreviated as R&S CA250.
R&S®CA250 Contents

Contents
1 Introduction............................................................................................ 5
1.1 About this Document....................................................................................................5
1.2 Additional Hints.............................................................................................................5
1.2.1 Getting Started................................................................................................................ 5
1.2.2 Getting Help.................................................................................................................... 6
1.2.3 Software Version.............................................................................................................6

2 General Requirements...........................................................................7

3 Code Analysis - What should I know?................................................. 8

4 The Benefits of Bitstream Analysis......................................................9

5 Teletype using ASCII........................................................................... 11


5.1 Steps for dealing with frame structures................................................................... 11
5.2 Steps for applying alphabets..................................................................................... 15

6 Teletype using Alphabet 3-4............................................................... 18


6.1 Steps for dealing with frame structures................................................................... 18
6.2 Steps for applying alphabets..................................................................................... 21

7 Alphabets..............................................................................................27
7.1 Steps for editing the sample XML file....................................................................... 27
7.2 Steps for producing test data for the sample alphabet........................................... 31
7.3 Steps to process the test data using the sample decoder......................................32
7.4 Steps to display shift and erroneous characters.....................................................33

8 Simple Preamble and Channel Code..................................................34


8.1 Steps for dealing with frame structures................................................................... 34
8.2 Steps to perform a BCH code check......................................................................... 39
8.3 Steps to decode the payload using a BCH decoder................................................ 40
8.4 Steps to check for ASCII and decode using a suitable alphabet........................... 41

9 Scrambler and Coding.........................................................................43


9.1 Steps to determine whether a bitstream is scrambled............................................43
9.2 Steps to determine the type of scrambler and the polynomial...............................45
9.3 Steps to descramble the bitstream using the polynomial...................................... 48

Features and Functions 4076.5009.03 ─ 01 3


R&S®CA250 Contents

9.4 Steps to determine the frame structure.................................................................... 49


9.5 Steps to decode the bitstream...................................................................................51

10 Complex Payload under Disturbed Conditions.................................56


10.1 Steps for dealing with frame structures................................................................... 56
10.2 Steps for dealing with PSK symbols.........................................................................60
10.3 Steps to decode the bitstream...................................................................................67
10.4 Steps for dealing with file formats............................................................................ 70

11 Turbo Product Code............................................................................ 73


11.1 Steps for dealing with Turbo Codes (part 1: BCH decoding)..................................74
11.2 Dealing with Turbo coding (part 2: ASCII decoding)............................................... 79
11.3 Dealing with Turbo coding (part 3: de-interleaving & decoding)............................82

12 Voice Codec with Interleaver Iteration and Code Spreading........... 88


12.1 Steps to confirm that the bitstream has been spread............................................. 89
12.2 Steps to determine the polynomial to be used for a Spreading Analysis............. 90
12.3 Steps to discover the settings to be used for despreading.................................... 93
12.4 Steps to despread the bitstream and check the quality..........................................94
12.5 Steps to despread the bitstream, remove redundant bits, and correct errors......96
12.6 Steps to check for channel coding............................................................................97
12.7 Steps to remove convolutional coding using a Viterbi decoder............................ 98
12.8 Use of a script to discover de-interleaver settings..................................................99
12.9 Steps to de-interleave the bitstream....................................................................... 105
12.10 Steps to detect and remove Reed-Solomon coding.............................................. 106
12.11 Applying a voice codec............................................................................................ 107

13 Appendix - Frequently Asked Questions.........................................109


13.1 What do all the colors in the Table View represent?............................................. 109
13.2 How can I forward results from channel coding analysis to a decoder?............ 109
13.3 How can I enable access to session tracking while a script is running?............ 109
13.4 How can I recognize what type of alphabet has been used?................................110
13.5 Does autocorrelation always provide the frame length?...................................... 110
13.6 How can different views be compared side-by-side?............................................111
13.7 How many symbols should I select for an analysis?............................................ 112

Features and Functions 4076.5009.03 ─ 01 4


R&S®CA250 Introduction
Additional Hints

1 Introduction

1.1 About this Document


It is intended that this document will provide you with a practical introduction to the
R&S CA250 Bit Stream Analysis product.
The document provides 11 worked examples:
● Simple example of the benefit of bitstream analysis
● Teletype using ASCII
● Teletype using Alphabet 3-4
● Adding Alphabets
● Simple Preamble and Channel Code
● Scrambler and Coding
● POCSAG
● Multi-channel bitstream with voice codec
● Complex Payload under Disturbed Conditions
● Using the script interface (interleaver iteration & code spreading)
● Turbo Product Code

The sample R&S CA250 usage scenarios in this document are offered ‘as is’.
The scenarios do not aspire to represent complete workflow processes. They are to be
seen as a guide to aid the novice to gain familiarity with R&S CA250, and to surpass
the initial threshold of ‘Yes, but what is it good for?’.

Licensing Functionality
Some of the functionality described in this document is only available with the proper
license. Please refer to the R&S CA250 Manual or the R&S CA250 data sheet for
details on licensed functionality.

1.2 Additional Hints

1.2.1 Getting Started

The R&S CA250 can be started by:


● Clicking the desktop icon.
● Via "All Programs" in the "Start" menu

Features and Functions 4076.5009.03 ─ 01 5


R&S®CA250 Introduction
Additional Hints

Bitstream files can be opened in R&S CA250 by:


● Dragging and dropping them into the R&S CA250 GUI from a file browser.
● Via the "File" menu in the R&S CA250 main menu.
● By clicking the file icon in the R&S CA250 main menu.

1.2.2 Getting Help

If in doubt...
● Press the F1 key on the keyboard. This offers a context-sensitive help.
● Refer to the R&S CA250 User Manual.

1.2.3 Software Version

Versioning
This document has been prepared based on R&S CA250 Version 04.03.

Features and Functions 4076.5009.03 ─ 01 6


R&S®CA250 General Requirements

2 General Requirements
The requirements which apply to all the examples are:
● The R&S CA250 application should be open.
● The provided bitstream files should be available.
● Ideally, the operator should have an extensive knowledge of transmission systems.
The requirements which apply when using your own files are:
● The bitstream must be long enough to contain a statistically relevant number of
elements. This number can vary strongly. In cases where the "suitable" length can-
not be estimated (e.g. if a particular signal is unknown), an appropriate workflow is
to: (a) record as long as possible, (b) extract shorter bitstreams as "samples", and
then ©) extract longer samples if the short samples prove to be unsuitable.
● The bitstream should have been produced from a signal with a good SNR - i.e. the
lower the SNR, the higher the probability of errors.
The requirements which apply to the operator:
● A basic knowledge of communications engineering, including knowledge of infor-
mation theory and coding would be beneficial.

Features and Functions 4076.5009.03 ─ 01 7


R&S®CA250 Code Analysis - What should I know?

3 Code Analysis - What should I know?


Typically, you have received a bitstream file and are expected to analyze it.
It would help greatly to know some or all of the following:
● Who collected the signal?
● Knowing which organization is interested in the signal
● Where was the signal collected?
● Where did it originate?
● What frequency was it received on?
● What are the technical parameters of the signal?
● When was it recorded?
● Are other recordings of ths nature available?
● Under what circumstances was the recording made?
● Which equipment was used?
● Are there known variants of the signal?
● Is the purpose of the signal known?
● Is it known/suspected what the signal contains?
● Are there any known limitations which apply to decoding the signal?

Conclusion
Any additional information which narrows the scope of the analysis is beneficial to the
analyst.

Features and Functions 4076.5009.03 ─ 01 8


R&S®CA250 The Benefits of Bitstream Analysis

4 The Benefits of Bitstream Analysis


The ultimate goal fo bitstream analysis is to fully decode the content. Unfortunately,
this goal is often un-achievable. However, even when full decoding is not possible, a
great deal of valuable information can be derived from bitstream analysis. For exam-
ple:
● By doing a simple frame structure analysis, different modems with same modula-
tion type can be distinguished which allows us to distinguish between:
– Different users
– Different networks
– Different origins
● By recognition of the different channel coding layers a further differentiation is pos-
sible:
– Characteristics of high data rate transmissions:
- short transmission distances
- large amounts of conveyed data
- more complex payload (e.g. protocol, multi-media, etc)
– Characteristics of low data rate transmissions:
- long transmission distances
- robust (i.e. protected against data loss and data corruption)
- small amounts of conveyed data
- simple payload (e.g. transmission protocol, multi-media, etc)
● Decoding control information (protocol) may provide the following information:
– Who is communicating with whom
– Which logical networks exist
– Which units are part of these networks
– Which network is active
– Which type of data is being transmitted:
- plain text
- binary
- multimedia
- email
- protocol (e.g. IP, TCP, HTTP)
- compression mode
- whether encryption is used
● The complexity of the encoding may give an indication of how important the con-
tent is.
● The type of encoding may give an indication of the purpose of the transmission.
● For regular interceptions of the same transmission type:
– Changes in the amount of information carried may indicate changes in activity,
state-of-readiness or deployment
– Changes in the traffic volume (i.e. the number of transmissions per hour) may
indicate changes in activity, state-of-readiness or deployment.
● After all decoding steps are completed, the following information may be obtained:

Features and Functions 4076.5009.03 ─ 01 9


R&S®CA250 The Benefits of Bitstream Analysis

– The actual conveyed message


– The actual amount of data conveyed - i.e. is idle or real data being sent?
Collecting all such information types is essential to increase the level of knowledge
about the current situation in the target area.

Features and Functions 4076.5009.03 ─ 01 10


R&S®CA250 Teletype using ASCII
Steps for dealing with frame structures

5 Teletype using ASCII


Background: The given bitstream could typically have been derived from a transmis-
sion...
● With FSK2 modulation.
● In the HF band.
● With a low Baud rate (approx.: 100 Bd)
The above characteristics indicate an older codec (probably a teletype device) so there
will probably not be a convolutional coding - i.e. we will be dealing with basic mecha-
nisms .
Objectives: To learn how to deal with frame structures and apply alphabets.
Procedure: Determine the frame structure, remove non-information bits, and then
apply different alphabets.
Focus: The main focus is on the following functionality:
● Autocorrelation
● Deletion of columns
● Determination of parity type and parity bits
● Use of the histogram
● Use of alphabets

5.1 Steps for dealing with frame structures

1. Open the given bitstream file in R&S CA250. As mentioned in Chapter 1.2.1, "Get-
ting Started", on page 5, the file can be opened via drag-and-drop or using the
"File" menu. The contents of the file will be displayed in the "Table View" as shown
in the following figure.

Features and Functions 4076.5009.03 ─ 01 11


R&S®CA250 Teletype using ASCII
Steps for dealing with frame structures

There seams to be a repeating pattern so the next task is to determine the number
of symbols per frame - i.e. the cycle length within the bitstream.

2. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

3. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

4. Select "Autocorrelation". This causes "Autocorrelation" to appear in the "Symbol


operation selection" field. The "Run" button appears below the field.

5. Click the "Run" button. This causes an autocorrelation process to be performed


which correlates the bitstream with itself. The "Autocorrelation" plot appears in its
own tab. The numbers on the x-axis represent the cycle length.

Features and Functions 4076.5009.03 ─ 01 12


R&S®CA250 Teletype using ASCII
Steps for dealing with frame structures

6. Zoom in to the left side of the plot. Drag a rectangle over the left side of the plot
using the mouse. Repeat until peaks are visible in the x-axis range 0 to 60. Here
you can see repeating peaks which indicate a repeating pattern - i.e. multiples of
the actual cycle length.

7. Zoom in to the left side of the plot in the range 0 to 15. Here you can see that
the first peak occurs at "13" - i.e. this is the actual cycle length.

8. Click the "Reset Cursors" button. This causes the measurement cursors to be
set to the current size of the autocorrelation plot.

9. Grab the cursor on the right side and drag it to the peak. The measured value
(shown above the plot) should now be 13.

Features and Functions 4076.5009.03 ─ 01 13


R&S®CA250 Teletype using ASCII
Steps for dealing with frame structures

10. Click the "Set Cycle Length" button. This the causes the cycle length in the
"Table View" to be set to the measured value.

11. Select the "Table View" tab. The regular pattern should now be visible, as shown
in the figure below.

12. Select the "Visualization Toolbox". This causes the controls for the "Table View"
to appear.

13. Select the "Header" checkbox. This causes row and column headers to appear.

14. Select column headers: "0", "10", "11", and "12". These columns do not appear
to be carrying information.
NOTE: Although column "8" also does not appear to carry information, it is within
the data part of the frame and should be assessed separately.

15. Right-click and select "Delete selected items" in the context menu.

Features and Functions 4076.5009.03 ─ 01 14


R&S®CA250 Teletype using ASCII
Steps for applying alphabets

16. Set the "Cycle Length" to 9. You have deleted four columns so the length is now
13 - 4 = 9.
NOTE: This would be an unusual length for the data frame so we have probably
not removed all the non-data symbols. A logical next step is to check for parity bits.

17. Select the Decimal checkbox. This causes the symbols to be displayed in place
of the colored cells.

18. Select the "Row's Sum and Parity" checkbox. This causes the sum of the sym-
bols in each row to be displayed along with the resulting parity (0 = even, 1 = odd).
NOTE: In this case, the symbol in column 8 is being used to achieve even parity.
Therefore, column 8 does not contain information and can be deleted.

19. Select column header "8" and use the context menu to delete it.

20. Set the "Cycle Length" to 8.


NOTE: As ASCII uses an 8-bit code, the symbols might represent ASCII coded
text. The next step is to check for ASCII coding attempt to decode it.

Conclusions
The R&S CA250 offers straight forward functionality for determining the frame cycle
length and removing frame-related symbols. Similarly the tools for dealing with parity
bits enable fast recognition and removal.

5.2 Steps for applying alphabets

1. Select the "Working Toolbox" tab.

2. Click the "..." button. Select "Analysis" to browse the list of analysis tools.

3. Select "Histogram Analysis". This causes "Histogram Analysis" to appear in the


"Symbol operation selection" field. The "Run" button appears below the field.

4. Set the "Analysis length" to 8 and select the "Bit order 'LSB first'." checkbox.

Features and Functions 4076.5009.03 ─ 01 15


R&S®CA250 Teletype using ASCII
Steps for applying alphabets

NOTE: In normal practice you would run the histogram analysis twice - i.e. with and
without the "Bit order" checkbox selected. This is because you have no way of
knowing whether the bit order has been reversed before transmission. The peaks
in the histogram will indicate whether ASCII is being used or not (see next step).

5. Click the "Run" button. The analysis will be performed and the resulting histo-
gram will be displayed in its own "Histogram Analysis" tab.
NOTE: The 3 typical signs for ASCII coding should be visible:
● Maximum peak at 32: the SPACE character
● Cluster of peaks from 97 to 122: lower case letters
● Single peaks at 10 and 13: CR and LF (carriage return and line feed)

6. Go back to the previous "Table View" tab. Select the "Table View" tab prior to
the "Histogram Analysis" tab.

7. Select the "Working Toolbox" tab.

8. Click the "..." button. Select "Decoder" to browse the list of decoders and decod-
ing tools.

9. Select "Extendable Alphabet Decoder". This causes "Extendable Alphabet


Decoder" to appear in the "Symbol operation selection" field. The "Run" button
appears below the field.

10. Set "Alphabets" to ASCII_8bit and leave the "Swap element order" checkbox
unselected
NOTE: In normal practice you might need to run the decoder several times using
different alphabets, both with and without swapping the elements. This is because
you often have no way of knowing which alphabet was used and whether the bit
order was reversed before transmission.
The "Swap element order" checkbox affects the processing of the 5-bit blocks.

Features and Functions 4076.5009.03 ─ 01 16


R&S®CA250 Teletype using ASCII
Steps for applying alphabets

● Unchecked = LSB to MSB (e.g. 00011 = 24).


● Checked = MSB to LSB (e.g. 00011= 3).

11. Click the "Run" button. The decoding will be performed and the resulting text will
be displayed in its own "Extendable Alphabet Decoder" tab.

Conclusions
The "Histogram" offers clear indications for ASCII coding. Decoding through the appli-
cation of various alphabets is simple and easy to perform.
If all steps have been performed correctly, the text in the tab should be human reada-
ble.

Features and Functions 4076.5009.03 ─ 01 17


R&S®CA250 Teletype using Alphabet 3-4
Steps for dealing with frame structures

6 Teletype using Alphabet 3-4


Background: The given bitstream could typically have been derived from a transmis-
sion....
● With FSK2 modulation.
● In the HF band.
● With a low Baud rate (approx.: 100 Bd)
The above characteristics indicate an older codec (probably a teletype device) so there
will probably not be a convolutional coding - i.e. we will be dealing with basic mecha-
nisms .
Objectives: To learn how to deal with frame structures and apply alphabets.
Procedure: Determine the frame structure, remove non-information bits, and then
apply different alphabets.
Focus: The main focus is on the following functionality:
● Autocorrelation
● Deletion of columns
● Use of the Tsalis entropy test
● Use of statistical analysis
● Use of alphabets

6.1 Steps for dealing with frame structures

1. Open the given bitstream file in R&S CA250. AS mentioned in Chapter 1.2.1, "Get-
ting Started", on page 5, the file can be opened via drag-and-drop or using the
"File" menu. The contents of the file will be displayed in the "Table View" as shown
in the following figure.

Features and Functions 4076.5009.03 ─ 01 18


R&S®CA250 Teletype using Alphabet 3-4
Steps for dealing with frame structures

There seams to be a repeating pattern so the next task is to determine the number
of symbols per frame - i.e. the cycle length within the bitstream.

2. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

3. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

4. Select "Autocorrelation". This causes "Autocorrelation" to appear in the "Symbol


operation selection" field. The "Run" button appears below the field.

5. Click the "Run" button. This causes an autocorrelation process to be performed


which correlates the bitstream with itself. The "Autocorrelation" plot appears in its
own tab. The numbers on the x-axis represent the cycle length.

Features and Functions 4076.5009.03 ─ 01 19


R&S®CA250 Teletype using Alphabet 3-4
Steps for dealing with frame structures

6. Zoom in to the left side of the plot. Drag a rectangle over the left side of the plot
using the mouse. Repeat until peaks are visible in the x-axis range 0 to 60. Here
you can see repeating peaks which indicate a repeating pattern - i.e. multiples of
the actual cycle length.

7. Zoom in to the left side of the plot in the range 0 to 100. Here you can see that
the first peak occurs at "10" - i.e. this is the actual cycle length.

8. Click the "Reset Cursors" button. This causes the measurement cursors to be
set to the current size of the autocorrelation plot.

9. Grab the cursor on the right side and drag it to the peak. The measured value
(shown above the plot) should now be 10

Features and Functions 4076.5009.03 ─ 01 20


R&S®CA250 Teletype using Alphabet 3-4
Steps for applying alphabets

10. Click the "Set Cycle Length" button. This the causes the cycle length in the
"Table View" to be set to the measured value.

11. Select the "Table View" tab. The regular pattern should now be visible, as shown
in the figure below.

12. Select the "Visualization Toolbox". This causes the controls for the "Table View"
to appear.

13. Select the "Header" checkbox. This causes row and column headers to appear.

14. Select column headers: "0", "1", and "2". These columns do not appear to be
carrying information.
NOTE: Although column "8" also does not appear to carry information, it is within
the data part of the frame and should be assessed separately.

15. Right-click and select "Delete selected items" in the context menu.

16. Set the "Cycle Length" to 7. You have deleted three columns so the length is
now 10 - 3 = 7.
NOTE: It would appear that we are dealing with a codec which uses 7 bits per
frame. The next step is to find indications that a 7 bit text codec actually was used
and, if so, which alphabets might be appropriate for decoding.

6.2 Steps for applying alphabets

1. Select the "Working Toolbox" tab.

2. Click the "..." button. Select "Analysis" to browse the list of analysis tools.

Features and Functions 4076.5009.03 ─ 01 21


R&S®CA250 Teletype using Alphabet 3-4
Steps for applying alphabets

3. Select "Histogram Analysis". This causes "Histogram Analysis" to appear in the


"Symbol operation selection" field. The "Run" button appears below the field.

4. Set the "Analysis length" to 7 and select the "Bit order 'LSB first'." checkbox.
NOTE: In normal practice you might need to run the decoder several times using
different alphabets, both with and without swapping the elements. This is because
you often have no way of knowing which alphabet was used and whether the bit
order was reversed before transmission.
The "Swap element order" checkbox affects the processing of the 7-bit blocks.
● Unchecked = LSB to MSB (e.g. 0000011 = 96).
● Checked = MSB to LSB (e.g. 0000011= 3).

5. Click the "Run" button. The analysis will be performed and the resulting histo-
gram will be displayed in its own "Histogram Analysis" tab.
NOTE: The 3 typical signs for ASCII coding (as describe in step 5) are not present.
Although ASCII is not indicated, the single large peak could be the "space" charac-
ter and the cluster of discrete peaks could indicate the characters of an alphabet.
An attribute of any text is that the letters do not occur with the same frequency. We
can therefor use an entropy analysis to (a) confirm that text is probably present and
(b) confirm the frame length.

6. Right-click and close the "Histogram " tab using the context menu. This will
return you to the "Table View" tab.

7. Select the "Working Toolbox" tab.

8. Click the "..." button. Select "Analysis" to browse the list of analysis tools.

9. Select the "Tsalis Entropy Test". For any given number of symbols (the block
length), an entropy test indicates when some of the possible symbol combinations
are missing from a symbol stream. Symbol combinations will be missing because:
● Not all possible bit combinations are used to code the letters of an alphabet.
● Not all letters of an alphabet are present in a text.
● Not all letters of an alphabet are present in the same numbers in a text.
All possible block lengths up to the user specified maximum (the "Block Length"
field) are tried and plotted on the x-axis. The notches indicate block lengths at
which such missing sequences occur. The more sequences are missing, the
deeper the notch.

10. Set he "Block Length" field to a reasonable multiple of the suspected frame
length. In this case, a length of 7 is suspected so a "Block Length" setting of 35
would be appropriate

11. Click the "Run" button. The result of the entropy analysis will appear in its own
"Tsalis Entropy Test" tab.

12. Zoom in to the top of the curve. Drag a rectangle parallel to the x-axis from 0 to
35, which includes the deepest notch. The result should be similar to the figure
below.

Features and Functions 4076.5009.03 ─ 01 22


R&S®CA250 Teletype using Alphabet 3-4
Steps for applying alphabets

13. Click the "Reset Cursors" button. This causes the measurement cursors to be
set to the current size of the autocorrelation plot.

14. Grab the cursor on the right side and drag it to the 1st notch Here you can see
that the first notch occurs at a block length of "7" - a strong indication that we are
dealing with a 7-bit codec.
The following table from the R&S CA250 manual describes some 7 bit alphabets.

Features and Functions 4076.5009.03 ─ 01 23


R&S®CA250 Teletype using Alphabet 3-4
Steps for applying alphabets

Figure 6-1: Alphabet lookup table from the manual

Two of the alphabets are known as "three-four" alphabets as each frame consists
of three "1" bits and four "0" bits. We can perform a statistical analysis on the bit-
stream to detect the use of such an alphabet.

15. Select the "Table View" tab so that the bitstream is visible again.

16. Select the "Working Toolbox" tab.

17. Click the "..." button. Select "Analysis" to browse the list of analysis tools.

18. Select "Statistical Analysis". This causes "Statistical Analysis" to appear in the
"Symbol operation selection" field. The "Run" button appears below the field.

19. Set the codeword length fields. Set the "Lower codeword length" field to 1 and
the "Upper codeword length" field to 7.

20. Click the "Run" button. The result of the statistical analysis will appear in its own
"Statistical Analysis" tab. In this case, the result should be similar to the figure
below.

Features and Functions 4076.5009.03 ─ 01 24


R&S®CA250 Teletype using Alphabet 3-4
Steps for applying alphabets

Figure 6-2: Statistical analysis results

The rows show the analysis of the bitstream based on all possible code lengths
between 1 and 7. The term "Weight" refers to how many "1" bits were present - for
example:
● Bitstream: ...000101100111001110000010110000001111101010...
● Length = 1 to 6: in each case segments containing only "1" bits and only "0"
bits exist, therefore "Min Weight" = 0 and "Max Weight" = length.
● Length = 7: in this case, each segment contains three "1" bits and four "0" bits,
therefore "Min Weight" = 3 and "Max Weight" = 3.
The figure above shows a similar result which indicates that we should apply a
three-four alphabet - e.g. the ITA3 shown in the table in Figure 6-1.

21. Select the "Table View" tab so that the bitstream is visible again.

22. Click the "..." button in the "Working Toolbox". Select "Decoder" to browse the
list of decoders and decoding tools.

23. Select "Extendable Alphabet Decoder". This causes "Extendable Alphabet


Decoder" to appear in the "Symbol operation selection" field. The "Run" button
appears below the field.

24. Set "Alphabets" to ITA3 and select the "Swap element order" checkbox.
NOTE: In normal practice you might need to run the decoder several times using
different alphabets, both with and without swapping the elements. This is because
you often have no way of knowing which alphabet was used and whether the bit
order was reversed before transmission.
The "Swap element order" checkbox affects the processing of the 7-bit blocks.
● Unchecked = LSB to MSB (e.g. 0000011 = 96).
● Checked = MSB to LSB (e.g. 0000011= 3).

25. Click the "Run" button. The decoding will be performed and the resulting text will
be displayed in its own "Extendable Alphabet Decoder" tab.

Conclusions
Although the "Histogram" offered no clear indications for ASCII coding, use of the
"Entropy " test and "Statistical analysis" lead us to the correct "Cycle length" and type
of alphabet used. Such information makes it possible to adopt a trial-and-error
approach using a limited number of alphabets.

Features and Functions 4076.5009.03 ─ 01 25


R&S®CA250 Teletype using Alphabet 3-4
Steps for applying alphabets

If all steps have been performed correctly, the text in the tab should be human reada-
ble.

Features and Functions 4076.5009.03 ─ 01 26


R&S®CA250 Alphabets
Steps for editing the sample XML file

7 Alphabets
Background: The assignment of given bit or symbol sequences to human readable
characters is here referred as an "alphabet". Except for a few minor constraints, the
construction rules for these alphabets are quite arbitrary. Therefore, during the long
history of communications engineering, countless alphabets have been invented. Addi-
tionally, the number of languages which have their own character set has also been a
driving force for the invention of alphabets. Hence, the probability that a transmission
of interest is using a non-standard alphabet is quite high. Therefore it is very important,
that a bitstream analysis tool enables the quick development and easy integration of
new alphabets. This example is focused on the creation and integration of new alpha-
bets in R&S CA250. However, the research and development process by which the
alphabet is constructed is out of scope.
In any language, certain syllables occur more often than others. When the language is
written down, this means that certain letters/letter combinations occur more often than
others. The percentage occurrence of these letters/letter combinations can be derived
from a simple statistical analysis.
Studies have shown that for any particular language, a characteristic set of occurrence
values can be produced which are unique to the alphabet used to represent that lan-
guage.
In terms of decoding unknown alphabets, this is a key concept. If an unencrypted sym-
bol stream is available but there is no suitable alphabet, a statistical analysis of the
symbol stream may produce a valid starting point for the development of a custom
alphabet.
Objective: To demonstrate how alphabets can be created and added to the R&S
CA250.
Procedure: Open the sample XML code (provided below) in an XML editor, edit the
essential fields, edit the alphabet, save in the alphabets folder, create a test file, and
test the alphabet.
Focus: The main focus is on the following functionality:
● Editing the sample XML file
● Testing the custom alphabet

7.1 Steps for editing the sample XML file


Copy the following XML sample into an XML editor (you can even use a simple text
editor if you are careful with the syntax) and then follow the steps described below.
<?xml version="1.0" encoding="UTF-8" ?>
<UserDefinedAlphabet uda_version="1.0">

<AlphabetName>TEST_DECODER</AlphabetName>

<SymbolValency>2</SymbolValency>

Features and Functions 4076.5009.03 ─ 01 27


R&S®CA250 Alphabets
Steps for editing the sample XML file

<ErrorHandling error_char="#">correction</ErrorHandling>

<OutputDirection>LeftToRight</OutputDirection>

<FixBlockLength>

<BlockLength>5</BlockLength>

<AlphabetTables data_format="decimal" char_format="plain">

<ShiftCharacters shift_format="usedata" shift_policy="permanent"


shift_display="hide">
<Shift data="2"/>
<Shift data="3"/>
</ShiftCharacters>

<Alphabet>
<CharacterSet data="0" char="a"/>
<CharacterSet data="1" char="b"/>
<CharacterSet data="2" char="^"/>
<CharacterSet data="3" char="^"/>
</Alphabet>

<Alphabet>
<CharacterSet data="0" char="0"/>
<CharacterSet data="1" char="1"/>
<CharacterSet data="2" char="^"/>
<CharacterSet data="3" char="^"/>
</Alphabet>

</AlphabetTables>

</FixBlockLength>

</UserDefinedAlphabet>

Features and Functions 4076.5009.03 ─ 01 28


R&S®CA250 Alphabets
Steps for editing the sample XML file

Some characters have special functions in XML. If you want to use these characters in
text, they must be added using the following codes:
● For < use &lt;
● For > use &gt;
● For & use &amp;
● For " use &quot;
● For ' use &apos;
In general, it is very helpful to replace any special or local character by its decimal or
hexadecimal equivalent. For example, the German "Ä" character can be represented
by &#196;.
Further information on XML coding and its structures can be found on diverse sites in
the internet.

Do not edit the first two lines of the sample!


The first line (<?xml version="1.0" encoding="UTF-8" ?>) is mandatory and
defines the XML version used and the Unicode Transformation Format used.
The second line (<UserDefinedAlphabet uda_version="1.0">) is intended to
future-proof your alphabets. For example, if future versions use tags which are not cur-
rently supported, they can be given a higher version number and the software can
process them accordingly.

Steps to edit the XML sample:


1. Edit the following mandatory tags:
● AlphabetName: Enter the name which should appear in the GUI. For example,
</AlphabetName>CUSTOM_DECODER</AlphabetName>
● SymbolValency: Enter the valency of the symbol stream. For example, if the
decoder is to be used with binary symbol streams
<SymbolValency>2</SymbolValency>
● ErrorHandling: Enter the symbol which should be used to represent unknown/
erroneous symbols (in this case "^") and specify how errors should be handled.
The value of this tag can be:
– correction - the decoder tries to correct the error.
– filler - the decoder only detects an error, but does no correction.
– abort - the decoder stops the decoding process if an error occurs.
For example, <ErrorHandling
error_char="^">correction</ErrorHandling>
● OutputDirection: Enter the direction that text should be output in. For example
<OutputDirection>LeftToRight</OutputDirection>

2. Edit the block length tag (if necessary). The two possibilities are:

Features and Functions 4076.5009.03 ─ 01 29


R&S®CA250 Alphabets
Steps for editing the sample XML file

● <FixBlockLength> - if the characters all have the same number of symbols


(as with this example).
● <DynBlockLength> - if the characters do not all have the same number of
symbols.

3. Enter the block length. For example, if you are defining a 3-4 alphabet, set the
length to seven, using <BlockLength>7</BlockLength>

4. Edit the alphabet table definition. The alphabet table is the container for the
character set data and also defines the data format (use decimal or sequence)
and character format used (always use plain) . Typically, the data format is deci-
mal as this avoids the necessity of entering all the values as binary ones and
zeros(e.g. 1,0,1,0,0,1,1). For example <AlphabetTables
data_format="decimal" char_format="plain">

5. Edit the shift characters (if necessary). If your decoder should shift between
character sets (e.g. as with Baudot) you can configure the handling of shift charac-
ters as follows:
● shift_format - can be set to usedata (shift on a certain data sequence) or
usechar (shift on a certain character).
● shift_policy - can be set to permanent (shift toggles between character
sets) or singular (shift only for the next character).
● shift_display - can be set to show (shift character is displayed) or hide
(shift character is not displayed).
For example, <ShiftCharacters shift_format="usedata"
shift_policy="permanent" shift_display="hide">
Use the shift data tags to specify the shift characters themselves. For example,
<Shift data="27"/>

6. Enter the alphabet definitions (data and character mappings). Typically, for a
shifted alphabet, two sets of alphabet definitions are required. In the sample XML,
the alphabets used are very short. You can add as many character set tags as you
need for your alphabet.
NOTE: data is the decimal value of the symbol and char is the character to be
displayed:
<CharacterSet data="0" char=" "/>
<CharacterSet data="1" char="a"/>
<CharacterSet data="2" char="b"/>
<CharacterSet data="3" char="c"/>
<CharacterSet data="4" char="d"/>
<CharacterSet data="5" char="e"/>
<CharacterSet data="6" char="f"/>
<CharacterSet data="7" char="g"/>

7. Save the edited XML. Go to the following folder and save the edited file with an
appropriate name.
C:\Program Files (x86)\Rohde-Schwarz\CA250\alphabets

Features and Functions 4076.5009.03 ─ 01 30


R&S®CA250 Alphabets
Steps for producing test data for the sample alphabet

8. Start R&S CA250 and check that the alphabet is available. After starting R&S
CA250, select the "Working Toolbox" tab. Click the "..." button and select
"Decoder" > "Extendable Alphabet Decoder". Open the "Alphabets" drop down
menu and check that your alphabet is present in the list.

Conclusions
The process for creating a custom alphabet and making it available in R&S CA250 is
simple and straightforward. It enables the user to quickly and easily create and use a
custom alphabet.

7.2 Steps for producing test data for the sample alphabet
This section describes an approach for producing test data for the sample alphabet
provided at the start of the previous section.

In the sample alphabet:


● The block length is 5 so all entries must be 5-bits long.
● There are only two basic characters: 00000 and 00001.
● These basic characters are used in two alphabet definitions - i.e. a total of four
characters are available via shifting.
● There are two shift codes: 00010 selects the first alphabet and 00011 selects the
second alphabet.
● All other inputs will be handled as errors - e.g. 10101 will generate an error.

Steps to create test data for a custom alphabet


1. Open a simple text editor.

2. Enter 00010 to shift to the first alphabet definition.

3. Enter binary data which correspond to the defined characters. For example:
000000000000000 will produce the output "aaa" and 000010000100001 will
produce "bbb".

4. Enter 00011 to shift to the second alphabet definition.

5. Enter binary data which correspond to the defined characters. For example:
000000000000000 will produce the output "000" and 000010000100001 will
produce "111".

6. Enter 00010 to shift to the first alphabet definition.

7. Enter binary data which correspond to the defined characters. For example:
000000000000000 will produce the output "aaa" and 000010000100001 will
produce "bbb".

Features and Functions 4076.5009.03 ─ 01 31


R&S®CA250 Alphabets
Steps to process the test data using the sample decoder

8. Enter binary data which does not correspond to any of the defined charac-
ters. For example: 101011010110101 will produce the output "###" - i.e. the error
character will be output.

9. Save the file as a .txt file. This ensures that no formatting metadata is saved with
the content.

The following bitstream contains all the steps described above and can be simply cop-
ied and pasted into a text editor.
000100000000000000000000100001000010001100000000000000000001000010000
100010000000000000000000010000100001101011010110101

7.3 Steps to process the test data using the sample


decoder
This section describes the test procedure using the sample alphabet and the test data
created in the previous section.

1. Start the R&S CA250 application.

2. Drag and drop the test data file into the R&S CA250 GUI. Open a file browser
and navigate to the file containing the test data. Use the mouse to drag and drop it
anywhere in the R&S CA250 GUI. This will cause a "Table View" tab to open and
display the data from the file in graphical form.

3. Select the sample alphabet decoder . Go to the "Working Toolbox" in the R&S
CA250 GUI and click the "..." button. Select "Decode" > "Extendable Alphabet
Decoder". Select the decoder in the "Alphabets" drop down list.
Note: If the decoder is not available, navigate to the following folder with a file
browser and save the decoder there:
C:\Program Files (x86)\Rohde-Schwarz\CA250\alphabets

4. Select the "Swap element order" checkbox. This affects the processing of the 5-
bit blocks.
● Unchecked = LSB to MSB (e.g. 00011 = 24).
● Checked = MSB to LSB (e.g. 00011= 3).

5. Select the "Run" button. This will cause the test data to be processed using the
selected alphabet. If the test data described above is used, the output should be:
"aaabbb000111aaabbb"

Conclusion
If the output is as expected, the alphabet is working correctly. In this case, errors are
being corrected and shift characters are not being displayed. If you would like to see
the shit characters and erroneous characters, perform the steps described below.

Features and Functions 4076.5009.03 ─ 01 32


R&S®CA250 Alphabets
Steps to display shift and erroneous characters

7.4 Steps to display shift and erroneous characters

1. Open the sample decoder in an XML editor. A normal text editor can also be
used.

2. Make the following changes:


● In the ErrorHandling tag, change correction to filler.
● In the ShiftCharacters tag, change hide to show.

3. Save the XML file in the alphabets folder. The folder is located at:
C:\Program Files (x86)\Rohde-Schwarz\CA250\alphabets

4. Process the test data using the modified alphabet description. Perform the
steps described in the previous process. This time, the output should be:
"^aaabbb^000111^aaabbb###". Shifts are indicated by the "^" characters and "#"
represents an error.

Conclusion
If the output is as expected, the alphabet is working correctly and you have demonstra-
ted how easy it is to modify the behavior of the decoder.

Features and Functions 4076.5009.03 ─ 01 33


R&S®CA250 Simple Preamble and Channel Code
Steps for dealing with frame structures

8 Simple Preamble and Channel Code


Background: This type of bitstream could be intercepted in the V/UHF band, from a
signal with a bandwidth of roughly 12.5kHz to 25kHz, a baud rate of a few kBd, and
could also be double modulated.
Frame structures are not always simple and autocorrelation can be influenced by other
factors. In this example, the MSB of an ASCII coded text is always "1" which creates
some ambiguities in the autocorrelation.
Objective: The main objective is to learn how to deal with channel coding (FEC). It is
important to (a) appreciate the consequences of having a repeating structure in the
payload which affects our attempts to find the repeating structure of the bitstream, and
(b) to recognize that something is not quite right and take measures against it to find
the true result.
Procedure: Determine the frame structure, remove non-information bits, find the rea-
son for discontinuities in the frame structure, find/remove the FEC, and then find the
right alphabet.
Focus: The main focus is on the following functionality:
● Use of Autocorrelation
● Use of the BCH code check
● Use of the Tsalis entropy test
● Use of the BCH decoder
● Use of alphabets

BCH = Bose-Chaudhuri-Hocquenghem
In coding theory, BCH codes form a class of cyclic error-correcting codes used to
implement forward error correction (FEC).
For the purposes of the R&S CA250:
● BCH coding can be recognized in a bitstream.
● BCH coding can be used to correct errors in the bitstream we are trying to decode.
● BCH coding can be removed from the corrected bitstream.

8.1 Steps for dealing with frame structures

1. Open the given bitstream file in R&S CA250. As mentioned in Chapter 1.2.1, "Get-
ting Started", on page 5, the file can be opened via drag-and-drop or using the
"File" menu. The contents of the file will be displayed in the "Table View" as shown
in the following figure.

Features and Functions 4076.5009.03 ─ 01 34


R&S®CA250 Simple Preamble and Channel Code
Steps for dealing with frame structures

Figure 8-1: Table View

There seams to be a repeating pattern so the next task is to determine the number
of symbols per frame - i.e. the cycle length within the bitstream.

2. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

3. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

4. Select "Autocorrelation". This causes "Autocorrelation" to appear in the "Symbol


operation selection" field. The "Run" button appears below the field.

5. Click the "Run" button. This causes an autocorrelation process to be performed


which correlates the bitstream with itself. The "Autocorrelation" plot appears in its
own tab. The numbers on the x-axis represent the cycle length.

Features and Functions 4076.5009.03 ─ 01 35


R&S®CA250 Simple Preamble and Channel Code
Steps for dealing with frame structures

Figure 8-2: Autocorrelation

6. Zoom in to the highest peak on the left side of the plot. Drag a rectangle over
the left side of the plot using the mouse. Repeat until peaks are visible in the x-axis
range 0 to 1000. Here you can see repeating peaks which indicate a repeating pat-
tern.

7. Zoom in to the highest peak. Here you can see that the first peak occurs at "640"
- i.e. this could be the actual cycle length.

8. Click the "Reset Cursors" button. This causes the measurement cursors to be
set to the current size of the autocorrelation plot.

9. Grab the cursor on the right side and drag it to the peak. The measured value
(shown above the plot) should now be 640.

Features and Functions 4076.5009.03 ─ 01 36


R&S®CA250 Simple Preamble and Channel Code
Steps for dealing with frame structures

Figure 8-3: Autocorrelation peak measurement

10. Click the "Set Cycle Length" button. This causes the cycle length in the "Table
View" to be set to the measured value.

11. Select the "Table View" tab. A regular pattern should now be visible, part of
which is shown in the figure below.

Figure 8-4: Table View with Cycle Length 640

NOTE: You now have clear evidence of a repeating structure but you should
immediately suspect that the cycle length requires further adjustment. The thick
vertical lines look like a preamble but a preamble does not usually repeat within the
payload. The goal is to align the symbols so that only one preamble is visible. You
can reasonably assume that 640 is a multiple of the true cycle length - you need to
determine the multiplier.

12. Count the number of times the preamble pattern are repeated. It may help you
to try any or all of the following:
● Reduce the "Cell Size" setting (this makes the colored blocks smaller).
● Increase the size of the R&S CA250 window (if you are using more than one
display).
● Scroll the "Table View" using the horizontal scroll bar at the bottom of the view.
NOTE: In this case the pattern repeats eight times.

Features and Functions 4076.5009.03 ─ 01 37


R&S®CA250 Simple Preamble and Channel Code
Steps for dealing with frame structures

13. Set the "Cycle Length" to the correct value. In this case 640 / 8 = 80.

Figure 8-5: Table View with Cycle Length 80

NOTE: there are some important differences between the above figure and Fig-
ure 8-4:
● Only a single preamble pattern is now present. This will be removed in the next
step.
● The repeating vertical pattern in the payload is no longer visible. Instead, a
diagonal pattern is apparent.
● Counting the bits in Figure 8-4 reveals an 8-bit repetition in which the MSB is
always "1". This is an indicator for an ASCII alphabet. This clue will be used in
a later step.
● The vertical pattern in Figure 8-4 is followed by an apparently random
sequence of bits. This is an indication that some kind of forward error correc-
tion (FEC) may have been used. This clue will be used in a later step.

14. Select the "Visualization Toolbox". This causes the controls for the "Table View"
to appear.

15. Select the "Header" checkbox. This causes row and column headers to appear.

16. Select column headers: from "0" to "16". These columns represent the pream-
ble and are not carrying information.

17. Right-click and select "Delete selected items" in the context menu.

Features and Functions 4076.5009.03 ─ 01 38


R&S®CA250 Simple Preamble and Channel Code
Steps to perform a BCH code check

Figure 8-6: Table View context menu

18. Set the "Cycle Length" to 63. You have deleted 17 columns so the length is now
80 - 17 = 63.
NOTE: In a previous step there was an indication that several ASCII coded words
may be present in the payload. It was also noted that FEC may have been used.
Several analysis tools exist for checking whether FEC is present. In this case, a
cycle length of 63 is quite characteristic for BCH codes. Hence, the next step is to
perform a BCH code check.

8.2 Steps to perform a BCH code check

1. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

2. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

3. Select "BCH Code Check". This causes "BCH Code Check" to appear in the
"Symbol operation selection" field. The "Run" button appears below the field.

4. Click the "Run" button. This causes BCH Code Check process to be performed
which attempts to derive the parameters and polynomial used in the BCh coding.
The results are displayed in a table (as shown below).

Figure 8-7: Results of the BCH Code Check

Features and Functions 4076.5009.03 ─ 01 39


R&S®CA250 Simple Preamble and Channel Code
Steps to decode the payload using a BCH decoder

NOTE: Clearly, a successful result indicates that BCH was used (in this case, all
parameters with 100% confidence). If unsuccessful, another coding such as Reed
Solomon (RS) could be tried.
The next step is to decode the payload using a BCH decoder and the parameters
from the table.

8.3 Steps to decode the payload using a BCH decoder


This section describes the steps to decode the payload using a BCH decoder and the
parameters from the results table in the previous section.

1. Select the "Table View" tab so that the bitstream is visible again.

2. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Decoder" to browse the list of decoding tools.
NOTE: Two kinds of BCH coding exist: systematic and non-systematic. As Fig-
ure 8-4 appeared to have a definite structure, it makes sense to try the systematic
variant first.

3. Select "BCH and Hamming Decoder Systematic". This causes "BCH and Ham-
ming Decoder Systematic" to appear in the "Symbol operation selection" field. The
"Run" button appears below the field.

4. Setup the decoder using the settings from Figure 8-7.


In this case:
● GF = 6
● Number of info symbols = 51
● Use shortened code = not selected
● Skipped bits = not selected
● Error correction = selected
● Bit order 'LSB first' = not selected

5. Click the "Run" button. This causes a BCH decoding process o be performed
using the given parameters..
When completed, a new "Table View" tab will open which contains the decoded
symbols. The next step is to check the quality of the resulting bitstream.

6. Select the "Visualization Toolbox". This causes the controls for the "Table View"
to appear.

7. Select the "Decimal" radio button and the "Quality" checkbox. The bitstream
is checked for errors and each symbol is color coded: green = ok, red = error, and
yellow =an error which has been corrected.
In this case, all symbols should be green. The next step is to check for ASCII and
decode using a suitable alphabet.

Features and Functions 4076.5009.03 ─ 01 40


R&S®CA250 Simple Preamble and Channel Code
Steps to check for ASCII and decode using a suitable alphabet

8.4 Steps to check for ASCII and decode using a suitable


alphabet

1. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

2. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

3. Select "Histogram Analysis". This causes "Histogram Analysis" to appear in the


"Symbol operation selection" field. The "Run" button appears below the field.

4. Set the "Analysis length" to 8 and select the "Bit order 'LSB first'." checkbox.
NOTE: In normal practice you would run the histogram analysis twice - i.e. with and
without the "Bit order" checkbox selected. This is because you have no way of
knowing whether the bit order has been reversed before transmission. The peaks
in the histogram will indicate whether ASCII is being used or not (see next step).

5. Click the "Run" button. The analysis will be performed and the resulting histo-
gram will be displayed in its own "Histogram Analysis" tab.
NOTE: The 3 typical signs for ASCII coding should be visible:
● Maximum peak at 32: the SPACE character
● Cluster of peaks from 97 to 122: lower case letters
● Single peaks at 10 and 13: CR and LF (carriage return and line feed)

6. Select the previous "Table View" tab so that the bitstream is visible again.

7. Select the "Working Toolbox" tab.

8. Click the "..." button. Select "Decoder" to browse the list of decoders and decod-
ing tools.

Features and Functions 4076.5009.03 ─ 01 41


R&S®CA250 Simple Preamble and Channel Code
Steps to check for ASCII and decode using a suitable alphabet

9. Select "Extendable Alphabet Decoder". This causes "Extendable Alphabet


Decoder" to appear in the "Symbol operation selection" field. The "Run" button
appears below the field.

10. Set "Alphabets" to ASCII_8bit and leave the "Swap element order" checkbox
unselected
NOTE: In normal practice you might need to run the decoder several times using
different alphabets, both with and without swapping the elements. This is because
you often have no way of knowing which alphabet was used and which bit-order
was used by the designer of the transmission system. In this case, you already
have 2 indications for the number of bits:
● Count the bits between the repeating vertical lines in the payload (see Fig-
ure 8-4) - there are 8 bits.
● Perform a Tsalis entropy analysis (as described in step 9). There are notches
at 4 and 8. As we have a clear indication for an 8-bit alphabet (probably ASCII)
we can ignore the notch at 4.

11. Click the "Run" button. The decoding will be performed and the resulting text will
be displayed in its own "Extendable Alphabet Decoder" tab.

Conclusions
Although he "Autocorrelation" did not provide exactly the right cycle length, it did pro-
vide a valid starting point for the analysis - i.e. indications that the payload contained
ASCII text and was channel coded.
Such indications enable relevant analysis and decoding tools to be selected, which in
turn enable the channel coding to be removed (along with the added benefit of error
correction).
Use of the "Entropy " test and "Histogram " analysis lead us to the correct "Cycle
length" and type of alphabet used. Such information makes it possible to adopt a trial-
and-error approach using a limited number of alphabets.
If all steps have been performed correctly, the text in the tab should be human reada-
ble.

Features and Functions 4076.5009.03 ─ 01 42


R&S®CA250 Scrambler and Coding
Steps to determine whether a bitstream is scrambled

9 Scrambler and Coding


Background: This type of bitstream could be intercepted in the V/UHF band, from a
signal with a bandwidth between 12.5 kHz and 25 kHz, a baud rate of a few kBd, and
could also be double modulated.
In previous examples, the starting point was provided either by the simplicity of the bit-
stream or the use of autocorrelation. In many cases, finding the starting point can be
real a challenge. Thereafter, you must ascertain whether further coding techniques
(such as convolutional coding) have been used and if so, remove them. Such a case is
explored here.
Objective: To understand that autocorrelation will not always provide a useful result
and to learn an alternative approach to getting started. To appreciate that de-scram-
bling does not always result in a "clear text" payload and accept that many steps may
be required to arrive at a fully decoded bitstream.
Procedure: Discover the type of scrambling used, descramble the bitstream, deter-
mine the frame structure, remove non-information bits, discover what other coding
techniques have been used, decode the bitstream and then find the right alphabet.
Focus: The main focus is on the following functionality:
● Use of Autocorrelation
● Use of Descrambling
● Use of Demultiplexer
● Use of Code Classifier (for convolutional coding)
● Use of Viterbi decoder
● Use of Alphabets

9.1 Steps to determine whether a bitstream is scrambled

1. Open the given bitstream file in R&S CA250. As mentioned in Chapter 1.2.1, "Get-
ting Started", on page 5, the file can be opened via drag-and-drop or using the
"File" menu. The contents of the file will be displayed in the "Table View" as shown
in the following figure.

Features and Functions 4076.5009.03 ─ 01 43


R&S®CA250 Scrambler and Coding
Steps to determine whether a bitstream is scrambled

Figure 9-1: Table View

There does not seem to be a repeating pattern so there is no obvious starting point
for the analysis. The next step is to use autocorrelation to discover whether there is
in fact any repetition within the bitstream.

2. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

3. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

4. Select "Autocorrelation". This causes "Autocorrelation" to appear in the "Symbol


operation selection" field. The "Run" button appears below the field.

5. Click the "Run" button. This causes an autocorrelation process to be performed


which correlates the bitstream with itself. The "Autocorrelation" plot appears in its
own tab. The numbers on the x-axis represent the cycle length.

Features and Functions 4076.5009.03 ─ 01 44


R&S®CA250 Scrambler and Coding
Steps to determine the type of scrambler and the polynomial

Figure 9-2: Autocorrelation

NOTE: In this case, no peaks are present in the plot.

6. Zoom in to any section of the plot. Drag a rectangle using the mouse. Repeat
until the yellow line of the plot is clearly visible. In this case, the result resembles
the noise found in a spectrum. This indicates that:
● There are no repeating elements in the bitstream.
● The bits have an apparently random distribution (this could be verified using an
entropy check).
NOTE: Both the above points indicate that the bits have been scrambled.
The next step is to determine whether the type of scrambler (and the polynomial
used) can be identified.

9.2 Steps to determine the type of scrambler and the pol-


ynomial

1. Select the previous "Table View" tab so that the bitstream is visible again.

2. Select the "Working Toolbox" tab.

3. Click the "..." button. Select "Analysis" to browse the list of analysis tools.

4. Select "Scrambler Lookup-Table Test". This causes "Scrambler Lookup-Table


Test" to appear in the "Symbol operation selection" field. The "Run" button appears
below the field.
NOTE: The R&S CA250 contains a lookup table of polynomials used by scram-
blers. Customers can also define their own lookup table via the "Open File" button.
For detailed information, see the "Scrambler Lookup-Table Test" chapter in the
R&S CA250 Manual (this is installed with the software).

Features and Functions 4076.5009.03 ─ 01 45


R&S®CA250 Scrambler and Coding
Steps to determine the type of scrambler and the polynomial

5. Click the "Run" button. The lookup will be performed and the polynomial with the
best match to the bitstream will be displayed along with a confidence value for the
result.
A significant result from this test indicates that a self-synchronizing linear binary
shift register was used to scramble the bitstream.
In this case, the following result should be displayed:

NOTE: for this test, any result with a confidence greater than 30% is significant.
The next step is to confirm that a self-synchronizing scrambler was used, as
opposed to an additive scrambler (for more information on scrambling, see the
"Descrambler" chapters in the R&S CA250 Manual).

6. Select the previous "Table View" tab so that the bitstream is visible again.

7. Select the "Working Toolbox" tab.

8. Click the "..." button. Select "Analysis" to browse the list of analysis tools.

9. Select "Berlekamp Massey Test". This causes "Berlekamp Massey Test" to


appear in the "Symbol operation selection" field. The "Run" button appears below
the field.

10. Enter the register settings and run the analysis. The algorithm calculates gen-
erator polynomials (based on the given number of registers) at all possible start
points within the data stream. You can either use the default values (5 and 15) or
make an educated guess based on the result of the Lookup Table result. In this
case, the Lookup Table result indicated a maximum length of 7. You should there-
for use settings around this value - e.g. min = 5 and max = 9.
NOTE: this process may take some minutes (even with a high performance sys-
tem) especially if a high "Max. number of registers" has been specified.
In this case, the result should be similar to the following figure:

Features and Functions 4076.5009.03 ─ 01 46


R&S®CA250 Scrambler and Coding
Steps to determine the type of scrambler and the polynomial

11. Right-click and select "Calculate appearances" in the context menu. This will
cause the "Maximum appearances" window to open. This provides a summary of
how often each polynomial was generated by the algorithm, along with the list of
positions within the bitstream at which the polynomial was produced.
Significant results are:
● One polynomial has a much higher occurrence than the others.
● The polynomial with the highest appearance matches the result provided by the
"Lookup Table" test.
● Other polynomials in the list are x^1 multiples of the polynomial with the highest
occurrence.
In this case the result should be similar to the following figure:

Features and Functions 4076.5009.03 ─ 01 47


R&S®CA250 Scrambler and Coding
Steps to descramble the bitstream using the polynomial

As you can see, the winning polynomial is the same as the "Lookup Table" result
and is also factor 20 higher than the next highest result.
The next step is to use this polynomial to descramble the bitstream.

9.3 Steps to descramble the bitstream using the polyno-


mial

1. In the "Maximum appearances" window, copy the polynomial with the high-
est number of appearances. Double-click the polynomial and use CTRL+C or the
context menu.

2. Close the "Maximum appearances" window.

3. Select the previous "Table View" tab so that the bitstream is visible again.

4. Select the "Working Toolbox" tab.

5. Click the "..." button. Select "Decoder" to browse the list of decoding tools.

6. Select "Descrambler Self-Synchronizing". This causes "Descrambler Self-Syn-


chronizing" to appear in the "Symbol operation selection" field. The "Run" button
appears below the field.

7. Paste the polynomial into the "Feedback coefficients" field. Use CTRL+V or
the context menu.

8. Click the "Run" button. The descrambling will be performed and the descrambled
bitstream will be displayed in its own "Table View" tab.

Features and Functions 4076.5009.03 ─ 01 48


R&S®CA250 Scrambler and Coding
Steps to determine the frame structure

The following figure shows the bitstream before and after descrambling.

NOTE: To perform side-by-side comparison of any tabs (as shown in the figure
above), right-click on one of the tabs and select "Move to new horizontal tab" in the
context menu. The selected tab will be moved to its own window next to the origi-
nal group of tabs. Further tabs can be added to this window (known as a "group")
via drag-and-drop.
The next steps are to determine the frame structure and then decode the bit-
stream.

9.4 Steps to determine the frame structure

1. Select the "Table View" displaying the descrambled bitstream.

2. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

3. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

4. Select "Autocorrelation". This causes "Autocorrelation" to appear in the "Symbol


operation selection" field. The "Run" button appears below the field.

5. Click the "Run" button. This causes an autocorrelation process to be performed


which correlates the bitstream with itself. The "Autocorrelation" plot appears in its
own tab. The numbers on the x-axis represent the cycle length.

Features and Functions 4076.5009.03 ─ 01 49


R&S®CA250 Scrambler and Coding
Steps to determine the frame structure

6. Zoom in to the left side of the plot. Drag a rectangle over the left side of the plot
using the mouse. Repeat until peaks are visible in the x-axis range 0 to 60. Here
you can see repeating peaks which indicate a repeating pattern - i.e. multiples of
the actual cycle length.

7. Zoom in to the left side of the plot in the range 0 to 300. Here you can see that
the first peak occurs at "256" - i.e. this is the actual cycle length.

8. Click the "Reset Cursors" button. This causes the measurement cursors to be
set to the current size of the autocorrelation plot.

9. Grab the cursor on the right side and drag it to the peak. The measured value
(shown above the plot) should now be 256.

NOTE: it may be necessary to zoom in further if you are not using a large display.

10. Click the "Set Cycle Length" button. This the causes the cycle length in the
"Table View" to be set to the measured value.

11. Select the "Table View" tab. The regular pattern should now be visible, as shown
in the figure below.

Features and Functions 4076.5009.03 ─ 01 50


R&S®CA250 Scrambler and Coding
Steps to decode the bitstream

12. Select the "Visualization Toolbox". This causes the controls for the "Table View"
to appear.

13. Select the "Header" checkbox. This causes row and column headers to appear.

14. Select column headers: "0" to "31". These columns do not appear to be carrying
information.

15. Right-click and select "Delete selected items" in the context menu.
NOTE: With large numbers of leading zeros, it may be more convenient to remove
the columns using the "Basic Demultiplexer". In this case you could have set up the
demultiplexer to remove the 32 columns with the following settings: Cycle length =
256, Frame size = 224, Frame offset = 32.

Conclusions
Up to this point we have descrambled the bitstream, determined the frame structure
and removed the leading zeros. Typically the next step would be to determine whether
forward error correction (FEC) has been applied to the bitstream.
As the descrambled bitstream has no apparent pattern (this can be confirmed using
autocorrelation) it would appear that some kind of FEC has been used. This means we
must again find a starting point for further analysis. At this point in an analysis, the
"Code Classifier" may indicate the kind of FEC used.

9.5 Steps to decode the bitstream

1. Select the "Table View" displaying the descrambled bitstream.

2. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

3. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

4. Select "Code Classifier". This causes "Code Classifier" to appear in the "Symbol
operation selection" field. The "Run" button appears below the field.

5. Select a block of10 to 12 consecutive rows in the "Table View". The "Code
Classifier" typically requires 2000 to 3000 bits to derive the used code. With 256
bits per row, this equates to 10 to 12 rows. Simply select the row headers using the
mouse.

Features and Functions 4076.5009.03 ─ 01 51


R&S®CA250 Scrambler and Coding
Steps to decode the bitstream

6. Click the "Run" button. This causes the classification process to be performed
which first detects redundancy in a bitstream and then looks for non-systematic
convolution codes (with or without puncturing) and for block codes (BCH code or
RS code).
The "Code Classifier" results table appears in its own tab, as shown in the figure
below.

Figure 9-3: Code Classifier results table

In this case, the results can be summarized as:


● A ½ convolutional code is used (inputs = 1, outputs = 2)
● Puncturing is not used.
● The first result is the same as the third result and the second result is the same
as the fourth result. We can assume these are repetitions.
● The second polynomial of the first result is the same as the first polynomial of
the second result. The second polynomial of the second result is the same as

Features and Functions 4076.5009.03 ─ 01 52


R&S®CA250 Scrambler and Coding
Steps to decode the bitstream

the first polynomial of the first result multiplied by x^1. The second result is
therefor a shifted version of the first result - i.e. they represent the same code.
● The polynomials in the first result are the actual generator polynomials.

7. Copy the polynomials of the first result. Select them with the mouse and use
CTRL+C or the context menu.
The next step is to use the polynomials to remove the convolutional coding from
the bitstream.

8. Select the previous "Table View" and double click anywhere in the view to
deselect the selected rows.

9. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

10. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Decoder" to browse the list of decoding tools.
For the next step (removing the convolutional code) only one tool is available: the
"Viterbi Decoder".

11. Select "Viterbi Decoder". This causes "Viterbi Decoder" to appear in the "Symbol
operation selection" field. The "Run" button appears below the field.

12. Paste the polynomials from the "Code Classifier" into the "Generator polyno-
mials" field. Delete the current contents of the field and use CTRL+V or the con-
text menu to paste in the copied polynomials.

13. Click the "Run" button. This causes the decoding process to be performed which
results in the decoded bitstream being displayed in its own "Table View" tab - part
of which is shown in the figure below.

Figure 9-4: Bitstream after Viterbi decoding

The repeating 8-bit structure may indicate an ASCII alphabet. The next step is to
confirm this and decode the payload.

14. Perform a "Tsallis Entropy Test". This described in previous chapters and can
be summarized as:
● Select "Tsallis Entropy Test" from the "Analysis" submenu in the "Working
Toolbox".
● Set the "Block length" field to a reasonable multiple of the expected block
length - i.e. 8 is expected so a setting of 40 would be ok.
● Run the analysis and check where the notches in the graphic appear. In this
case notches appear at 4 and 8 so we have another indicator for ASCII coding.

Features and Functions 4076.5009.03 ─ 01 53


R&S®CA250 Scrambler and Coding
Steps to decode the bitstream

15. Perform a "Histogram Analysis". This has been described in previous chapters
and can be summarized as:
● Select "Histogram Analysis" from the "Analysis" submenu in the "Working Tool-
box".
● Set the "Analysis length" field to the expected block length (in this case set it to
8) and run the analysis.
● If the result is inconclusive (as in this case) set the "Bit Order 'LSB first'" check-
box and run the analysis again.
● If the result is conclusive (i.e. the typically ASCII pattern is present), move on to
the next step.
NOTE: In this case, the histogram displays the typical ASCII pattern but it is
reversed (see figure below). This indicates that the bitstream has been inverted
- e.g. the typical peak at 32 caused by the SPACE character occurs at 223 (32
= 00100000 = inverted 11011111 = 223).

Figure 9-5: Typical ASCII pattern vs inverted ASCII pattern.

The next step is to invert the bitstream so to restore the ASCII coding.

16. Select the previous "Table View" and double-click anywhere in the view to
make sure no elements are selected.

17. Select the "Working Toolbox".

18. Click the "..." button and select "Manipulation".

19. Select "Inverter" from the list of manipulation tools. Several settings will
appear but in this case, only the "Invert all" checkbox is relevant.

20. Select the "Invert all" checkbox and click the "Run" button. The process
inverts all the bits in the bitstream and displays the resulting bitstream in its own
"Table View".

The next step is to apply a suitable alphabet.

Features and Functions 4076.5009.03 ─ 01 54


R&S®CA250 Scrambler and Coding
Steps to decode the bitstream

21. Select the "Working Toolbox" tab.

22. Click the "..." button. Select "Decoder" to browse the list of decoders and decod-
ing tools.

23. Select "Extendable Alphabet Decoder". This causes "Extendable Alphabet


Decoder" to appear in the "Symbol operation selection" field. The "Run" button
appears below the field.

24. Set "Alphabets" to ASCII_8bit and leave the "Swap element order" checkbox
unselected
NOTE: In normal practice, you might need to run the decoder several times using
different alphabets, both with and without swapping the elements. This is because
you often have no way of knowing which alphabet was used and whether the bit
order was reversed before transmission.

25. Click the "Run" button. The decoding will be performed and the resulting text will
be displayed in its own "Extendable Alphabet Decoder" tab.
If all steps have been performed correctly, human readable text will be displayed.

Features and Functions 4076.5009.03 ─ 01 55


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with frame structures

10 Complex Payload under Disturbed Condi-


tions
Background: The given symbol stream could typically have been derived from a
transmission with the following characteristics:
● PSK8 modulation
● HF band
● High Baud rate (for HF) - e.g. 2400 Bd
Such characteristics indicate a state-of-the-art HF-modem.
PSK modulation offers various possibilities for carrying digital information. In the sim-
plest form, segments from a bitstream can be directly mapped to symbols (e.g. the
eight 3-bit values of a PSK8 constellation). In a more complex form, the original data
could be channel coded, frames mapped to Walsh codes, and the resulting bitstream
transmitted using only 2 states of a PSK8 signal. Such an example is explored here.
Objective: The main objective is to learn how to deal with the mapping of symbols to
symbols, and symbols to bits. A new approach for removing non-information bits is
also covered, as well as dealing with file formats.
Procedure: Determine the frame structure, remove non-information bits, find/remove
repeated symbols, decode using Walsh decoder, find/remove FEC, save the bitstream
and identify the file format.
Focus: The main focus is on the use of the following functionality:
● Autocorrelation
● Basic Demultiplexer
● Symbol-to-Symbol Mapper
● Histogram Analysis
● Walsh Decoder
● Code Classifier
● Viterbi Decoder

10.1 Steps for dealing with frame structures

1. Open the given bitstream file in R&S CA250. AS mentioned in Chapter 1.2.1, "Get-
ting Started", on page 5, the file can be opened via drag-and-drop or using the
"File" menu. The contents of the file will be displayed in the "Table View" as shown
in the following figure.

Features and Functions 4076.5009.03 ─ 01 56


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with frame structures

Figure 10-1: Symbol stream is opened in R&S CA250

There seams to be a repeating pattern so the next task is to determine the number
of symbols per frame - i.e. the cycle length within the bitstream.
NOTE: In this case the frame length can be estimated from the number of rows
between the blocks of colored symbols (32 cols x 34 rows = 1088). Typically, it will
not be so easy or so obvious. The "Autocorrelation" analysis produces the same
result and also delivers other useful information (as described below).

2. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

3. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

4. Select "Autocorrelation". This causes "Autocorrelation" to appear in the "Symbol


operation selection" field. The "Run" button appears below the field.
NOTE: Large bitstream files can take a long time to process. In such cases, a rep-
resentative sample of the bitstream should be selected before running the autocor-
relation process (see next step).

5. Select the "Visualization Toolbox". This causes the controls for the "Table View"
to appear.

6. Select the "Header" checkbox. This causes row and column headers to appear.

7. Select row headers: from "0" to "102". This provides a sample of: 32 x 100 =
3264 symbols - i.e. 3 complete frames based on the estimate of 1088 symbols per
frame.

Features and Functions 4076.5009.03 ─ 01 57


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with frame structures

NOTE: In many cases, you will have no basis for such an estimate. In such cases,
it is advisable to take a much larger sample - e.g. 20000 symbols. If this does not
produce meaningful results then increase to 100000 symbols.

8. Select the "Working Toolbox" tab and click the "Run" button. This causes an
autocorrelation process to be performed which correlates the bitstream with itself.
The "Autocorrelation" plot appears in its own tab. The numbers on the x-axis repre-
sent the cycle length. Here you can see repeating peaks which indicate a repeating
pattern - i.e. multiples of the actual cycle length.

Figure 10-2: Repeating peaks (equal separation)

9. Zoom in to the left side of the plot. Drag a rectangle over the left side of the plot
using the mouse. Cover the x-axis range from 0 to around 1250.

Figure 10-3: Peaks of interest

NOTE: Here 2 interesting results are apparent:


● A large peak at approximately 1088 (as expected from the quick estimate made
earlier).
● Three closely spaced peaks on the left side of the plot. These represent repeat-
ing structures and will be discussed later.
The next step is to measure the large peak.

Features and Functions 4076.5009.03 ─ 01 58


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with frame structures

10. Zoom in to the large peak. Drag a rectangle over the peak using the mouse.

11. Click the "Reset Cursors" button. This causes the measurement cursors to be
set to the current size of the autocorrelation plot.

12. Grab the cursor on the right side and drag it to the peak. The measured value
(shown above the plot) should now be 1088.

Figure 10-4: Peak measured at 1088

13. Click the "Set Cycle Length" button. This the causes the cycle length in the
"Table View" to be set to the measured value.

14. Select the "Table View" tab. The regular pattern should now be visible, as shown
in the figure below .

Figure 10-5: Table View with cycle length 1088

NOTE: In this case, the cycle length of 1088 symbols consists of 256 preamble
symbols + 832 payload symbols.
The eight colors in the preamble correspond to the 8 positions in the PSK8 constel-
lation diagram (for an explanation of the colors see Chapter 13, "Appendix - Fre-
quently Asked Questions", on page 109).
The next step is to remove the preamble symbols. This can be done with the
"Basic Demultiplexer" tool.

15. Select the "Working Toolbox" tab.

16. Click the "..." button. Select "Manipulation" to browse the list of symbol manipula-
tion tools.

17. Select "Basic Demultiplexer". This causes "Basic Demultiplexer" to appear in the
"Symbol operation selection" field. The "Run" button appears below the field.

18. Configure the following values and click "Run".

Features and Functions 4076.5009.03 ─ 01 59


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with PSK symbols

● Cycle length = 1088


● Frame size = 832
● Frame offset = 256
This tells the demultiplexer that for every block of 1088 symbols, it should ignore
the first 256 symbols and then extract 832 symbols. The result should be similar to
the figure below:

Figure 10-6: Table View after using the Basic Demultiplexer

Conclusions
As with previous examples, Autocorrelation has been successfully utilized to provide a
clear starting point for the analysis. In this example we have also seen that:
● Preambles are not always binary - in this case PSK8 is used.
● Preambles are not always short - in this case a preamble with 256 symbols is used
● PSK constellation symbols can be represented as discrete colors.
● The Basic Demultiplexer offers a better way of removing preamble symbols as
there is no need to manually select a large number of columns. The demultiplexer
is faster and lowers the risk of mistakes.
As the bitstream has no apparent pattern (this can be confirmed using autocorrelation)
it would appear that some kind of FEC has been used. This means we must again find
a starting point for further analysis. At this point in an analysis, the "Code Classifier"
may indicate the kind of FEC used.

10.2 Steps for dealing with PSK symbols

1. Select the "Table View" tab containing the demultiplexed symbol stream.

2. Select the "Visualization Toolbox".

3. Set the "Decimal" checkbox. This causes the symbols to be displayed as num-
bers rather than colors. In this case, the numbers correspond to th PSK constella-
tion point.

Features and Functions 4076.5009.03 ─ 01 60


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with PSK symbols

Figure 10-7: Table View (decimal) showing only symbols 0 and 4

NOTE: In this case, as shown in the above figure, only the values "0" and "4" are
present. This indicates that binary data is being sent and that only two of the eight
constellation points are being used. To further process the symbol stream as
binary data we need to convert al l the "4" symbols to "1" symbols.

4. Select the "Working Toolbox" tab.

5. Click the "..." button. Select "Manipulation" to browse the list of symbol manipula-
tion tools.

6. Select "Symbol to Symbol Mapper". This causes "Symbol to Symbol Mapper" to


appear in the "Symbol operation selection" field. The "Run" button appears below
the field.

7. Perform the following actions and then click "Run".


● Set the "Use mapping..." field to: 0 2 3 4 1 5 6 7
● Do not select either of the "Apply from..." buttons.
● Do not select either of the "...mapping" checkboxes.
This tells the mapping tool that every "0" should be mapped to "0" and every "4"
should be mapped to "1". The result is displayed in its own "Table View" tab and
should be similar to the figure below.

Figure 10-8: Table View (after mapping) showing only symbols 0 and 1

NOTE: As we have effectively changed the valency of the symbol stream, we now
need to change the metadata of the file to indicate this change.

8. Select the "Working Toolbox" tab.

9. Click the "..." button. Select "Manipulation" to browse the list of symbol manipula-
tion tools.

Features and Functions 4076.5009.03 ─ 01 61


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with PSK symbols

10. Select "Change valency". This causes "Change valency" to appear in the "Sym-
bol operation selection" field. The "Run" button appears below the field.

11. Set the "New valency" field to 2 and click "Run". The result is displayed in its
own "Table View" tab and should be similar to the figure below.

Figure 10-9: Table View after valency change

NOTE: The new "Table View" has a default "Cycle length" of "32" - i.e. the actual
"Cycle length" needs to be determined and used.
Regardless of the "Cycle length", it is apparent from the "Table View" that a repeat-
ing structure is present in the data. An "Autocorrelation" plot may therefor provide
an indication of the true "Cycle length".

12. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

13. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

14. Select "Autocorrelation". This causes "Autocorrelation" to appear in the "Symbol


operation selection" field. The "Run" button appears below the field.

15. Click the "Run" button. This causes an autocorrelation process to be performed
which correlates the bitstream with itself. The "Autocorrelation" plot appears in its
own tab. The numbers on the x-axis represent the cycle length.

Features and Functions 4076.5009.03 ─ 01 62


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with PSK symbols

Figure 10-10: Autocorrelation plot

16. Zoom in to the left side of the plot. Drag a rectangle over the left side of the plot
using the mouse. Cover the x-axis range from 0 to around 80.

Figure 10-11: Autocorrelation plot zoomed in

NOTE: Here it is clear that a structure repeats every 16 symbols

17. Click the "Reset Cursors" button. This causes the measurement cursors to be
set to the current size of the autocorrelation plot.

18. Grab the cursor on the right side and drag it to the first peak. The measured
value (shown above the plot) should now be 16.

19. Click the "Set Cycle Length" button. This the causes the cycle length in the
"Table View" to be set to the measured value.

20. Select the "Table View" tab. The regular pattern should now be visible, as shown
in the figure below .

Features and Functions 4076.5009.03 ─ 01 63


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with PSK symbols

Figure 10-12: Table View with cycle length 16

NOTE: It is clear from the "Table View" that each 16-symbol frame occurs 4 times.
The next step is to remove the repetitions.

21. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

22. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

23. Select "Repetition Decoder". This causes "Repetition Decoder" to appear in the
"Symbol operation selection" field. The "Run" button appears below the field.

24. Perform the following actions and then click "Run".


● Element size in symbols = 16
● Number of repetitions = 4
This tells the decoder that there are 4 instances of every block of 16 symbols. The
decoder will remove the 3 unnecessary instances. The result should be similar to
the figure below:

Features and Functions 4076.5009.03 ─ 01 64


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with PSK symbols

Figure 10-13: Table View after repetition removal

NOTE: Looking closely at the "Table View" it appears that discrete sequences are
repeated. For example, the following sequence is repeated several times in the fig-
ure above.

The next step is to use a Histogram analysis to find out how many discrete sequen-
ces there are.

25. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

26. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

27. Select "Histogram Analysis". This causes "Histogram Analysis" to appear in the
"Symbol operation selection" field. The "Run" button appears below the field.

28. Perform the following actions and then click "Run".


● "Analysis Length" = 16
● "Bit order" = deselected

Features and Functions 4076.5009.03 ─ 01 65


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with PSK symbols

Figure 10-14: Histogram showing 16 peaks

NOTE: In this case, the result is a histogram with 16 peaks. This indicates that
only 16 different 16-bit values are present in the bitstream. This is a typical
result for a bitstream containing Walsh codes. The "Walsh Decoder" can be
used to confirm the presence of Walsh codes.

29. Select the "Table View" tab.

30. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

31. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Decoder" to browse the list of analysis tools.

32. Select "Walsh Decoder". This causes "Walsh Decoder" to appear in the "Symbol
operation selection" field. The "Run" button appears below the field.

33. Set the "Walsh length in bits" field to 4 and click "Run". The result is displayed
in its own "Table View" tab and should be similar to the figure below.

Figure 10-15: Table View after Walsh decoding

Features and Functions 4076.5009.03 ─ 01 66


R&S®CA250 Complex Payload under Disturbed Conditions
Steps to decode the bitstream

Conclusions
Up to this point, we have determined the frame structure, removed the preamble, con-
verted the PSK symbols to a binary datastream, removed the copied bits, identified the
presence of Walsh codes and removed this encoding. Typically, the next step would be
to further analyze the payload.

10.3 Steps to decode the bitstream

1. Select the "Table View" displaying the bitstream produced by the Walsh
decoder.

2. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

3. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

4. Select "Code Classifier". This causes "Code Classifier" to appear in the "Symbol
operation selection" field. The "Run" button appears below the field.

5. Select a block of 150 to 200 consecutive rows in the "Table View". The "Code
Classifier" typically requires 2000 to 3000 bits to derive the used code. With 16 bits
per row, this equates to 150 to 200 rows. Simply select the row headers using the
mouse.

6. Click the "Run" button. This causes the classification process to be performed
which first detects redundancy in a bitstream and then looks for non-systematic
convolution codes (with or without puncturing) and for block codes (BCH code or
RS code).
The "Code Classifier" results table appears in its own tab, as shown in the figure
below.

Figure 10-16: Code Classifier results table

In this case, the results can be summarized as:


● A ½ convolutional code is used (inputs = 1, outputs = 2)
● Puncturing is not used.
● The first result is the same as the third result and the second result is the same
as the fourth result. We can assume these are repetitions.
● The second polynomial of the first result is the same as the first polynomial of
the second result. The second polynomial of the second result is the same as
the first polynomial of the first result multiplied by x^1. The second result is
therefor a shifted version of the first result - i.e. they represent the same code.

Features and Functions 4076.5009.03 ─ 01 67


R&S®CA250 Complex Payload under Disturbed Conditions
Steps to decode the bitstream

● The polynomials in the first result are the actual generator polynomials.

7. Copy the polynomials of the first result. Select them with the mouse and use
CTRL+C or the context menu.
The next step is to use the polynomials to remove the convolutional coding from
the bitstream.

8. Select the previous "Table View" and double click anywhere in the view to
deselect the selected rows.

9. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

10. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Decoder" to browse the list of decoding tools.
For the next step (removing the convolutional code) only one tool is available: the

11. Select "Viterbi Decoder". This causes "Viterbi Decoder" to appear in the "Symbol
operation selection" field. The "Run" button appears below the field.

12. Paste the polynomials from the "Code Classifier" into the "Generator polyno-
mials" field. Delete the current contents of the field and use CTRL+V or the con-
text menu to paste in the copied polynomials.

13. Click the "Run" button. This causes the decoding process to be performed which
results in the decoded bitstream being displayed in its own "Table View" tab - part
of which is shown in the figure below.

Features and Functions 4076.5009.03 ─ 01 68


R&S®CA250 Complex Payload under Disturbed Conditions
Steps to decode the bitstream

Figure 10-17: Bitstream after Viterbi decoding

NOTE: After the Viterbi decoding, the "Cycle length" of the "Table View" is too
short to see any structures which might be present in the bitstream. Adjusting the
"Cycle length" to a higher value (e.g. 256) enables you to see the structure illustra-
ted in the above figure.

Conclusions
At this point of the analysis it is highly possible, that we have removed all channel cod-
ing mechanisms and we see the payload data. The structure visible in the above figure
is typical of a data file or graphics file format - i.e. there appears to be a header fol-
lowed by structured data.
The next task is to confirm this and decode the payload.

Features and Functions 4076.5009.03 ─ 01 69


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with file formats

10.4 Steps for dealing with file formats


The most straight forward approach is to perform a "File Detection" analysis which can
recognize common file formats based on characteristics in the header. However, the
results of this analysis may be inconclusive or there may be indicators for more than
one file type.
It is therefor a good practice to:
● Perform supporting analyses such as "Autocorrelation" and "Entropy" tests.
● If ASCII is indicated, perform an ASCII decoding. This may reveal human readable
content in the header.
● Perform "File Detection" and, in case of multiple positives, use the other evidence
to narrow down the possible file types.
As a first step, it is always a good idea to check the quality of the data (as described
below).

Steps for dealing with file formats


1. Check the quality of the bitstream. Select the "Visualization Toolbox". Select the
"Decimal" and "Quality" Checkboxes.
● In general, the more green symbols are visible, the better the quality (red indi-
cates errors - i.e bad quality).
● In this case, the symbols are mostly green but there is a scattering of red sym-
bols.
● Such errors will, for example, result in noise in a graphic file or nonsense char-
acters in a text file.
Note: The Viterbi decoder cannot differentiate between recoverable and unrecov-
erable errors - i.e. bits are either error free (green) or corrected (red). In this case,
due to the large distances between the red symbols (i.e. several times the length of
the convolutional code length) we assume that the errors were recoverable.
Furthermore, as there were no bit errors detected for the repetition- and the Walsh
decoder, you could reasonably expect an error free bitstream at this processing
stage. In fact, the bit errors here were introduced intentionally to demonstrate that
the code classifier is capable of correctly identifying the used channel code even
when bit errors are present. Furthermore, this example shows how to deal with
such bit-errors in the following processing stages.
2. Perform an "Autocorrelation" analysis. In this case, the analysis is inconclusive
but in other cases, a peak at 7 or 8 might be an indicator for ASCII.

3. Perform an "Tsalis Entropy Test" analysis. In this case, notches at 16, 32 and
64 indicate that structured data is present.

4. Perform a "File Detection" analysis. Use the following procedure:


● Click the "..." button. Select "Analysis" to browse the list of analysis tools.
● Select "File Detection". This causes "File Detection" to appear in the "Symbol
operation selection" field. The "Run" button appears below the field.

Features and Functions 4076.5009.03 ─ 01 70


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with file formats

● Click the "Run" button. The analysis will be performed and the results will be
displayed as a table in a "File Detection" tab. In this case, two possible file
types (TIFF_II and JPEG_JFIF) are detected which are indicated by true in the
"Detected" column. Of these, JPEG_JFIF is more likely to be valid as it has a
much higher "Detection rating" percentage value.

5. Select the previous "Table View" tab so that the bitstream is visible again.

6. Save the bitstream as a binary file. Open the "Save File" dialog via the "File"
menu. Enter a filename with a .bin suffix and click the "Save" button.

7. Change the file suffix . Use a file browser to edit the filename and change the suf-
fix. In this case, change it to .jpg (as indicated by the "File Detection" results).

8. Open the file in a photo/graphics application.


In this case, if all operations have been performed correctly, setting the suffix
to .jpg will enable the content to be displayed (as shown in the figure below).

Features and Functions 4076.5009.03 ─ 01 71


R&S®CA250 Complex Payload under Disturbed Conditions
Steps for dealing with file formats

Figure 10-18: Content is a .jpg image

Further information on some common file types:


● JPEG graphic (.jpg)
Many photo/graphics programs will automatically detect the format used in a .bin
file and will open the file without the need for changing the suffix.
● Text (.txt)
A basic text editor will often show the human readable content of a .txt file. Con-
trol characters and formatting will be shown as random nonsense. The presence of
human readable text (a) indicates the file is not encrypted and (b) may indicate the
purpose of the file.
● Comma separated values (.csv)
This format is often used for tabular numerical data. If a text editor displays col-
umns of numbers, change the suffix to .csv and open the file using a spreadsheet
program. Use the Open or Import functions.

Conclusions
A successful decoding of such signals depends heavily on the experience of the opera-
tor.
The operator must be familiar with:
● The handling of symbols rather than of bits.
● The recognition and handling of repetitions (e.g. 4 instances of each symbol in the
"Table View" )
● The recognition and handling of Walsh codes (e.g. 16 peaks in the "Histogram" as
an indicator for Walsh sequences).
● The handling of simple, basic spreading mechanisms.
● The recognition and handling of convolutional codes including the influences of bit
errors.
● The recognition and handling of a complex payload. In this case an image file
transmission.

Features and Functions 4076.5009.03 ─ 01 72


R&S®CA250 Turbo Product Code

11 Turbo Product Code


Background: Turbo coding is a channel coding concept which uses at least two nes-
ted coding types. During the decoding process, feedback about errors is passed from
one decoder to the other. This feedback enables a much more effective error correc-
tion than with previous coding techniques.
The type of bitstream used in this example could have been intercepted from a satellite
transmission with high baudrate and high bandwidth (roughly, 2 to 25 MBd and 2 to 25
MHz). Usually with PSK4 or PSK8 modulation (QAM16 is also possible). The modula-
tion related topic "mapping" is not included in this example.
Typically, known coding schemes such as convolutional, BCH, RS, (etc) are used.
Several classes of Turbo coding exist. This chapter focuses on Turbo Product Codes
(TPC).

As Turbo coding is a special subset of "concatenated" coding, many of the principles


described here can also be used effectively to handle symbol streams produced using
2 (or more) coding steps.

Objective: To understand how to decode turbo-coded text when neither of the 2 codes
is known.
The concatenation of two codes for the turbo coding poses a particular problem for bit-
stream analysis. In order to make use of the turbo principle, both codes must be
known. But at the beginning of the analysis neither of them is known.
As the additional gain of the turbo principle cannot be used, care should be taken to
collect the signal under the best possible reception conditions, using a high quality
receiver with the best possible antenna. This will ensure the lowest possible error rate
which in turn will improve the decoding results.
Procedure: Determine that BCH coding is used and decode the bitstream. Determine
that Turbo coding has been used to encode this bitstream and then use the De-inter-
leaver and BCH Decoder to enable full decoding of the content.
Focus: The main focus is on the use of the following functionality:
● Autocorrelation
● BCH Code Check
● BCH and Hamming Decoder Systematic".
● Quality check
● Histogram Analysis
● Block De-interleaver
● ASCII Decoding

Features and Functions 4076.5009.03 ─ 01 73


R&S®CA250 Turbo Product Code
Steps for dealing with Turbo Codes (part 1: BCH decoding)

11.1 Steps for dealing with Turbo Codes (part 1: BCH


decoding)

1. Open the given bitstream file in R&S CA250. As mentioned in Chapter 1.2.1, "Get-
ting Started", on page 5, the file can be opened via drag-and-drop or using the
"File" menu. The contents of the file will be displayed in the "Table View" as shown
in the following figure.

Figure 11-1: Table View

There appears to be a structure within the bitstream so the next task is to deter-
mine the number of symbols per frame - i.e. the cycle length within the bitstream.

2. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

3. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

4. Select "Autocorrelation". This causes "Autocorrelation" to appear in the "Symbol


operation selection" field. The "Run" button appears below the field.

5. Click the "Run" button. This causes an autocorrelation process to be performed


which correlates the bitstream with itself. The "Autocorrelation" plot appears in its
own tab. The numbers on the x-axis represent the cycle length.

Features and Functions 4076.5009.03 ─ 01 74


R&S®CA250 Turbo Product Code
Steps for dealing with Turbo Codes (part 1: BCH decoding)

Figure 11-2: Autocorrelation

6. Zoom in to the highest peak on the left side of the plot. Drag a rectangle over
the left side of the plot using the mouse. Repeat until peaks are visible in the x-axis
range 0 to 1000. Here you can see repeating peaks which indicate a repeating pat-
tern.

7. Zoom in to the highest peak. Here you can see that the first peak occurs at "556"
- i.e. this could be the actual cycle length.

8. Click the "Reset Cursors" button. This causes the measurement cursors to be
set to the current size of the autocorrelation plot.

9. Grab the cursor on the right side and drag it to the peak. The measured value
(shown above the plot) should now be 556.

Features and Functions 4076.5009.03 ─ 01 75


R&S®CA250 Turbo Product Code
Steps for dealing with Turbo Codes (part 1: BCH decoding)

Figure 11-3: Autocorrelation peak measurement

10. Click the "Set Cycle Length" button. This the causes the cycle length in the
"Table View" to be set to the measured value.

11. Select the "Table View" tab. The Table View now has a cycle length of 556, part
of the view is shown in the figure below.

Figure 11-4: Table View with Cycle Length 556

NOTE: As previously noted, there appears to be a structure in the bitstream. How-


ever, a clear frame structure is not apparent. This indicates that FEC may have
been used. Several analysis tools exist for checking whether FEC is present.

12. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

13. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

Features and Functions 4076.5009.03 ─ 01 76


R&S®CA250 Turbo Product Code
Steps for dealing with Turbo Codes (part 1: BCH decoding)

14. Select "BCH Code Check". This causes "BCH Code Check" to appear in the
"Symbol operation selection" field. The "Run" button appears below the field.

15. Click the "Run" button. This causes the BCH Code Check process to be per-
formed which attempts to derive the parameters and polynomial used in the BCH
coding. The results are displayed in a table (as shown below).

Figure 11-5: Results of the BCH Code Check

NOTES:
● Clearly, a successful result indicates that BCH was used (in this case, all
parameters with 66% confidence). If unsuccessful, another coding such as
Reed Solomon (RS) could be tried.
● In this case, 68% indicates that the correct polynomial has been found but
there are uncorrectable errors in the bitstream.
The next step is to decode the payload using a BCH decoder and the parameters
from the table.

16. Select the "Table View" tab so that the bitstream is visible again.

17. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Decoder" to browse the list of decoding tools.
NOTE: Two kinds of BCH coding exist: systematic and non-systematic. As Fig-
ure 11-4 appeared to have a definite structure, it makes sense to try the systematic
variant first.

18. Select "BCH and Hamming Decoder Systematic". This causes "BCH and Ham-
ming Decoder Systematic" to appear in the "Symbol operation selection" field. The
"Run" button appears below the field.

19. Setup the decoder using the settings from Figure 11-5.
In this case:
● GF = 6
● Number of info symbols = 51
● Use shortened code = not selected
● Skipped bits = not selected
● Error correction = selected
● Bit order 'LSB first' = not selected

20. Click the "Run" button. This causes a BCH decoding process o be performed
using the given parameters..
When completed, a new "Table View" tab will open which contains the decoded
symbols. In this case a structure is clearly present.

Features and Functions 4076.5009.03 ─ 01 77


R&S®CA250 Turbo Product Code
Steps for dealing with Turbo Codes (part 1: BCH decoding)

Figure 11-6: Table View after BCH decoding

The next step is to check the quality of the resulting bitstream.

21. Select the "Visualization Toolbox" and set the cycle length to 51. This pres-
ents the data with the block length used in the BCH decoding.

22. Select the "Decimal" radio button and the "Quality" checkbox. The bitstream
is checked for errors and each symbol is color coded: green = ok, red = error, and
yellow =an error which has been corrected.

Figure 11-7: Table View - quality after BCH decoding

NOTE: This pattern is a typical result after BCH decoding

Features and Functions 4076.5009.03 ─ 01 78


R&S®CA250 Turbo Product Code
Dealing with Turbo coding (part 2: ASCII decoding)

The next step is to check for ASCII and decode using a suitable alphabet.

Conclusions and Next Steps


We have established that BCH coding was used and performed the necessary decod-
ing. The result is a bitstream which clearly has some kind of structure and good quality.
In a typical BCH decoding we would now check for ASCII and (if present) decode the
bitstream using a suitable alphabet. Performing this step with a Turbo-coded bitstream
may provide indications that Turbo coding has been used. It can therefor be (option-
ally) be included in the workflow as described below in part 2.
If Turbo Coding is present, a second encoding will be present. In order to decode it, we
need to derive the necessary parameters. There is no statistical method for doing this
so a brute fore method must be applied.
In the case of Turbo Product Codes (TPC), it can be assumed that the block length
used for the second encoding is the same as for the first. If TPC is suspected (or as a
logical first step for any Turbo coded data) we can de-interleave the bitstream and
apply the BCH decoder again. This is described below in part 3.

11.2 Dealing with Turbo coding (part 2: ASCII decoding)

1. Select the "Working Toolbox" tab and click the "..." button This tab offers a
range of symbol operations.

2. Select "Autocorrelation" and click the "Run" button.This causes an autocorre-


lation process to be performed which correlates the bitstream with itself. The "Auto-
correlation" plot appears in its own tab. The numbers on the x-axis represent the
cycle length.

3. Zoom in to the left side of the plot. Drag a rectangle over the left side of the plot
using the mouse. Repeat until peaks are visible in the x-axis range 0 to 80. Here
you can see that the correlation peaks repeat every 8 symbols. This might indicate
an 8-bit structure such as an ASCII alphabet.

Features and Functions 4076.5009.03 ─ 01 79


R&S®CA250 Turbo Product Code
Dealing with Turbo coding (part 2: ASCII decoding)

Figure 11-8: Autocorrelation peaks spaced 8 symbols apart

This can be verified using a "Histogram" analysis.

4. Select the "Table View" tab so that the bitstream is visible again.

5. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

6. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

7. Select "Histogram Analysis". This causes "Histogram Analysis" to appear in the


"Symbol operation selection" field. The "Run" button appears below the field.

8. Set the "Analysis length" to 8 and select the "Bit order 'LSB first'." checkbox.
NOTE: In normal practice you would run the histogram analysis twice - i.e. with and
without the "Bit order" checkbox selected. This is because you have no way of
knowing whether the bit order has been reversed before transmission. The peaks
in the histogram will indicate whether ASCII is being used or not (see next step).

9. Click the "Run" button. The analysis will be performed and the resulting histo-
gram will be displayed in its own "Histogram Analysis" tab.
NOTE: In this case, two typical signs for ASCII coding are visible:

Features and Functions 4076.5009.03 ─ 01 80


R&S®CA250 Turbo Product Code
Dealing with Turbo coding (part 2: ASCII decoding)

● Maximum peak at 32: the SPACE character


● Cluster of peaks from 97 to 122: lower case letters

10. Select the previous "Table View" tab so that the bitstream is visible again.

11. Select the "Working Toolbox" tab.

12. Click the "..." button. Select "Decoder" to browse the list of decoders and decod-
ing tools.

13. Select "Extendable Alphabet Decoder". This causes "Extendable Alphabet


Decoder" to appear in the "Symbol operation selection" field. The "Run" button
appears below the field.

14. Set "Alphabets" to ASCII_8bit and leave the "Swap element order" checkbox
selected
NOTE: In normal practice you might need to run the decoder several times using
different alphabets, both with and without swapping the elements. This is because
you often have no way of knowing which alphabet was used and which bit-order
was used by the designer of the transmission system.

15. Click the "Run" button. The decoding will be performed and the resulting text will
be displayed in its own "Extendable Alphabet Decoder" tab.

Features and Functions 4076.5009.03 ─ 01 81


R&S®CA250 Turbo Product Code
Dealing with Turbo coding (part 3: de-interleaving & decoding)

Figure 11-9: Partially decoded text

NOTES:
● The text is partially decoded which indicates the used alphabet was correct.
● The text contains discontinuities and blocks of wrongly decoded text which is a
typical indicator for Turbo coding.
● The typical steps for a Turbo coder are:
Info-word ⇨ Encoder 1 ⇨ Interleaver ⇨ Encoder 2 ⇨ Code-word
Clearly, the decoding performed above was only partially successful due to the
use of interleaving and a second encoding.
● The initial bitstream was based on a 63 x 63 block code - i.e. 51 x 51 data bits
+ horizontal and vertical checksums.

The first BCH decoding resulted in a 51 x 63 block code in which the ASCII
characters were arranged horizontally and could therefore be partially decoded.
● Part 3 describes the necessary de-interleaving and second decoding step.

11.3 Dealing with Turbo coding (part 3: de-interleaving &


decoding)

1. Select the previous "Table View" tab so that the bitstream is visible again.

Features and Functions 4076.5009.03 ─ 01 82


R&S®CA250 Turbo Product Code
Dealing with Turbo coding (part 3: de-interleaving & decoding)

2. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

3. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Decoder" to browse the list of decoding tools.

4. Select "Block De-interleaver". This causes "Block De-interleaver" to appear in


the "Symbol operation selection" field. The "Run" button appears below the field.

5. Setup the de-interleaver using the following settings.


● Number of rows = 63
● Number of columns = 51
● Write left to right = selected
● Write top to bottom = selected
● Top items to skip = 0
● Bottom items to skip = 0

6. Click the "Run" button. This causes a de-interleaving process to be performed


using the given parameters. The resulting bitstream will be displayed in its own
"Table View" tab.
NOTES:
● After the first decoding, the vertical checksum bits were no longer aligned with
the correct data bits. The de-interleaving re-aligned the bits.
● The next step is to perform a BCH Check to verify that the result is valid. If the
result is valid the BCH Check will derive the polynomial required for decoding.
● In normal practice it may be necessary to perform the de-interleaving several
times using different settings until the BCH check verifies that a valid bitstream
has been produced.

7. Select the "Table View" tab so that the bitstream is visible again.

8. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

9. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

10. Select "BCH Code Check". This causes "BCH Code Check" to appear in the
"Symbol operation selection" field. The "Run" button appears below the field.

11. Click the "Run" button. This causes the BCH Code Check process to be per-
formed which attempts to derive the parameters and polynomial used in the BCH
coding. The results are displayed in a table (as shown below).

Figure 11-10: Results of the BCH Code Check

NOTES:
● Clearly, a successful result indicates that BCH was used (in this case, all
parameters with 71% confidence). If unsuccessful, another coding such as
Reed Solomon (RS) could be tried.

Features and Functions 4076.5009.03 ─ 01 83


R&S®CA250 Turbo Product Code
Dealing with Turbo coding (part 3: de-interleaving & decoding)

● In this case, 71% indicates that the correct polynomial has been found but
there are uncorrectable errors in the bitstream.
● The checksum bits are now properly aligned with the data kit.
The next step is to decode the payload using a BCH decoder and the parameters
from the table.

12. Select the "Table View" tab so that the bitstream is visible again.

13. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Decoder" to browse the list of decoding tools.
NOTE: As mentioned previously, two kinds of BCH coding exist: systematic and
non-systematic. As the previous BCH decoding produced a valid result using the
systematic variant, it makes sense to use this variant again.

14. Select "BCH and Hamming Decoder Systematic". This causes "BCH and Ham-
ming Decoder Systematic" to appear in the "Symbol operation selection" field. The
"Run" button appears below the field.

15. Setup the decoder using the settings from Figure 11-10.
In this case:
● GF = 6
● Number of info symbols = 51
● Use shortened code = not selected
● Skipped bits = not selected
● Error correction = selected
● Bit order 'LSB first' = not selected

16. Click the "Run" button. This causes a BCH decoding process to be performed
using the given parameters.
When completed, a new "Table View" tab will open which contains the decoded
symbols. In this case a structure is clearly present, although a clear pattern is not
recognizable.

Figure 11-11: Table View after 2nd BCH decoding

NOTES:
● The checksum bit have been removed, leaving a 51 x 51 data block.

Features and Functions 4076.5009.03 ─ 01 84


R&S®CA250 Turbo Product Code
Dealing with Turbo coding (part 3: de-interleaving & decoding)

● The ASCII characters are now aligned vertically within the block.
● The de-interleaver can be used to align the ASCII characters horizontally so
that they can be decoded.

17. Select the previous "Table View" tab so that the bitstream is visible again.

18. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

19. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Decoder" to browse the list of decoding tools.

20. Select "Block De-interleaver". This causes "Block De-interleaver" to appear in


the "Symbol operation selection" field. The "Run" button appears below the field.

21. Setup the de-interleaver using the following settings.


● Number of rows = 51
● Number of columns = 51
● Write left to right = selected
● Write top to bottom = selected
● Top items to skip = 0
● Bottom items to skip = 0

22. Click the "Run" button. This causes a de-interleaving process to be performed
using the given parameters. The resulting bitstream will be displayed in its own
"Table View" tab.

Figure 11-12: Table View after 2nd de-interleaving

NOTES:
● After the first decoding, the vertical checksum bits were no longer aligned with
the correct data bits. The de-interleaving has re-aligned the bits.
● The next step is to perform a "BCH Code Check" to verify that the result is
valid. If the result is valid the "BCH Code Check" will derive the polynomial
required for decoding.

Features and Functions 4076.5009.03 ─ 01 85


R&S®CA250 Turbo Product Code
Dealing with Turbo coding (part 3: de-interleaving & decoding)

● In normal practice it may be necessary to perform the de-interleaving several


times using different settings until the BCH check verifies that a valid bitstream
has been produced.

23. Select the previous "Table View" tab so that the bitstream is visible again.

24. Select the "Working Toolbox" tab.

25. Click the "..." button. Select "Decoder" to browse the list of decoders and decod-
ing tools.

26. Select "Extendable Alphabet Decoder". This causes "Extendable Alphabet


Decoder" to appear in the "Symbol operation selection" field. The "Run" button
appears below the field.

27. Set "Alphabets" to ASCII_8bit and leave the "Swap element order" checkbox
selected
NOTE: In normal practice you might need to run the decoder several times using
different alphabets, both with and without swapping the elements. This is because
you often have no way of knowing which alphabet was used and which bit-order
was used by the designer of the transmission system.

28. Click the "Run" button. The decoding will be performed and the resulting text will
be displayed in its own "Extendable Alphabet Decoder" tab.

Figure 11-13: Fully decoded text

Conclusions
The typical steps for a Turbo coder are: Info-word ⇨ Encoder 1 ⇨ Interleaver ⇨
Encoder 2 ⇨ Code-word.
These steps result in horizontal and vertical checksum bits being added to the original
datablock, and the orientation of these bits must be considered during decoding.
The initial bitstream was based on a 63 x 63 block code - i.e. 51 x 51 data bits + hori-
zontal and vertical checksums.

Features and Functions 4076.5009.03 ─ 01 86


R&S®CA250 Turbo Product Code
Dealing with Turbo coding (part 3: de-interleaving & decoding)

The first BCH decoding resulted in a 51 x 63 block code - i.e. the horizontal checksums
were removed (light grey area of the above figure).
The second BCH decoding resulted in a 51 x 51 block code - i.e. the vertical check-
sums were removed (dark grey area of the above figure).
The first de-interleaving restored the alignment between data bits and vertical check-
sums.
The second de-interleaving restored the horizontal alignment of the ASCII characters.

Features and Functions 4076.5009.03 ─ 01 87


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading

12 Voice Codec with Interleaver Iteration and


Code Spreading
Background: In previous examples, the starting point for the analysis was provided
either by the simplicity of the bitstream or the use of autocorrelation. In many cases,
finding the starting point can be real a challenge. Knowledge about the radio link can
provide the starting point and also guide you with the subsequent analysis steps. Such
a case is explored here.
This type of bitstream could come from a intercepted satellite downlink which uses a
spread-spectrum transmission method such as DSSS (Direct Sequence Spread Spec-
trum) .
Transmission from a satellite means that:
● Multi-path propagation is not present.
● Random transmission errors may occur due to the influence of Gaussian noise.
Use of spreading means that:
● Only signals with a good SNR will have sufficient quality for decoding.
● The first analysis operation will be to determine the polynomial used for despread-
ing the signal.
Objective: There are two main objectives.
● To understand how to apply your knowledge of transmission systems in order to
effectively decode the content of a bitstream.
● To demonstrate how to use a script to find an appropriate de-interleaver.
Procedure:
Confirm that spreading has been used, discover the polynomial required for spreading
analysis, discover the settings for despreading the signal, despread the signal, find the
appropriate de-interleaver using a script, decode the bitstream and then find the right
voice codec
Focus: The main focus is on the use of the following functionality:
● "Scrambler Lookup Table Test"
● "Berlekamp Massey Test"
● "Spreading Analysis"
● "Despreader"
● "Helical Scan De-interleaver"
● "Code Classifier"
● "Reed-Solomon Decoder Non-Systematic"
● "MELP" voice codec

Features and Functions 4076.5009.03 ─ 01 88


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Steps to confirm that the bitstream has been spread

12.1 Steps to confirm that the bitstream has been spread

1. Open the given bitstream file in R&S CA250. As mentioned in Chapter 1.2.1, "Get-
ting Started", on page 5, the file can be opened via drag-and-drop or using the
"File" menu. The contents of the file will be displayed in the "Table View" as shown
in the following figure.

Figure 12-1: Table View

There does not seem to be a repeating pattern so there is no obvious starting point
for the analysis. The next step is to use autocorrelation to discover whether there is
in fact any repetition within the bitstream.

2. Select the "Working Toolbox" tab. This tab offers a range of symbol operations.

3. Click the "..." button. This causes a short list of symbol operation categories to
appear. Select "Analysis" to browse the list of analysis tools.

4. Select "Autocorrelation". This causes "Autocorrelation" to appear in the "Symbol


operation selection" field. The "Run" button appears below the field.

5. Click the "Run" button. This causes an autocorrelation process to be performed


which correlates the bitstream with itself. The "Autocorrelation" plot appears in its
own tab. The numbers on the x-axis represent the cycle length.

Features and Functions 4076.5009.03 ─ 01 89


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Steps to determine the polynomial to be used for a Spreading Analysis

Figure 12-2: Autocorrelation

NOTE: In this case, no peaks are present in the plot.

6. Zoom in to any section of the plot. Drag a rectangle using the mouse. Repeat
until the yellow line of the plot is clearly visible. In this case, the result resembles
the noise found in a spectrum. This indicates that:
● There are no repeating elements in the bitstream.
● The bits have an apparently random distribution (this could be verified using an
entropy check).
NOTE: Both the above points indicate that the original bits have been spread.
The next step is to determine the polynomial to be used for a "Spreading Analysis".

Although scrambling and spreading have different purposes, the techniques used in
each process are the same. This means that we can use the "Scrambler Lookup
Table" and the "Berlekamp-Massey" test to find the correct polynomial for a "Spreading
Analysis".

12.2 Steps to determine the polynomial to be used for a


Spreading Analysis

1. Select the previous "Table View" tab so that the bitstream is visible again.

2. Select the "Working Toolbox" tab.

3. Click the "..." button. Select "Analysis" to browse the list of analysis tools.

4. Select "Scrambler Lookup-Table Test". This causes "Scrambler Lookup-Table


Test" to appear in the "Symbol operation selection" field. The "Run" button appears
below the field.
NOTE: The R&S CA250 contains a lookup table of polynomials used by scram-
blers. Customers can also define their own lookup table via the "Open File" button.

Features and Functions 4076.5009.03 ─ 01 90


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Steps to determine the polynomial to be used for a Spreading Analysis

For detailed information, see the "Scrambler Lookup-Table Test" chapter in the
R&S CA250 Manual (this is installed with the software).

5. Click the "Run" button. The lookup will be performed and the polynomial with the
best match to the bitstream will be displayed along with a confidence value for the
result.
A significant result from this test indicates that a self-synchronizing linear binary
shift register was used to scramble the bitstream.
In this case, the following result should be displayed:

NOTE: for this test, any result with a confidence greater than 30% is significant.
The next step is to confirm the polynomial by performing a second test and com-
paring the results.

6. Select the previous "Table View" tab so that the bitstream is visible again.

7. Select the "Working Toolbox" tab.

8. Click the "..." button. Select "Analysis" to browse the list of analysis tools.

9. Select "Berlekamp Massey Test". This causes "Berlekamp Massey Test" to


appear in the "Symbol operation selection" field. The "Run" button appears below
the field.

10. Enter the register settings and run the analysis. The algorithm calculates gen-
erator polynomials (based on the given number of registers) at all possible start
points within the data stream. You can either use the default values (5 and 15) or
make an educated guess based on the result of the Lookup Table result. In this
case, the Lookup Table result indicated a maximum length of 15. You should there-
for use settings around this value - e.g. min = 13 and max = 17.
NOTE: this process may take some minutes (even with a high performance sys-
tem) especially if a high "Max. number of registers" has been specified.
In this case, the result should be similar to the following figure:

Features and Functions 4076.5009.03 ─ 01 91


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Steps to determine the polynomial to be used for a Spreading Analysis

11. Right-click and select "Calculate appearances" in the context menu. This will
cause the "Maximum appearances" window to open. This provides a summary of
how often each polynomial was generated by the algorithm, along with the list of
positions within the bitstream at which the polynomial was produced.
Significant results are:
● One polynomial has a much higher occurrence than the others.
● The polynomial with the highest appearance matches the result provided by the
"Lookup Table" test.
● Other polynomials in the list are x^1 multiples of the polynomial with the highest
occurrence.
In this case the result should be similar to the following figure:

Features and Functions 4076.5009.03 ─ 01 92


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Steps to discover the settings to be used for despreading

As you can see, the winning polynomial is the same as the "Lookup Table" result
and other polynomials in the list are x^1 multiples of the winner - i.e. the result is
significant and may be used in the next step.
The next step is to use this polynomial in a "Spreading Analysis" to discover the
settings to be used for despreading the bitstream.

12.3 Steps to discover the settings to be used for


despreading

1. In the "Maximum appearances" window, copy the polynomial with the high-
est number of appearances. Double-click the polynomial and use CTRL+C or the
context menu.

2. Close the "Maximum appearances" window.

3. Select the previous "Table View" tab so that the bitstream is visible again.

4. Select the "Working Toolbox" tab.

5. Click the "..." button. Select "Analysis" to browse the list of analysis tools.

6. Select "Spreading Analysis". This causes "Spreading Analysis" to appear in the


"Symbol operation selection" field. The "Run" button appears below the field.

Features and Functions 4076.5009.03 ─ 01 93


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Steps to despread the bitstream and check the quality

7. Paste the polynomial into the "Feedback coefficients" field. Use CTRL+V or
the context menu.

8. Click the "Run" button. The spreading analysis will be performed and the result
will be displayed in its own "Table View" tab (see the figure below).

The next step is to despread the bitstream using these settings.

12.4 Steps to despread the bitstream and check the quality

1. Select the previous "Table View" tab so that the bitstream is visible again.

2. Select the "Working Toolbox" tab.

3. Click the "..." button. Select "Decoder" to browse the list of decoding tools.

4. Select "Despreader". This causes "Despreader" to appear in the "Symbol opera-


tion selection" field. The following elements also appear:
● "Feedback coefficients" field
● "Register initialization" field
● "Apply from view" button (not required for this example)
● "Apply from file" button (not required for this example)
● "Chip rate" field
● "Overlay only" checkbox
● "Run" button

5. Copy the "LFSR Setup" polynomial from the "Spreading Analysis" into the
"Feedback coefficients" field.

6. Copy the "Register Init" sequence from the "Spreading Analysis" into the
"Register Initialization" field.

7. Copy the "Chip Rate" value from the "Spreading Analysis" into the "Chip
rate" field.

8. Select the "Overlay only" checkbox.

Features and Functions 4076.5009.03 ─ 01 94


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Steps to despread the bitstream and check the quality

9. Click the "Run" button. This causes a despreading process to be performed


using the given parameters.
When completed, a new "Table View" tab will open which contains the despread
symbols.

10. Select the "Visualization Toolbox". This causes the controls for the "Table View"
to appear.

11. Set the "Cycle Length" to 24. This corresponds to the chip rate determined by
the "Spreading" analysis.
NOTE: The despreading has removed the 24-chip channelization code, so for each
original bit there are now 24 bits with the same value. As the "Overlay" setting was
selected, the extra bits have not been removed. Using a cycle length of 24, these
are aligned into horizontal blocks as shown in the figure below. The benefits are:
● Random errors (caused by noise) are clearly visible.
● If the bits are not aligned, the spreading analysis has not correctly identified the
chip rate.

Features and Functions 4076.5009.03 ─ 01 95


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Steps to despread the bitstream, remove redundant bits, and correct errors

The next step is to repeat the despreading with the "Overlay" checkbox de-
selected. This will automatically remove the redundant bits and simultaneously cor-
rect the bit errors.

12.5 Steps to despread the bitstream, remove redundant


bits, and correct errors

1. Select the previous "Table View" tab so that the spread bitstream is visible
again.

2. Select the "Working Toolbox" tab.

3. De-select the "Overly only" checkbox.

4. Click the "Run" button. This causes the despreading process to be performed
again using the given parameters. As the "Overly only" checkbox is now de-
selected, redundant bits will be removed and errors will be corrected (as far as pos-
sible).
When completed, a new "Table View" tab will open which contains the despread
symbols (as shown in the figure below).

Features and Functions 4076.5009.03 ─ 01 96


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Steps to check for channel coding

NOTE: You can use the tooltip text of the Table Views to check that the original
bitstream had 24x more bits than the processed bitstream.
Typically, such transmissions use convolutional coding so the next step is to per-
form an analysis to detect the encoding polynomials and determine whether punc-
turing has been used.

12.6 Steps to check for channel coding

1. Select the "Table View" tab containing the processed bitstream .

2. Select the "Working Toolbox" tab.

3. Click the "..." button. Select "Analysis" to browse the list of analysis tools.

4. Select "Code Classifier". This causes "Code Classifier" to appear in the "Symbol
operation selection" field. The "Run" button appears below the field.

Features and Functions 4076.5009.03 ─ 01 97


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Steps to remove convolutional coding using a Viterbi decoder

5. Click the "Run" button. The classification process will be performed and the
result will be displayed in its own "Table View" tab (see the figure below).

As you can see, two results are ambiguous and the others all have the same poly-
nomials and puncturing rate. The puncturing patterns are all just shifted versions of
the first pattern. For these reasons, the first result will be used in the next step.
The next step is to use the polynomial and puncturing pattern to decode the bit-
stream.
Typically, a Viterbi decoder is used to remove the convolutional coding.

12.7 Steps to remove convolutional coding using a Viterbi


decoder

1. Select the "Table View" tab containing the processed bitstream (no overlay).

2. Select the "Working Toolbox" tab.

3. Click the "..." button. Select "Decoder" to browse the list of decoding tools.

4. Select "Viterbi Decoder". This causes "Viterbi Decoder" to appear in the "Symbol
operation selection". The following elements also appear:
● "Generator Polynomials" field
● "Use puncturing" checkbox
● "Puncturing vector" field
● "Run" button

5. Copy the "Generator Polynomials" from the "Code Classifier" result into the
"Generator Polynomials" field.

6. Select the "Use puncturing" checkbox.

7. Copy the "Puncturing pattern" from the "Code Classifier" result into the
"Puncturing vector" field.

8. Click the "Run" button. This causes the Viterbi process to be performed using the
given parameters.

Features and Functions 4076.5009.03 ─ 01 98


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Use of a script to discover de-interleaver settings

When completed, a new "Table View" tab will open which contains the decoded
symbols.
Typically, such a datastream will be interleaved so the next step is to de-interleave
the data. Unfortunately, there are no de-interleaver settings available and there is
no analysis tool available to find them. This means a brute force approach is
required. A script can be used to perform this task.

12.8 Use of a script to discover de-interleaver settings


To de-interleave a bitstream, the operator needs to know the following:
● The type of interleaver - e.g. Block, Cross, Convolutional, Helical Scan, etc.
● The value of each parameter used in the interleaving process.
As there are several approaches to interleaving a bitstream, the R&S CA250 offers
several de-interleavers - each of which has different parameters.
In reality, the script would need to loop through each of these de-interleavers to find
the most appropriate one. In this example, the script only tests for a "Helical Scan De-
interleaver" in order to keep the example short and simple. For a "Helical Scan De-
interleaver", the values of the following parameters must be discovered:
● The number of rows used in the interleaving process.
● The number of columns used in the interleaving process.
● The step size used in the interleaving process.
As mentioned previously, there is no analysis tool available to help you to determine
these factors. This means a brute force approach has to be used - i.e. testing all possi-
ble combinations of parameters to find out which one(s) produce a significant result. In
this case this means using every combination of row, column and step with each type
of de-interleaver.
Doing this manually would take a long time and be prone to human error - i.e. this is an
ideal task for an iterative script.
The R&S CA250 Manual describes the use of Python scripts - including the full com-
mand set. For the purposes of this example we will look at an sample script which iter-
ates all possible values of row, column and step for a given de-interleaver.

Concept
The main challenge when designing a script is how to evaluate the results - i.e. how to
determine which results are significant and which are meaningless. In this example,
the following approach is used:

1. For a given de-interleaver, all possible combinations of row, column and step are
used to de-interleave the bitstream.

2. After each de-interleaving, the de-interleaved data is fed to the "RS Code Check"
tool which analyses the bitstream to see if a Reed-Solomon coding is present.

Features and Functions 4076.5009.03 ─ 01 99


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Use of a script to discover de-interleaver settings

3. The output of the "RS Code Check" contains a confidence value which is then used
an indicator for how good the result from the de-interleaver was - i.e. if Reed-Solo-
mon is coding is present, it will only be detected if the de-interleaver settings were
valid.

4. After all iterations have been performed (i.e. all possible combinations have been
tried), all combinations which produced a low confidence "RS Code Check" result
are discarded.

5. High confidence results are displayed to th operator who can then select a winner.

In this case, it is known that the "Helical Scan De-interleaver" was used - i.e. the script
only iterates the row, column and step values. In reality, you would need to add
another loop to the script in order to perform the iteration process for each possible de-
interleaver.

The Script
Users with some experience of Python or other scripting languages should be able to
understand the provided sample script. This section looks at some key aspects pf the
sample script.
At the beginning of the script, some variables are initialized which contain the ranges to
be used in the de-interleaving.
row_low, row_high = 11, 12
col_low, col_high = 4, 5
step_low, step_high = 1, 2

The challenge here is to choose appropriate values for the ranges.


● Large ranges will result in long processing times but increase the chances of find-
ing valid values.
If time is not an issue, large ranges may be used.
● Short ranges will result in short processing times but decrease the chances of
finding valid values.
If a fast result is required, an attempt should be made to focus the ranges.
In this case (a suspected satellite downlink), voice channels typically use codecs with
the following characteristics:
● Robust
● Low bitrate (e.g. below 16 kbps)
● High intelligibility
These characteristics indicate a family of codecs which make use of Linear Predictive
coding - e.g. CELP, MELP, etc.
Typically, the ranges would be set to cover the block sizes of the interleavers used by
these codecs.
For the purposes of this example, block sizes between 44 and 60 will be tested as they
cover the lowest bitrates (below 2400 bps) and keep the script fast and simple.

Features and Functions 4076.5009.03 ─ 01 100


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Use of a script to discover de-interleaver settings

After the values are assigned to the variables, the testing of all possible combinations
is performed in the following way:
● The iteration is performed using a set of nested For loops.
● The interleaver is configured via the CA250.setParameterValue() command.
● The interleaver is run via the CA250.runAlgorithm('result_id_scan',
data_id, 'Helical Scan Deinterleaver') command.
● The interleaver results are fed to the Reed-Solomon test via the
CA250.setParameterValue() command.
● The Reed-Solomon test is run via the
CA250.runAlgorithm('result_id_rs_check', result_id_scan[0],
'RS Code Check') command.
For row in range(row_low, row_high + 1):
CA250.setParameterValue('Helical Scan Deinterleaver', 'Number of rows', row)
For col in range(col_low, col_high + 1):
CA250.setParameterValue('Helical Scan Deinterleaver', 'Number of columns', col)
For step in range(step_low, step_high + 1):

output = '\nHelical Scan Deinterleaver:\t'


output += '\tNumber of rows: ' + str(row) + '\t'
output += '\tNumber of columns: ' + str(col)+ '\t'
output += '\tStep size: ' + str(step) + '\n'

print output

CA250.setParameterValue('Helical Scan Deinterleaver', 'Step size', step)

retValHelical = CA250.runAlgorithm('result_id_scan', data_id, 'Helical Scan Deinte

CA250.setParameterValue('RS Code Check', 'Test also for shortened codes', 0)


CA250.setParameterValue('RS Code Check', 'Test also for all bit offsets', 0)
retValRS = CA250.runAlgorithm('result_id_rs_check', result_id_scan[0], 'RS Code Ch
CA250.getData('result_rs_check', result_id_rs_check[0])

powerGF = symlab.cut_out(result_rs_check[0], 'Power GF(2^m):', ';2 Codeword Length


lenResult = len(result_rs_check[0])
posConfidence = symlab.find_marker(result_rs_check[0], '6 Confidence:')

If int(powerGF) > 0:
confidence = symlab.parse_int(result_rs_check[0], posConfidence+13)
rs_list.append([confidence, (row, col, step), result_id_scan[0], result_id_rs_
winner_code = result_rs_check
winner_id = result_id_scan

Del result_rs_check
Del result_id_rs_check
Del result_id_scan

Features and Functions 4076.5009.03 ─ 01 101


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Use of a script to discover de-interleaver settings

● The result of the Reed-Solomon test is retrieved via the


CA250.getData('result_rs_check', result_id_rs_check[0]) com-
mand.
● The Galois Factor (the power of 2 used in the polynomial - e.g. GF4 = 2^4) is
extracted from the result.
● If the GF is not zero, the result (including the confidence value) is added to an
array rs_list[]
● The variables are cleared via the Del command.
When the nested For loops are finished, the following actions are performed:
● If no results are generated (i.e. rs_list[] is empty), a message is displayed to
the operator.
● The list is sorted using the rs_list.sort() command.
● Data with low confidence values are deleted using a For loop.
If len(rs_list) == 0:
raise Exception('No RS Code found in the given intervalls')

rs_list.sort()

#delete data generated by codes with low confidence


For I in range(0, len(rs_list) - 1):
CA250.deleteData(rs_list[i][2])
CA250.deleteData(rs_list[i][3])

The next step is to define the parameters required for the Reed Solomon decoder ("RS
Decoder Non-Systematic").
primitive_polynomial = symlab.cut_out(winner_code[0], ';4 Primitive polynomial:', ';5 LSS')
num_info_sym = symlab.cut_out(winner_code[0], 'Number of Infobits (k):', ';4 Primitive polynom
num_info_sym = int(num_info_sym)

lss = symlab.cut_out(winner_code[0], 'LSS first:', ';6 Confidence')

if lss == 'true':
lss_first = 1
else:
lss_first = 0

The decoder is configured using the settings defined above and then run.
Parameters are configured via the CA250.setParameterValue() command.
The decoder is run via the CA250.runAlgorithm() command.
CA250.setParameterValue('RS Decoder Non-Systematic', 'Select GF(2^m)', powerGF)

CA250.setParameterValue('RS Decoder Non-Systematic', 'Select prime polynomial', primitive_poly

CA250.setParameterValue('RS Decoder Non-Systematic', 'Number of info symbols', num_info_sym)

CA250.setParameterValue('RS Decoder Non-Systematic', 'Use shortened code', 0)

Features and Functions 4076.5009.03 ─ 01 102


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Use of a script to discover de-interleaver settings

CA250.setParameterValue('RS Decoder Non-Systematic', 'Error correction', 1)

CA250.setParameterValue('RS Decoder Non-Systematic', 'Bit order \'LSB first\'', 0)

CA250.setParameterValue('RS Decoder Non-Systematic', 'Symbol order \'LSS first\'', lss_first)

CA250.enableGuiOutput(1)
retValRS = CA250.runAlgorithm('result_rs_dec', winner_id[0], 'RS Decoder Non-Systematic')

In the script above, you can see that some parameters have been configured via varia-
bles but others have been set directly with a value (e.g. "Error correction"). Those con-
figured via a variable are the values which are important for this example. The others
are set directly in order to keep this script short and simple. In reality, you would also
need to address these settings via the script.

Finally, the results are displayed to the operator. This is done in two steps. First, the
information is prepared using the Output commands. Then, it is displayed using the
Print Output command.
output = '\n\nThe following setup was found with a confidence of '
output += str(confidence) + '%\n\n'
output += '\nHelical Scan Deinterleaver:\n'
output += '\tNumber of rows: ' + str(rs_list[len(rs_list) - 1][1][0]) + '\n'
output += '\tNumber of columns: ' + str(rs_list[len(rs_list) - 1][1][1])+ '\n'
output += '\tStep size: ' + str(rs_list[len(rs_list) - 1][1][2]) + '\n'

output += '\nRS Decoder: \n'


output += '\tPower: ' + str(powerGF) + '\n'
output += '\tPrime polynomial: ' + primitive_polynomial + '\n'
output += '\tNumber of info symbols: ' + str(num_info_sym) + '\n'
output += '\tSymbol order \'LSS first\': ' + str(lss_first)

print output

Applying the Script


To load and run the script, perform the following steps:

Steps to run the script


1. Select the "Table View" tab containing the bitstream produced by the Viterbi
decoder.

2. Double-click anywhere in the "Table View". This will clear any selections which
may have been made.

3. Select "Scripting" in the main menu. Choose "Evaluate script" in the drop down
menu. This will cause a standard file browser to open.

Features and Functions 4076.5009.03 ─ 01 103


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Use of a script to discover de-interleaver settings

4. Navigate to the script and select it in the browser. Click the "Open" button to
run the script.
NOTE: The script will run immediately! This is a run script operation, not a load
script operation. This will cause the following actions:
● New tabs will open in the R&S CA250 as the script is run and combinations
are tested.
● The "Scripting Console" opens in a new window. Script results are displayed
here.
NOTE: Depending on your system, you may need to select this in the Windows
Task Bar to make it visible - simply click the R&S CA250 icon in the task bar.
● The final results are displayed in the console when all iterations have bee
completed (as shown in the figure below).

Figure 12-3: Example of results shown in the Scripting Console

Features and Functions 4076.5009.03 ─ 01 104


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Steps to de-interleave the bitstream

As you can see in the figure:


– Each combination of "rows", "columns", and step is logged as it is tested.
– The confidence of the final result is displayed - in this case 100%.
– The setup of the winning de-interleaver is displayed - i.e. the combination
which produced the result with he highest confidence.
– The setup which should be used for Reed-Solomon decoding is displayed.

Script Output and next steps


The script provides the following results:
● Interleaver type: Helical Scan
● Number of rows: 12
● Number of columns: 5
● Step: 2
The next step is to perform a de-interleaving using the given settings.

12.9 Steps to de-interleave the bitstream

1. Select the "Table View" tab containing the bitstream produced by the Viterbi
decoder.

2. Double-click anywhere in the TableView. This will clear any selections which
may have been made.

3. Select the "Working Toolbox" tab.

4. Click the "..." button. Select "Decoder" to browse the list of decoding tools.

5. Select "Helical Scan Deinterleaver". This causes "Helical Scan Deinterleaver" to


appear in the "Symbol operation selection". The following elements also appear:
● "Number of rows" field
● "Number of columns" field
● "Step size" field
● "Run" button

6. Set the "Number of rows" to 12.

7. Set the "Number of columns" to 5.

8. Set the "Step size" to 2.

9. Click the "Run" button. This causes the de-interleaving process to be performed
using the given parameters.
When completed, a new "Table View" tab will open which contains the de-inter-
leaved symbols.
Typically, such a datastream will included some form of error correction in order to
deal with the errors which remain in the bitstream after the channel coding has

Features and Functions 4076.5009.03 ─ 01 105


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Steps to detect and remove Reed-Solomon coding

been removed. In this case, such errors typically occur in bursts due to the effects
of spurious noise on the downlink. Reed-Solomon coding is usually used for this
purpose as it can detect and correct such error bursts.
The next step is to use the "Code Classifier" to discover whether Reed-Solomon
has been used and if so, to remove this encoding using the "Reed-Solomon"
decoder. This process will also correct as many remaining errors as possible.

12.10 Steps to detect and remove Reed-Solomon coding

1. The type of coding can be determined using the "Code Classifier". Perform
the classification as described in Chapter 12.6, "Steps to check for channel cod-
ing", on page 97. In this case, the "Code Classifier" result indicates a Reed-Solo-
mon coding, as shown in the figure below.

NOTE: These results should match the results displayed in the Scripting Console
(see Figure 12-3). If they match, proceed to the next step, if not check that you
have selected the correct "Table View" and repeat the previous procedure.

2. Select the "Table View" tab containing the bitstream produced by the de-
interleaver.

3. Select the "Working Toolbox" tab.

4. Click the "..." button. Select "Decoder" to browse the list of decoding tools.

5. Select "RS Decoder Non-Systematic". This causes "RS Decoder Non-System-


atic" to appear in the "Symbol operation selection". The following elements also
appear:
● "Select GF (2^m)" drop down list
● "Select prime polynomial" drop down list
● "Number of info symbols" field
● "Use shortened code" checkbox (not used in this example)
● "Skip symbols from beginning" field (not used in this example)
● "Skip symbols from ending" field (not used in this example)
● "Error correction" checkbox
● "Bit order 'LSB first'" checkbox
● "Symbol order 'LSS first'" checkbox
● "Run" button

Features and Functions 4076.5009.03 ─ 01 106


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Applying a voice codec

6. Set the "Select GF (2^m)" setting to 4.

7. Set the "Select prime polynomial" setting to x^4+x+1.

8. Set the "Number of info symbols" field to 11.

9. Select the "Error correction" checkbox.

10. De-select the "Bit order 'LSB first'" checkbox.

11. Select the "Symbol order 'LSS first'" checkbox.

12. Click the "Run" button. This causes the Reed-Solomon (non-systematic) decod-
ing to be performed using the given parameters.
When completed, a new "Table View" tab will open which contains the decoded bit-
stream.
The final step is to select a suitable voice codec.

12.11 Applying a voice codec


As mentioned at the start of this example, knowledge about the radio link can provide
the clues you need for a successful analysis and decoding. This is also true when you
need to find a suitable voice codec.
Unless you have inside information, finding the right voice codec is a trial-and-error
process. The task is made even more challenging by the various settings which had to
be made in the previous step (e.g. Skip symbols, Error correction, and LSB first) In
reality, each combination of settings would have to be used to produce a separate
datastream and each of these would have to be tried with each candidate voice codec.
In this case, you would be trying codecs commonly (or known to be) used for DSSS
voice channels in satellite downlinks. Many codecs are not suitable for this purpose.
The successful codec in this example was the MELP (Mixed Excitation Linear Predic-
tion) as described in the following procedure.

1. Select the "Table View" tab containing the bitstream produced by the de-
interleaver.

2. Double-click anywhere in the TableView. This will clear any selections which
may have been made.

3. Select the "Working Toolbox" tab.

4. Click the "..." button. Select "Decoder" to browse the list of decoding tools.

5. Select "MELP". This causes "MELP" to appear in the "Symbol operation selection"
field. The "Run" button appears below the field.

6. Click the "Run" button. This causes the datastream to be decoded using the
MELP voice codec.
When completed, a new "MELP" tab will open as shown in the figure below.

Features and Functions 4076.5009.03 ─ 01 107


R&S®CA250 Voice Codec with Interleaver Iteration and Code Spreading
Applying a voice codec

7. Click the "Play File Once" button to listen to the result. Ensure that your head-
phones/loud speakers are connected, the volume control is set to an appropriate
level and the sound card's mute function is not selected.

Conclusions
A successful decoding of such a signal depends on:
● Input (possibly from the persons who intercepted/collected it) regarding the type of
signal and its use (i.e. DSSS voice channel used for satellite communications).
● Knowledge of such signals and the coding methods used to create them.
● Experience with scripting and how to effectively implement an iterative script to dis-
cover the interleaver parameters.
● Knowledge of voice codecs and access to codecs suitable for decoding such bit-
streams.

Features and Functions 4076.5009.03 ─ 01 108


R&S®CA250 Appendix - Frequently Asked Questions
How can I enable access to session tracking while a script is running?

13 Appendix - Frequently Asked Questions

13.1 What do all the colors in the Table View represent?


This depends on what data is displayed and which display mode is being used.
In "Graphical" mode:
● Binary data is displayed in 2 colors. For example, from an FSK2 signal:

● PSK data is displayed in several colors. For example, from an PSK8 signal:

In "Quality" mode:
● Green = ok
● Red = error
● Yellow = an error which has been corrected

13.2 How can I forward results from channel coding analy-


sis to a decoder?
The result from a channel coding analysis cannot be forwarded to a decoder. This has
to be done manually.

13.3 How can I enable access to session tracking while a


script is running?
By default, GUI output is disabled while a script is running. A session tracking tree will
be created, but access to its tracking elements is not possible. This can be overridden
by enabling GUI output via the scripting console as shown in the figure below.

Features and Functions 4076.5009.03 ─ 01 109


R&S®CA250 Appendix - Frequently Asked Questions
Does autocorrelation always provide the frame length?

Figure 13-1: Enable GUI output via the Scripting Console

13.4 How can I recognize what type of alphabet has been


used?
There is no simple answer to this question.
Two approaches covered in this manual are:
● Histogram Analysis
Use of ASCII is indicated by characteristic peaks at: 10, 13, and 32,
These correspond to the LF, CR and SPACE characters.
A group of peaks between 97 and 122 represent the lower case text characters.
NOTE: Be aware that bitstreams are often inverted - e.g. the typical peak at 32
caused by the SPACE character occurs at 223 (32 = 00100000 = inverted
11011111 = 223).
● Statistical Analysis
A Statistical Analysis can reveal the presence of a 3-4 alphabet .
This is an alphabet in which the characters are represented by bit sequences which
always contain three "1" bits and four "0" bits.

13.5 Does autocorrelation always provide the frame


length?
No, the autocorrelation does not always provide the frame length.
There are transmission systems which do not mark the frame borders with regular pat-
terns such as preambles, start/stop bits, and trailing sequences.
In such cases:
● The autocorrelation diagram usually does not show clear peaks.
● The Tsallis entropy test can often provide useful information.

There can be many cyclic structures within the data caused by the conveyed payload
data. So the highest peak may not be the only significant indicator revealed by the
autocorrelation analysis - i.e. lesser peaks may also be worth investigating.

Features and Functions 4076.5009.03 ─ 01 110


R&S®CA250 Appendix - Frequently Asked Questions
How can different views be compared side-by-side?

13.6 How can different views be compared side-by-side?


Views can be compared side-by-side by grouping certain tabs together. Grouping the
tabs enables you to:
● Compare several views side-by-side
● Compare several views above/below each other
● Use a structured approach to your analyses
● Easily manage your views
Initially, all the tabs are in the same group. To create a new group, right-click on any
tab and select one of the following options:
● "Move to new horizontal tab" - A new group will be created next to the original
group. The selected tab ill be moved to the new group.
● "Move to new vertical tab" - A new group will be created below the original
group. The selected tab ill be moved to the new group.

This decision can only be made once! If you choose horizontal then all subsequent
new groups will be added next to the previous one. If you choose vertical then all sub-
sequent new groups will be added below the previous one.

Further tabs can be added to the new group by simply dragging and dropping them
using the mouse.
Further new groups can be added via the right-click context menu. As mention above,
these will bee positioned below/next to the previous group, depending on the position
of the first new group.
Tabs can be dragged and dropped at any time in order to:
● Change the order of the tabs within a group.
● Move tabs from one group to another.

A group must contain at least one tab. A group is erased when its last tab is closed or
moved to another group.

Using these commands, you can create a set of groups and then populate them with
views by simply dragging and dropping the individual tabs. Furthermore, each group
has its own frame which can be resized using the mouse. In this way, user-specific lay-
outs can be created quickly and easily.

Features and Functions 4076.5009.03 ─ 01 111


R&S®CA250 Appendix - Frequently Asked Questions
How many symbols should I select for an analysis?

Figure 13-2: Example of a grouped display

13.7 How many symbols should I select for an analysis?


Depending on which analysis you want to perform, it may be useful to select a different
number of symbols.
The table below contains values which have yielded reliable results.

These values are based on results from operational experience and should not be
interpreted as being proven standards.

Analysis Typical number of sym- Comment


bols

Tsallis Entropy > 100.000 Selecting more symbols improves the


quality of the result.
The algorithm is fast.
With large test lengths, the number of
symbols should be increased.

Maurer Test > 100.000 Selecting more symbols improves the


quality of the result.
The algorithm is fast

Chi-Square Test > 100.000 Selecting more symbols improves the


quality of the result.
NOTE: the algorithm needs time

Features and Functions 4076.5009.03 ─ 01 112


R&S®CA250 Appendix - Frequently Asked Questions
How many symbols should I select for an analysis?

Analysis Typical number of sym- Comment


bols

Analytical Convolution Analysis > 2.000 NOTE: selecting more symbols does not
improve the quality of the result.

Advanced Convolution Code Small: > 4.000


Analysis Medium: > 15.000
Large: > 20.000
X-Large: > 130.000

Robust Convolutional Code > 100.000 Selecting more symbols improves the
Analysis quality of the result.
NOTE: the algorithm needs time

CRC-Check > 10.000 Selecting more symbols improves the


quality of the result.
The algorithm is fast

RS Code Check > 10.000 Selecting more symbols improves the


quality of the result.
The algorithm is fast

BCH Code Check >10.000 Selecting more symbols improves the


quality of the result.
The algorithm is fast

Code Classifier 2.000 - 4.000 NOTE: selecting more symbols does not
improve the quality of the result.

Berlekamp-Massey > 25000 Selecting more symbols improves the


quality of the result.

Scrambler Lookup-Table Test > 25.000 Selecting more symbols improves the
quality of the result.

Spreading Analysis > 50.000 Selecting more symbols improves the


quality of the result.

File Detection All / Area of interest 'Search Algorithm'

Features and Functions 4076.5009.03 ─ 01 113

You might also like