Narrow DVB-T2 bandwidths (t1–t5) — demod support, and ATSC 3.0 tuning flexibility

Want to write your own code to work with a HDHomeRun or work with the HDHomeRun DVR? We are happy to help with concepts, APIs, best practices.
drmpeg
Posts: 30
Joined: Mon Jan 23, 2023 6:34 pm
x 15

Re: Narrow DVB-T2 bandwidths (t1–t5) — demod support, and ATSC 3.0 tuning flexibility

Post by drmpeg »

Justin,

I just watched the BATC 26 presentation. Very nice!

Some notes on LDM. First, the atsc3rate program is really only accurate for the single PLP case (as used in the vv031.grc example). The easiest way to calculate bitrates for the more esoteric modes is to use the l1detail feature of the HDHomeRun. However, this feature is only available on the developer version.

Here's the example for LDM:

Code: Select all

re@w6rz:~/xfer$ hdhomerun_config 10ABCB1C-0 get /tuner0/l1detail
ACGAAAAAAEgAGfAQgazT////////AAAAABFAaCBAAAABUsHgQVKgjYYWgaAAAAKlg8CUIMwDIgIbCjCoeA==
It returns a base64 string. Then you feed that string into the dump program.

https://github.com/drmpeg/dtv-utils/blo ... r/l1dump.c
https://github.com/drmpeg/dtv-utils/blo ... r/l1dump.h

And it prints all of the L1 parameters and calculates the bitrate. Here's the vv320.grc example.

Code: Select all

ubuntu@p550:~/xfer$ ./l1dump vv320.txt
L1B_version = 0
L1B_mimo_scattered_pilot_encoding = Walsh-Hadamard pilots or no MIMO subframes
L1B_lls_flag = No LLS in current frame
L1B_time_info_flag = Time information is not included in the current frame
L1B_return_channel_flag = 0
L1B_papr_reduction = No PAPR reduction used
L1B_frame_length_mode = symbol-aligned
L1B_time_offset = 3072
L1B_additional samples = 0
L1B_num_subframes = 1
L1B_preamble_num_symbols = 1
L1B_L1_Detail_content_tag = 0
L1B_L1_Detail_size_bytes = 36
L1B_L1_Detail_fec_type = Mode 1
L1B_L1_additional_parity_mode = K=0 (No additional parity used)
L1B_L1_Detail_total_cells = 3320
L1B_first_sub_mimo = No MIMO
L1B_first_sub_miso = No MISO
L1B_first_sub_fft_size = 16K
L1B_first_sub_reduced_carriers = 5.832 MHz
L1B_first_sub_guard_interval = GI4_768
L1B_first_sub_num_ofdm_symbols = 108
L1B_first_sub_scattered_pilot_pattern = SP8_2
L1B_first_sub_scattered_pilot_boost = 1.841
L1B_first_sub_sbs_first = present
L1B_first_sub_sbs_last = present
L1B_crc = 0x00000000
L1D_version = 1
L1D_num_rf = No Channel Bonding
******** subframe = 0 ********
L1D_frequency_interleaver = All Symbols
L1D_sbs_null_cells = 2061
L1D_num_plp = 2
********** plp = 0 **********
L1D_plp0_id = 0
L1D_plp0_lls_flag = 1
L1D_plp0_layer = Core
L1D_plp0_start = 0
L1D_plp0_size = 1387550
L1D_plp0_scrambler_type = PRBS
L1D_plp0_fec_type = BCH + 64K LDPC
L1D_plp0_mod = QPSK
L1D_plp0_cod = 7/15
L1D_plp0_TI_mode = Convolutional time interleaving
L1D_plp0_CTI_fec_block_start = 688694
L1D_plp0_type = non-dispersed
L1D_plp0_TI_extended_interleaving = disabled
L1D_plp0_CTI_depth = 1024
L1D_plp0_CTI_start_row = 90
frame time = 272.481481 ms
Available PLP cells = 1387550
TS bitrate = 4720096.688
PLP bitrate = 4722611.391
********** plp = 1 **********
L1D_plp1_id = 1
L1D_plp1_lls_flag = 1
L1D_plp1_layer = Enhanced
L1D_plp1_start = 0
L1D_plp1_size = 1387550
L1D_plp1_scrambler_type = PRBS
L1D_plp1_fec_type = BCH + 64K LDPC
L1D_plp1_mod = 64QAM
L1D_plp1_cod = 10/15
L1D_plp1_TI_mode = Convolutional time interleaving
L1D_plp1_CTI_fec_block_start = 104454
L1D_plp1_ldm_injection_level = 4.0 dB
frame time = 272.481481 ms
Available PLP cells = 1387550
TS bitrate = 20271017.262
PLP bitrate = 20278561.370
L1D_bsid = 0x8086
L1D_crc = 0x0a30a878
Second, with LDM you have to enable both PLPs to decode anything. The command is (replace the serial number and channel number with your own):

hdhomerun_config 10ABCB1C-0 set /tuner0/channel atsc3:65:0+1

drmpeg
Posts: 30
Joined: Mon Jan 23, 2023 6:34 pm
x 15

Re: Narrow DVB-T2 bandwidths (t1–t5) — demod support, and ATSC 3.0 tuning flexibility

Post by drmpeg »

I forgot to mention that there's no free lunch with LDM. Shannon still rules. The SNR of each layer is degraded by the power split. For the vv320.grc example:

Code: Select all

re@beavis:~/xfer$ ./ldmsnr 0.3 12.88 4
core snr = 4.170673
enhancement snr = 18.335405
So the QPSK SNR is degraded by about 4 dB and the 64QAM SNR is degraded by about 6 dB.

The AWGN SNR figures are from A327 table 4.3.

https://www.atsc.org/wp-content/uploads ... yer-RP.pdf

Here's the code for the program.

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <math.h>


int main(int argc, char **argv)
{
    double    snr;
    double    snr_core;
    double    snr_enh;
    double    injection_level;

    if (argc != 4) {
        fprintf(stderr, "usage: ldmsnr <snr core> <snr enhanced> <injection level>\n");
        exit(-1);
    }

    snr_core = atof(argv[1]);
    snr_enh = atof(argv[2]);
    injection_level = atof(argv[3]);

    snr = snr_core + (10 * log10(1 + pow(10, -injection_level / 10.0))) - (10 * log10(1 - pow(10, (snr_core - injection_level) / 10.0)));
    printf("core snr = %f\n", snr);
    snr = snr_enh + (10 * log10(1 + pow(10, injection_level / 10.0)));
    printf("enhancement snr = %f\n", snr);
    return 0;
}
The equations are from A327 section 4.2.8.1. The vv320.grc constellation looks like this.

Image

Post Reply