Others

How to Generate HARQ Retransmission Data with a Repeating RV Sequence

Muhammad TalhaMuhammad Talha Nov 10, 2026 869 views

Question details

The user needs to generate a dataset for HARQ retransmissions covering IDs 0 to 15, following a repeating RV sequence of 0, 2, 3, 1, and a looping System Frame Number (SFN) that resets after 1023.

Generate HARQ Retransmission Data with a Repeating RV Sequence
Product
Python and WPS Spreadsheet
Device & OS
not provided
Scenario
Simulating or generating LTE/5G telecommunications data logs for HARQ retransmission analysis.
Observed behavior
A mathematical or scripted approach is required to correctly loop the SFN up to 1023 and align the specific RV sequence to the corresponding system frames.
Before you start

Ensure you have a Python environment ready to execute the data generation script, or simply open WPS Spreadsheet to generate the sequences using built-in math formulas.

Solution 1Recommended

Use Python Modular Arithmetic to Generate and Export Data

Use Python's modulo operator to handle the looping sequences of the System Frame Number and RV values, generating a structured dataset.

Using Python's modulo operator (%) allows you to easily reset the System Frame Number (SFN) back to 0 after reaching 1023. The same logic perfectly handles looping through the specific RV sequence [0, 2, 3, 1] based on the current frame.

1
Set up the sequence variables

In your Python script, define the HARQ IDs using 'harq_ids = list(range(16))' and the sequence using 'rv_sequence = [0, 2, 3, 1]'. Set your maximum system frame number with 'max_sfn = 1023'.

2
Create the generation loop

Iterate through your desired number of frames (e.g., 'for sfn in range(2048):') and calculate the current cyclic SFN using 'current_sfn = sfn % (max_sfn + 1)'.

3
Assign RV values and format records

Inside the frame loop, loop through each HARQ ID. Use 'rv_index = sfn % len(rv_sequence)' to select the correct RV value, and append the SFN, HARQ_ID, and RV dictionary to your output list.

4
Export to CSV for Spreadsheet Analysis

Import Python's 'csv' module to write your output list to a CSV file. This allows you to open the generated telecommunications log easily in WPS Spreadsheet.

Use Python Modular Arithmetic to Generate and Export Data
Export Recommendation: Exporting the list of dictionaries to a CSV file ensures seamless compatibility when opening the logs in WPS Spreadsheet for filtering and pivot table analysis.
WPS Spreadsheet Formula Solution

Generate HARQ Sequences Natively using WPS Spreadsheet Formulas

Instead of writing and running a Python script, you can generate the exact same HARQ, SFN, and RV sequence dataset directly within WPS Spreadsheet using mathematical formulas and the fill handle.

  1. 1. Create Dataset Headers: Open a new blank workbook in WPS Spreadsheet and enter your headers in cells A1, B1, and C1 as 'SFN', 'HARQ_ID', and 'RV' respectively.
  2. 2. Input the SFN Formula: In cell A2, type the formula '=MOD(INT((ROW()-2)/16), 1024)' and press Enter. This will increment the system frame number by 1 every 16 rows, resetting after 1023.
  3. 3. Input the HARQ_ID Formula: In cell B2, type the formula '=MOD(ROW()-2, 16)' and press Enter. This ensures the HARQ IDs loop continuously from 0 to 15 for each frame.
  4. 4. Input the RV Formula: In cell C2, type '=CHOOSE(MOD(INT((ROW()-2)/16), 4)+1, 0, 2, 3, 1)' and press Enter. This formula perfectly maps the 0, 2, 3, 1 cycle to the current frame number.
  5. 5. Drag to Fill the Dataset: Highlight cells A2 through C2. Click and hold the small square at the bottom right corner of the selection (the fill handle), and drag it down to generate as many thousands of records as you need.
Free and lightweight spreadsheet tool for data analysisGenerate cyclic data easily using MOD and CHOOSE formulasSeamlessly filter, sort, and chart HARQ IDs nativelyFully compatible with Microsoft Excel formats (.xlsx and .csv)
microsoft office alternative - wps office

Frequently Asked Questions

Why does the Python RV sequence use modulo instead of a simple loop?

Using a modulo operation (e.g., sfn % len(rv_sequence)) ensures the RV index mathematically maps to the current frame number. This maintains the 0, 2, 3, 1 repeating cycle infinitely across millions of records without requiring manual loop resets.

Can I export the Python generated HARQ data to a spreadsheet?

Yes. By utilizing Python's built-in 'csv' module or the 'pandas' library, you can export the output list to a .csv file. This file can then be opened directly in WPS Spreadsheet for formatting, filtering, and pivot analysis.

How do I analyze specific HARQ IDs in WPS Spreadsheet?

Once your data is generated or imported into WPS Spreadsheet, select the header row, navigate to the 'Data' tab, and click 'AutoFilter'. You can then click the filter drop-down on the HARQ_ID column to isolate specific IDs and view their RV patterns.

What is the maximum number of rows WPS Spreadsheet can handle for this data?

WPS Spreadsheet supports up to 1,048,576 rows per worksheet. Since each System Frame Number contains 16 HARQ IDs, a single sheet can easily generate and store over 65,000 consecutive system frames.