global_constant_c0 = 299792458; /* speed of light in m per s */ aktiv = window.setInterval("start()", 300); function start() { window.clearInterval(aktiv); calculate(); } function roundto(val, c) { if (c<=0) return Math.round(val); var d = Math.pow(10,c); var v = "" + (Math.round(val * d)); var l = v.length; while (l <= c) { v = "0" + v; ++l; } return "" + v.substr(0, l-c) + "." + v.substr(l - c); } function log10(x) { return Math.log(x)/Math.log(10); } function update_form(system, modulation) { var color_disabled = "#b0b0b0"; var color_enabled = "black"; /* disable pilotpatterns */ for(var i = 0; i < document.dvbform.r_pp.length; ++i) { document.dvbform.r_pp[i].disabled = true; document.dvbform.r_pp[i].nextSibling.style.color = color_disabled; } document.dvbform.r_papr.disabled = true; document.dvbform.r_papr.nextSibling.style.color = color_disabled; /* disable bw's */ for(var i = 0; i < document.dvbform.r_b.length; ++i) { document.dvbform.r_b[i].disabled = true; document.dvbform.r_b[i].nextSibling.style.color = color_disabled; } /* disable guards */ for(var i = 0; i < document.dvbform.r_g.length; ++i) { document.dvbform.r_g[i].disabled = true; document.dvbform.r_g[i].nextSibling.style.color = color_disabled; } /* disable mode */ for(var i = 0; i < document.dvbform.r_c.length; ++i) { document.dvbform.r_c[i].disabled = true; document.dvbform.r_c[i].nextSibling.style.color = color_disabled; } /* disable modulations */ for(var i = 0; i < document.dvbform.r_m.length; ++i) { document.dvbform.r_m[i].disabled = true; document.dvbform.r_m[i].nextSibling.style.color = color_disabled; } document.getElementById("stream1").firstChild.data = String.fromCharCode(160); document.getElementById("stream2").firstChild.data = String.fromCharCode(160); /* disable hp coderates */ for(var i = 0; i < document.dvbform.radio_coderate_hp.length; ++i) { document.dvbform.radio_coderate_hp[i].disabled = true; document.dvbform.radio_coderate_hp[i].nextSibling.style.color = color_disabled; } document.dvbform.r_mpe.disabled = true; document.dvbform.r_mpe.style.color = color_disabled; /* disable lp coderates */ for(var i = 0; i < document.dvbform.radio_coderate_lp.length; ++i) { document.dvbform.radio_coderate_lp[i].disabled = true; document.dvbform.radio_coderate_lp[i].nextSibling.style.color = color_disabled; } if (system == "DVB-T") { /* enable some rf bandwidths */ document.dvbform.r_b[2].disabled = false; document.dvbform.r_b[3].disabled = false; document.dvbform.r_b[4].disabled = false; document.dvbform.r_b[2].nextSibling.style.color = color_enabled; document.dvbform.r_b[3].nextSibling.style.color = color_enabled; document.dvbform.r_b[4].nextSibling.style.color = color_enabled; /* enable some guard intervall values */ document.dvbform.r_g[0].disabled = false; document.dvbform.r_g[2].disabled = false; document.dvbform.r_g[4].disabled = false; document.dvbform.r_g[5].disabled = false; document.dvbform.r_g[0].nextSibling.style.color = color_enabled; document.dvbform.r_g[2].nextSibling.style.color = color_enabled; document.dvbform.r_g[4].nextSibling.style.color = color_enabled; document.dvbform.r_g[5].nextSibling.style.color = color_enabled; /* enable some cofdm modes */ document.dvbform.r_c[1].disabled = false; document.dvbform.r_c[3].disabled = false; document.dvbform.r_c[1].nextSibling.style.color = color_enabled; document.dvbform.r_c[3].nextSibling.style.color = color_enabled; /* enable some modulation */ document.dvbform.r_m[0].disabled = false; document.dvbform.r_m[1].disabled = false; document.dvbform.r_m[2].disabled = false; document.dvbform.r_m[4].disabled = false; document.dvbform.r_m[5].disabled = false; document.dvbform.r_m[0].nextSibling.style.color = color_enabled; document.dvbform.r_m[1].nextSibling.style.color = color_enabled; document.dvbform.r_m[2].nextSibling.style.color = color_enabled; document.dvbform.r_m[4].nextSibling.style.color = color_enabled; document.dvbform.r_m[5].nextSibling.style.color = color_enabled; /* enable some hp coderates */ document.dvbform.radio_coderate_hp[0].disabled = false; document.dvbform.radio_coderate_hp[2].disabled = false; document.dvbform.radio_coderate_hp[3].disabled = false; document.dvbform.radio_coderate_hp[5].disabled = false; document.dvbform.radio_coderate_hp[6].disabled = false; document.dvbform.radio_coderate_hp[0].nextSibling.style.color = color_enabled; document.dvbform.radio_coderate_hp[2].nextSibling.style.color = color_enabled; document.dvbform.radio_coderate_hp[3].nextSibling.style.color = color_enabled; document.dvbform.radio_coderate_hp[5].nextSibling.style.color = color_enabled; document.dvbform.radio_coderate_hp[6].nextSibling.style.color = color_enabled; if (modulation == "QPSK+16QAM" || modulation == "QPSK+64QAM") { document.getElementById("stream1").firstChild.data = "robust/HP"; document.getElementById("stream2").firstChild.data = "sensitive/LP"; /* enable lp coderates */ for(var i = 0; i < document.dvbform.radio_coderate_lp.length; ++i) { document.dvbform.radio_coderate_lp[i].disabled = false; document.dvbform.radio_coderate_lp[i].nextSibling.style.color = color_enabled; } } } else if (system == "DVB-H") { /* enable some rf bandwidths */ document.dvbform.r_b[1].disabled = false; document.dvbform.r_b[2].disabled = false; document.dvbform.r_b[3].disabled = false; document.dvbform.r_b[4].disabled = false; document.dvbform.r_b[1].nextSibling.style.color = color_enabled; document.dvbform.r_b[2].nextSibling.style.color = color_enabled; document.dvbform.r_b[3].nextSibling.style.color = color_enabled; document.dvbform.r_b[4].nextSibling.style.color = color_enabled; /* enable some guard intervall values */ document.dvbform.r_g[0].disabled = false; document.dvbform.r_g[2].disabled = false; document.dvbform.r_g[4].disabled = false; document.dvbform.r_g[5].disabled = false; document.dvbform.r_g[0].nextSibling.style.color = color_enabled; document.dvbform.r_g[2].nextSibling.style.color = color_enabled; document.dvbform.r_g[4].nextSibling.style.color = color_enabled; document.dvbform.r_g[5].nextSibling.style.color = color_enabled; /* enable some cofdm modes */ document.dvbform.r_c[1].disabled = false; document.dvbform.r_c[2].disabled = false; document.dvbform.r_c[3].disabled = false; document.dvbform.r_c[1].nextSibling.style.color = color_enabled; document.dvbform.r_c[2].nextSibling.style.color = color_enabled; document.dvbform.r_c[3].nextSibling.style.color = color_enabled; /* enable some modulation */ document.dvbform.r_m[0].disabled = false; document.dvbform.r_m[1].disabled = false; document.dvbform.r_m[2].disabled = false; document.dvbform.r_m[0].nextSibling.style.color = color_enabled; document.dvbform.r_m[1].nextSibling.style.color = color_enabled; document.dvbform.r_m[2].nextSibling.style.color = color_enabled; /* enable some hp coderates */ document.dvbform.radio_coderate_hp[0].disabled = false; document.dvbform.radio_coderate_hp[2].disabled = false; document.dvbform.radio_coderate_hp[3].disabled = false; document.dvbform.radio_coderate_hp[5].disabled = false; document.dvbform.radio_coderate_hp[6].disabled = false; document.dvbform.radio_coderate_hp[0].nextSibling.style.color = color_enabled; document.dvbform.radio_coderate_hp[2].nextSibling.style.color = color_enabled; document.dvbform.radio_coderate_hp[3].nextSibling.style.color = color_enabled; document.dvbform.radio_coderate_hp[5].nextSibling.style.color = color_enabled; document.dvbform.radio_coderate_hp[6].nextSibling.style.color = color_enabled; document.dvbform.r_mpe.disabled = false; document.dvbform.r_mpe.nextSibling.style.color = color_enabled; } else if (system == "DVB-T2") { /* enable all pp */ for(var i = 0; i < document.dvbform.r_pp.length; ++i) { document.dvbform.r_pp[i].disabled = false; document.dvbform.r_pp[i].nextSibling.style.color = color_enabled; } document.dvbform.r_papr.disabled = false; document.dvbform.r_papr.nextSibling.style.color = color_enabled; /* enable all rf bandwidths */ for(var i = 0; i < document.dvbform.r_b.length; ++i) { document.dvbform.r_b[i].disabled = false; document.dvbform.r_b[i].nextSibling.style.color = color_enabled; } /* enable all guard intervall values */ for(var i = 0; i < document.dvbform.r_g.length; ++i) { document.dvbform.r_g[i].disabled = false; document.dvbform.r_g[i].nextSibling.style.color = color_enabled; } /* enable all cofdm fft modes */ for(var i = 0; i < document.dvbform.r_c.length; ++i) { document.dvbform.r_c[i].disabled = false; document.dvbform.r_c[i].nextSibling.style.color = color_enabled; } /* enable some modulation */ for(var i = 0; i <= 3; ++i) { document.dvbform.r_m[i].disabled = false; document.dvbform.r_m[i].nextSibling.style.color = color_enabled; } /* enable some hp coderates */ for(var i = 0; i <= 5; ++i) { document.dvbform.radio_coderate_hp[i].disabled = false; document.dvbform.radio_coderate_hp[i].nextSibling.style.color = color_enabled; } } } function DVBTx_Carriers(system, carriermode) { var Carriers = new Object(); Carriers["DVB-T"] = new Object(); Carriers["DVB-H"] = new Object(); Carriers["DVB-T2"] = new Object(); Carriers["DVB-T"]["2k"] = [ 1512, 1704]; Carriers["DVB-T"]["8k"] = [ 6048, 6816]; Carriers["DVB-H"]["2k"] = [ 1512, 1704]; Carriers["DVB-H"]["4k"] = [ 3024, 3408]; Carriers["DVB-H"]["8k"] = [ 6048, 6816]; Carriers["DVB-T2"]["1k"] = [ 804, 852]; Carriers["DVB-T2"]["2k"] = [ 1602, 1704]; Carriers["DVB-T2"]["4k"] = [ 3234, 3408]; Carriers["DVB-T2"]["8k"] = [ 6498, 6816]; Carriers["DVB-T2"]["8kext"] = [ 6588, 6912]; Carriers["DVB-T2"]["16k"] = [13002,13632]; Carriers["DVB-T2"]["16kext"] = [13276,13920]; Carriers["DVB-T2"]["32k"] = [26022,27264]; Carriers["DVB-T2"]["32kext"] = [26572,27840]; if (system in Carriers && carriermode in Carriers[system]) return Carriers[system][carriermode]; return Array(0,0); } /* symbol duration in us */ function DVBTx_SymbolDuration(system, carriermode) { var Duration = new Object(); Duration["DVB-T"] = new Object(); Duration["DVB-H"] = new Object(); Duration["DVB-T2"] = new Object(); Duration["DVB-T"]["2k"] = 2*112; Duration["DVB-T"]["8k"] = 8*112; Duration["DVB-H"]["2k"] = 2*112; Duration["DVB-H"]["4k"] = 4*112; Duration["DVB-H"]["8k"] = 8*112; Duration["DVB-T2"]["1k"] = 1*112; Duration["DVB-T2"]["2k"] = 2*112; Duration["DVB-T2"]["4k"] = 4*112; Duration["DVB-T2"]["8k"] = 8*112; Duration["DVB-T2"]["8kext"] = 8*112; Duration["DVB-T2"]["16k"] = 16*112; Duration["DVB-T2"]["16kext"] = 16*112; Duration["DVB-T2"]["32k"] = 32*112; Duration["DVB-T2"]["32kext"] = 32*112; if (system in Duration && carriermode in Duration[system]) return Duration[system][carriermode] * 1e-6; return 0; } function DVBT_EffectiveCoderate(system, modulation, form_innercoderate, form_innercoderate_lp, form_mpe) { var EffCoderate = new Object(); EffCoderate["1/2"] = 564/1224; EffCoderate["2/3"] = 752/1224; EffCoderate["3/4"] = 846/1224; EffCoderate["5/6"] = 940/1224; EffCoderate["7/8"] = 987/1224; var eff_coderate = 0; var eff_coderate_lp = 0; if (system == "DVB-T" && (modulation == "QPSK" || modulation == "16QAM" || modulation == "64QAM" || modulation == "QPSK+16QAM" || modulation == "QPSK+64QAM")) { if (form_innercoderate in EffCoderate) eff_coderate = EffCoderate[form_innercoderate]; if (form_innercoderate_lp in EffCoderate) eff_coderate_lp = EffCoderate[form_innercoderate_lp]; } else if (system == "DVB-H" && (modulation == "QPSK" || modulation == "16QAM" || modulation == "64QAM")) { if (form_innercoderate in EffCoderate) eff_coderate = EffCoderate[form_innercoderate]; if (form_mpe != 0) eff_coderate = eff_coderate * 191 / 255; } return Array(eff_coderate, eff_coderate_lp); } function DVBX_bitspersymbol(modulation) { var BPS = new Object(); BPS["QPSK"] = 2; BPS["16QAM"] = 4; BPS["QPSK+16QAM"] = 4; BPS["64QAM"] = 6; BPS["QPSK+64QAM"] = 6; BPS["256QAM"] = 8; if (modulation in BPS) return BPS[modulation]; return 0; } function calc_maxspeed(system, carriermode, carrierdist_hz) { var max_dopplershift = carrierdist_hz / 12; var maxspeeds = new Array(); maxspeeds[0] = roundto( ((200e6+max_dopplershift)/200e6 - 1)*global_constant_c0*3.6, 0); maxspeeds[1] = roundto( ((500e6+max_dopplershift)/500e6 - 1)*global_constant_c0*3.6, 0); maxspeeds[2] = roundto( ((800e6+max_dopplershift)/800e6 - 1)*global_constant_c0*3.6, 0); maxspeeds[3] = roundto( ((1465e6+max_dopplershift)/1465e6 - 1)*global_constant_c0*3.6, 0); return maxspeeds; } function getSpeedInfo(maxspeeds) { var nodes; nodes = document.createElement("span"); nodes.appendChild(document.createTextNode("200MHz: " + (maxspeeds[0]>300?">300":maxspeeds[0]) + " km/h,")); nodes.appendChild(document.createElement("br")); nodes.appendChild(document.createTextNode("500MHz: " + (maxspeeds[1]>300?">300":maxspeeds[1]) + " km/h,")); nodes.appendChild(document.createElement("br")); nodes.appendChild(document.createTextNode("800MHz: " + (maxspeeds[2]>300?">300":maxspeeds[2]) + " km/h")); nodes.appendChild(document.createElement("br")); nodes.appendChild(document.createTextNode("1465MHz: " + (maxspeeds[3]>300?">300":maxspeeds[3]) + " km/h")); return nodes; } function getCapacityInfo(capacity) { var nodes; nodes = document.createElement("span"); nodes.appendChild(document.createTextNode("" + getCapacityVBR(capacity, 4.5e6, .15) + " Px @ MPEG2 Standard-TV or ")); nodes.appendChild(document.createElement("br")); nodes.appendChild(document.createTextNode(getCapacityVBR(capacity, 3e6, .1) + " Px @ MPEG4 Standard-TV or ")); nodes.appendChild(document.createElement("br")); nodes.appendChild(document.createTextNode(getCapacityVBR(capacity, 10e6, .05) + " Px @ MPEG4 HighDef-TV or ")); nodes.appendChild(document.createElement("br")); nodes.appendChild(document.createTextNode(getCapacityCBR(capacity, 256e3) + " Px @ MPEG1-Layer2 Audio or ")); nodes.appendChild(document.createElement("br")); nodes.appendChild(document.createTextNode(getCapacityCBR(capacity, 112e3) + " Px @ AAC Audio")); return nodes; } function getCapacityCBR(nettodata, one_channel_req) { return Math.floor(nettodata / one_channel_req); } function getCapacityVBR(nettodata, one_channel_req, muxgain) { var required = one_channel_req; var count = "0"; for(remain = nettodata; remain >= required; remain -= required, ++count) { /* consider gain when multipled but not less than 2/3 of the required capacity for one channel */ required = Math.max(one_channel_req * Math.pow(1+muxgain, -count), one_channel_req*2/3); } /* if remaining capacity is at least 75% of what is required, say we *may* add a further service */ if (remain >= required * .75) { if (count < 1) count = "maybe 1"; else count = "" + count + "-" + (count+1); } return count; } function getNetworkConfiguration(system, modulation, innercoderate, innercoderate_lp, tg_as_distance) { var s; if (tg_as_distance >= 60) { if (modulation == "QPSK" || modulation == "16QAM" || modulation == "QPSK+16QAM") s = "regional SFN, nationwide SFN"; else if (modulation == "QPSK+64QAM" || modulation == "64QAM") s = "regional SFN"; else s = "MFN (SFN not recommended due to sensitive modulation)"; } else if (tg_as_distance >= 30) { if (modulation == "QPSK" || modulation == "16QAM" || modulation == "QPSK+16QAM" || modulation == "QPSK+64QAM" || modulation == "64QAM") s = "local SFN, regional SFN"; else s = "MFN (SFN not recommended due to sensitive modulation)"; } else if (tg_as_distance >= 10) { if (modulation == "QPSK" || modulation == "16QAM" || modulation == "QPSK+16QAM" || modulation == "QPSK+64QAM" || modulation == "64QAM") s = "MFN, local SFN"; else s = "MFN (SFN not recommended due to sensitive modulation)"; } else { s = "MFN"; } return s; } function getReception(system, modulation, innercoderate, innercoderate_lp, mpe_active, maxspeeds) { var s; var info_speed; var sensitiviness_hp = Math.pow(DVBX_bitspersymbol(modulation),2); var sensitiviness_lp = 0; if (modulation == "QPSK+16QAM") { sensitiviness_hp = Math.pow(DVBX_bitspersymbol("QPSK"),2); sensitiviness_lp = Math.pow(DVBX_bitspersymbol("QPSK"),2); } else if (modulation == "QPSK+64QAM") { sensitiviness_hp = Math.pow(DVBX_bitspersymbol("QPSK"),2); sensitiviness_lp = Math.pow(DVBX_bitspersymbol("16QAM"),2); } if (innercoderate == "1/2") sensitiviness_hp *= .625; else if (innercoderate == "3/5") sensitiviness_hp *= .8; else if (innercoderate == "3/4") sensitiviness_hp *= 1.67; else if (innercoderate == "4/5") sensitiviness_hp *= 2.5; else if (innercoderate == "5/6") sensitiviness_hp *= 4; else if (innercoderate == "7/8") sensitiviness_hp *= 6; if (innercoderate_lp == "1/2") sensitiviness_lp *= .625; else if (innercoderate_lp == "3/4") sensitiviness_lp *= 1.67; else if (innercoderate_lp == "5/6") sensitiviness_lp *= 4; else if (innercoderate_lp == "7/8") sensitiviness_lp *= 6; if (mpe_active != 0) sensitiviness_hp *= .4; if (system == "DVB-T2") sensitiviness_hp *= .6; if (maxspeeds[0] <= 30) info_speed = ""; else if (maxspeeds[0] <= 80) info_speed = ", slow speed mobile (VHF)"; else if (maxspeeds[0] <= 130) info_speed = ", mobile (VHF)"; else if (maxspeeds[0] <= 200) info_speed = ", high speed mobile (VHF) or slow speed mobile (UHF)"; else if (maxspeeds[1] <= 130) info_speed = ", high speed mobile (VHF) or mid speed mobile (UHF)"; else info_speed = ", high speed mobile (VHF+UHF)"; if (sensitiviness_hp <= 6.5) s = "fixed, portable" + info_speed; else if (sensitiviness_hp <= 16) s = "fixed, portable" + info_speed + " with diversity receivers"; else if (sensitiviness_hp <= 27) s = "fixed, portable"; else s = "fixed"; return s; } function DVBT2_NettobitsPerFecframe(modulation, coderate) { var NB = new Object(); NB["1/2"] = 32208-80; NB["3/5"] = 38688-80; NB["2/3"] = 43040-80; NB["3/4"] = 48408-80; NB["4/5"] = 51648-80; NB["5/6"] = 53840-80; if (coderate in NB) return NB[coderate]; return 0; } /* return Array of NDataP2, NP2, CData, NDataFC, */ function DVBT2_Cells(fft, pilotpattern, papr) { var CELLS = new Object(); CELLS["1k"] = new Object(); CELLS["2k"] = new Object(); CELLS["4k"] = new Object(); CELLS["8k"] = new Object(); CELLS["8kext"] = new Object(); CELLS["16k"] = new Object(); CELLS["16kext"] = new Object(); CELLS["32k"] = new Object(); CELLS["32kext"] = new Object(); CELLS["1k"]["TRCELLS"] = 10; CELLS["1k"]["CDATA_P2"] = 558; CELLS["1k"]["N_P2"] = 16; CELLS["1k"]["PP1"] = [764, 568]; /* CData, NDataFC */ CELLS["1k"]["PP2"] = [768, 710]; CELLS["1k"]["PP3"] = [798, 710]; CELLS["1k"]["PP4"] = [804, 780]; CELLS["1k"]["PP5"] = [818, 780]; CELLS["2k"]["TRCELLS"] = 18; CELLS["2k"]["CDATA_P2"] = 1118; CELLS["2k"]["N_P2"] = 8; CELLS["2k"]["PP1"] = [1522, 1136]; CELLS["2k"]["PP2"] = [1532, 1420]; CELLS["2k"]["PP3"] = [1596, 1420]; CELLS["2k"]["PP4"] = [1602, 1562]; CELLS["2k"]["PP5"] = [1632, 1562]; CELLS["2k"]["PP7"] = [1646, 1632]; CELLS["4k"]["TRCELLS"] = 36; CELLS["4k"]["N_P2"] = 4; CELLS["4k"]["CDATA_P2"] = 2236; CELLS["4k"]["PP1"] = [3084, 2272]; CELLS["4k"]["PP2"] = [3092, 2840]; CELLS["4k"]["PP3"] = [3228, 2840]; CELLS["4k"]["PP4"] = [3234, 3124]; CELLS["4k"]["PP5"] = [3298, 3124]; CELLS["4k"]["PP7"] = [3328, 3266]; CELLS["8k"]["TRCELLS"] = 72; CELLS["8k"]["CDATA_P2"] = 4472; CELLS["8k"]["N_P2"] = 2; CELLS["8k"]["PP1"] = [6208, 4544]; CELLS["8k"]["PP2"] = [6214, 5680]; CELLS["8k"]["PP3"] = [6494, 5680]; CELLS["8k"]["PP4"] = [6498, 6248]; CELLS["8k"]["PP5"] = [6634, 6248]; CELLS["8k"]["PP7"] = [6698, 6532]; CELLS["8k"]["PP8"] = [6698, 0]; CELLS["8kext"]["TRCELLS"] = 72; CELLS["8kext"]["CDATA_P2"] = 4472; CELLS["8kext"]["N_P2"] = 2; CELLS["8kext"]["PP1"] = [6296, 4608]; CELLS["8kext"]["PP2"] = [6298, 5760]; CELLS["8kext"]["PP3"] = [6584, 5760]; CELLS["8kext"]["PP4"] = [6588, 6336]; CELLS["8kext"]["PP5"] = [6728, 6336]; CELLS["8kext"]["PP7"] = [6788, 6624]; CELLS["8kext"]["PP8"] = [6788, 0]; CELLS["16k"]["TRCELLS"] = 144; CELLS["16k"]["CDATA_P2"] = 8944; CELLS["16k"]["N_P2"] = 1; CELLS["16k"]["PP1"] = [12418, 9088]; CELLS["16k"]["PP2"] = [12436, 11360]; CELLS["16k"]["PP3"] = [12988, 11360]; CELLS["16k"]["PP4"] = [13002, 12496]; CELLS["16k"]["PP5"] = [13272, 12496]; CELLS["16k"]["PP6"] = [13288, 13064]; CELLS["16k"]["PP7"] = [13416, 13064]; CELLS["16k"]["PP8"] = [13406, 0]; CELLS["16kext"]["TRCELLS"] = 144; CELLS["16kext"]["CDATA_P2"] = 8944; CELLS["16kext"]["N_P2"] = 1; CELLS["16kext"]["PP1"] = [12678, 9260]; CELLS["16kext"]["PP2"] = [12698, 11600]; CELLS["16kext"]["PP3"] = [13262, 11600]; CELLS["16kext"]["PP4"] = [13276, 12760]; CELLS["16kext"]["PP5"] = [13552, 12760]; CELLS["16kext"]["PP6"] = [13568, 13340]; CELLS["16kext"]["PP7"] = [13698, 13340]; CELLS["16kext"]["PP8"] = [13688, 0]; CELLS["32k"]["TRCELLS"] = 288; CELLS["32k"]["CDATA_P2"] = 22432; CELLS["32k"]["N_P2"] = 1; CELLS["32k"]["PP2"] = [24886, 22720]; CELLS["32k"]["PP4"] = [26022, 24992]; CELLS["32k"]["PP6"] = [26592, 26128]; CELLS["32k"]["PP7"] = [26836, 0]; CELLS["32k"]["PP8"] = [26812, 0]; CELLS["32kext"]["TRCELLS"] = 288; CELLS["32kext"]["CDATA_P2"] = 22432; CELLS["32kext"]["N_P2"] = 1; CELLS["32kext"]["PP2"] = [25412, 23200]; CELLS["32kext"]["PP4"] = [26572, 25520]; CELLS["32kext"]["PP6"] = [27152, 26680]; CELLS["32kext"]["PP7"] = [27404, 0]; CELLS["32kext"]["PP8"] = [27376, 0]; if (fft in CELLS && pilotpattern in CELLS[fft]) { if (papr) { return Array(CELLS[fft]["CDATA_P2"], CELLS[fft]["N_P2"], CELLS[fft][pilotpattern][0] - CELLS[fft]["TRCELLS"], CELLS[fft][pilotpattern][1] - CELLS[fft]["TRCELLS"]); } return Array(CELLS[fft]["CDATA_P2"], CELLS[fft]["N_P2"], CELLS[fft][pilotpattern][0], CELLS[fft][pilotpattern][1]); } return Array(0,0,0,0); } function DVBT2_MaxSymbolsPerFrame(fft, tguard) { var MAXSYMBOLS = new Object(); MAXSYMBOLS["1k"] = new Object(); MAXSYMBOLS["2k"] = new Object(); MAXSYMBOLS["4k"] = new Object(); MAXSYMBOLS["8k"] = new Object(); MAXSYMBOLS["8kext"] = new Object(); MAXSYMBOLS["16k"] = new Object(); MAXSYMBOLS["16kext"] = new Object(); MAXSYMBOLS["32k"] = new Object(); MAXSYMBOLS["32kext"] = new Object(); MAXSYMBOLS["1k"]["1/16"] = 2098; MAXSYMBOLS["1k"][ "1/8"] = 1982; MAXSYMBOLS["1k"][ "1/4"] = 1784; MAXSYMBOLS["2k"]["1/32"] = 1081; MAXSYMBOLS["2k"]["1/16"] = 1049; MAXSYMBOLS["2k"][ "1/8"] = 991; MAXSYMBOLS["2k"][ "1/4"] = 892; MAXSYMBOLS["4k"]["1/32"] = 540; MAXSYMBOLS["4k"]["1/16"] = 524; MAXSYMBOLS["4k"][ "1/8"] = 495; MAXSYMBOLS["4k"][ "1/4"] = 446; MAXSYMBOLS["8k"][ "1/128"] = 276; MAXSYMBOLS["8k"][ "1/32"] = 270; MAXSYMBOLS["8k"][ "1/16"] = 262; MAXSYMBOLS["8k"]["19/256"] = 259; MAXSYMBOLS["8k"][ "1/8"] = 247; MAXSYMBOLS["8k"]["19/128"] = 242; MAXSYMBOLS["8k"][ "1/4"] = 223; MAXSYMBOLS["8kext"][ "1/128"] = 276; MAXSYMBOLS["8kext"][ "1/32"] = 270; MAXSYMBOLS["8kext"][ "1/16"] = 262; MAXSYMBOLS["8kext"]["19/256"] = 259; MAXSYMBOLS["8kext"][ "1/8"] = 247; MAXSYMBOLS["8kext"]["19/128"] = 242; MAXSYMBOLS["8kext"][ "1/4"] = 223; MAXSYMBOLS["16k"][ "1/128"] = 138; MAXSYMBOLS["16k"][ "1/32"] = 135; MAXSYMBOLS["16k"][ "1/16"] = 131; MAXSYMBOLS["16k"]["19/256"] = 129; MAXSYMBOLS["16k"][ "1/8"] = 123; MAXSYMBOLS["16k"]["19/128"] = 121; MAXSYMBOLS["16k"][ "1/4"] = 111; MAXSYMBOLS["16kext"][ "1/128"] = 138; MAXSYMBOLS["16kext"][ "1/32"] = 135; MAXSYMBOLS["16kext"][ "1/16"] = 131; MAXSYMBOLS["16kext"]["19/256"] = 129; MAXSYMBOLS["16kext"][ "1/8"] = 123; MAXSYMBOLS["16kext"]["19/128"] = 121; MAXSYMBOLS["16kext"][ "1/4"] = 111; MAXSYMBOLS["32k"][ "1/128"] = 68; MAXSYMBOLS["32k"][ "1/32"] = 66; MAXSYMBOLS["32k"][ "1/16"] = 64; MAXSYMBOLS["32k"]["19/256"] = 64; MAXSYMBOLS["32k"][ "1/8"] = 60; MAXSYMBOLS["32k"]["19/128"] = 60; MAXSYMBOLS["32kext"][ "1/128"] = 68; MAXSYMBOLS["32kext"][ "1/32"] = 66; MAXSYMBOLS["32kext"][ "1/16"] = 64; MAXSYMBOLS["32kext"]["19/256"] = 64; MAXSYMBOLS["32kext"][ "1/8"] = 60; MAXSYMBOLS["32kext"]["19/128"] = 60; if (fft in MAXSYMBOLS && tguard in MAXSYMBOLS[fft]) return MAXSYMBOLS[fft][tguard]; return 0; } function DVBT2_Ncells(mod) { var NCELLS = new Object(); NCELLS[ "QPSK"] = 32400; NCELLS[ "16QAM"] = 16200; NCELLS[ "64QAM"] = 10800; NCELLS["256QAM"] = 8100; if (mod in NCELLS) return NCELLS[mod]; return 0; } function DVBx_CNratio(system, rf_bw, fft, modulation, fec, dvbh_mpe, dvbt2_pilotpattern, dvbt2_papr) { /* all values: Bw=8MHz, no PAPR */ var CNR = new Object(); CNR["DVB-T"] = new Object(); CNR["DVB-T"][ "QPSK"] = new Object(); CNR["DVB-T"]["16QAM"] = new Object(); CNR["DVB-T"]["64QAM"] = new Object(); CNR["DVB-T"]["QPSK+16QAM"] = new Object(); CNR["DVB-T"]["QPSK+64QAM"] = new Object(); CNR["DVB-T"][ "QPSK"]["1/2"] = [ 3.5, 4.1, 5.9]; /* AWGN, Rice, Rayleigh */ CNR["DVB-T"][ "QPSK"]["2/3"] = [ 5.3, 6.1, 9.6]; CNR["DVB-T"][ "QPSK"]["3/4"] = [ 6.3, 7.2, 12.4]; CNR["DVB-T"][ "QPSK"]["5/6"] = [ 7.3, 8.5, 15.6]; CNR["DVB-T"][ "QPSK"]["7/8"] = [ 7.9, 9.2, 17.5]; CNR["DVB-T"]["16QAM"]["1/2"] = [ 9.3, 9.8, 11.8]; CNR["DVB-T"]["16QAM"]["2/3"] = [11.4, 12.1, 15.3]; CNR["DVB-T"]["16QAM"]["3/4"] = [12.6, 13.4, 18.1]; CNR["DVB-T"]["16QAM"]["5/6"] = [13.8, 14.8, 21.3]; CNR["DVB-T"]["16QAM"]["7/8"] = [14.4, 15.7, 23.6]; CNR["DVB-T"]["64QAM"]["1/2"] = [13.8, 14.3, 16.4]; CNR["DVB-T"]["64QAM"]["2/3"] = [16.7, 17.3, 20.3]; CNR["DVB-T"]["64QAM"]["3/4"] = [18.2, 18.9, 23.0]; CNR["DVB-T"]["64QAM"]["5/6"] = [19.4, 20.4, 26.2]; CNR["DVB-T"]["64QAM"]["7/8"] = [20.2, 21.3, 28.6]; CNR["DVB-T"]["QPSK+16QAM"]["1/2"] = [ 5.1, 5.6, 7.7, 13.5, 14.1, 15.9]; /* HP: AWGN, Rice, Rayleigh, LP: AWGN, Rice, Rayleigh, alpha=2 */ CNR["DVB-T"]["QPSK+16QAM"]["2/3"] = [ 7.3, 8.0, 11.4, 15.3, 16.1, 19.5]; CNR["DVB-T"]["QPSK+16QAM"]["3/4"] = [ 8.6, 9.5, 14.2, 16.3, 17.2, 22.4]; CNR["DVB-T"]["QPSK+16QAM"]["5/6"] = [ NaN, NaN, NaN, 17.3, 18.5, 25.5]; CNR["DVB-T"]["QPSK+16QAM"]["7/8"] = [ NaN, NaN, NaN, 17.9, 19.2, 28.2]; CNR["DVB-T"]["QPSK+64QAM"]["1/2"] = [ 8.5, 9.1, 11.8, 15.5, 16.0, 18.1]; /* HP: AWGN, Rice, Rayleigh, LP: AWGN, Rice, Rayleigh, alpha=2 */ CNR["DVB-T"]["QPSK+64QAM"]["2/3"] = [12.5, 13.1, 16.4, 17.6, 18.3, 21.6]; CNR["DVB-T"]["QPSK+64QAM"]["3/4"] = [15.0, 15.6, 19.3, 18.8, 19.7, 24.4]; CNR["DVB-T"]["QPSK+64QAM"]["5/6"] = [ NaN, NaN, NaN, 20.0, 21.1, 27.6]; CNR["DVB-T"]["QPSK+64QAM"]["7/8"] = [ NaN, NaN, NaN, 20.7, 21.9, 29.7]; CNR["DVB-H"] = new Object(); CNR["DVB-H"][ "QPSK"] = new Object(); CNR["DVB-H"]["16QAM"] = new Object(); CNR["DVB-H"]["64QAM"] = new Object(); CNR["DVB-H"][ "QPSK"]["1/2"] = CNR["DVB-T"][ "QPSK"]["1/2"]; CNR["DVB-H"][ "QPSK"]["2/3"] = CNR["DVB-T"][ "QPSK"]["2/3"]; CNR["DVB-H"][ "QPSK"]["3/4"] = CNR["DVB-T"][ "QPSK"]["3/4"]; CNR["DVB-H"][ "QPSK"]["5/6"] = CNR["DVB-T"][ "QPSK"]["5/6"]; CNR["DVB-H"][ "QPSK"]["7/8"] = CNR["DVB-T"][ "QPSK"]["7/8"]; CNR["DVB-H"]["16QAM"]["1/2"] = CNR["DVB-T"]["16QAM"]["1/2"]; CNR["DVB-H"]["16QAM"]["2/3"] = CNR["DVB-T"]["16QAM"]["2/3"]; CNR["DVB-H"]["16QAM"]["3/4"] = CNR["DVB-T"]["16QAM"]["3/4"]; CNR["DVB-H"]["16QAM"]["5/6"] = CNR["DVB-T"]["16QAM"]["5/6"]; CNR["DVB-H"]["16QAM"]["7/8"] = CNR["DVB-T"]["16QAM"]["7/8"]; CNR["DVB-H"]["64QAM"]["1/2"] = CNR["DVB-T"]["64QAM"]["1/2"]; CNR["DVB-H"]["64QAM"]["2/3"] = CNR["DVB-T"]["64QAM"]["2/3"]; CNR["DVB-H"]["64QAM"]["3/4"] = CNR["DVB-T"]["64QAM"]["3/4"]; CNR["DVB-H"]["64QAM"]["5/6"] = CNR["DVB-T"]["64QAM"]["5/6"]; CNR["DVB-H"]["64QAM"]["7/8"] = CNR["DVB-T"]["64QAM"]["7/8"]; CNR["DVB-T2"] = new Object(); CNR["DVB-T2"][ "QPSK"] = new Object(); CNR["DVB-T2"][ "16QAM"] = new Object(); CNR["DVB-T2"][ "64QAM"] = new Object(); CNR["DVB-T2"]["256QAM"] = new Object(); CNR["DVB-T2"][ "QPSK"]["1/2"] = [ 0.8, 1.0, 1.8]; /* AWGN, Rice, Rayleigh */ CNR["DVB-T2"][ "QPSK"]["3/5"] = [ 2.1, 2.4, 3.4]; CNR["DVB-T2"][ "QPSK"]["2/3"] = [ 2.9, 3.3, 4.6]; CNR["DVB-T2"][ "QPSK"]["3/4"] = [ 3.9, 4.3, 5.9]; CNR["DVB-T2"][ "QPSK"]["4/5"] = [ 4.5, 5.0, 6.8]; CNR["DVB-T2"][ "QPSK"]["5/6"] = [ 5.0, 5.6, 7.2]; CNR["DVB-T2"][ "16QAM"]["1/2"] = [ 5.7, 6.1, 7.3]; CNR["DVB-T2"][ "16QAM"]["3/5"] = [ 7.4, 7.7, 9.1]; CNR["DVB-T2"][ "16QAM"]["2/3"] = [ 8.6, 8.9, 10.5]; CNR["DVB-T2"][ "16QAM"]["3/4"] = [ 9.8, 10.3, 12.2]; CNR["DVB-T2"][ "16QAM"]["4/5"] = [10.6, 11.1, 13.4]; CNR["DVB-T2"][ "16QAM"]["5/6"] = [11.2, 11.8, 14.4]; CNR["DVB-T2"][ "64QAM"]["1/2"] = [ 9.6, 10.0, 11.7]; CNR["DVB-T2"][ "64QAM"]["3/5"] = [11.7, 12.1, 13.8]; CNR["DVB-T2"][ "64QAM"]["2/3"] = [13.2, 13.6, 15.4]; CNR["DVB-T2"][ "64QAM"]["3/4"] = [14.9, 15.3, 17.5]; CNR["DVB-T2"][ "64QAM"]["4/5"] = [15.9, 16.4, 19.0]; CNR["DVB-T2"][ "64QAM"]["5/6"] = [16.6, 17.2, 19.9]; CNR["DVB-T2"]["256QAM"]["1/2"] = [12.8, 13.3, 15.4]; CNR["DVB-T2"]["256QAM"]["3/5"] = [15.6, 16.0, 18.1]; CNR["DVB-T2"]["256QAM"]["2/3"] = [17.5, 17.8, 20.0]; CNR["DVB-T2"]["256QAM"]["3/4"] = [19.7, 20.2, 22.5]; CNR["DVB-T2"]["256QAM"]["4/5"] = [21.1, 21.5, 24.2]; CNR["DVB-T2"]["256QAM"]["5/6"] = [21.8, 22.3, 25.3]; /* additional correction value */ var add_cn = 0; /* DVB-H MPE correction */ if (system == "DVB-H") { if (!dvbh_mpe) ; else add_cn -= 3; } /* DVB-T2 PAPR and PP correction */ else if (system == "DVB-T2") { PPCOR = new Object(); PPCOR["1k"] = new Object(); PPCOR["2k"] = new Object(); PPCOR["4k"] = new Object(); PPCOR["8k"] = new Object(); PPCOR["8kext"] = new Object(); PPCOR["16k"] = new Object(); PPCOR["16kext"] = new Object(); PPCOR["32k"] = new Object(); PPCOR["32kext"] = new Object(); PPCOR["1k"]["PP1"] = .34; PPCOR["1k"]["PP2"] = .32; PPCOR["1k"]["PP3"] = .44; PPCOR["1k"]["PP4"] = .42; PPCOR["1k"]["PP5"] = .45; PPCOR["1k"]["PP7"] = .29; PPCOR["2k"]["PP1"] = .35; PPCOR["2k"]["PP2"] = .33; PPCOR["2k"]["PP3"] = .43; PPCOR["2k"]["PP4"] = .42; PPCOR["2k"]["PP5"] = .47; PPCOR["2k"]["PP7"] = .29; PPCOR["4k"]["PP1"] = .39; PPCOR["4k"]["PP2"] = .37; PPCOR["4k"]["PP3"] = .47; PPCOR["4k"]["PP4"] = .45; PPCOR["4k"]["PP5"] = .51; PPCOR["4k"]["PP7"] = .34; PPCOR["8k"]["PP1"] = .41; PPCOR["8k"]["PP2"] = .39; PPCOR["8k"]["PP3"] = .49; PPCOR["8k"]["PP4"] = .48; PPCOR["8k"]["PP5"] = .53; PPCOR["8k"]["PP7"] = .37; PPCOR["8k"]["PP8"] = .37; PPCOR["8kext"]["PP1"] = .41; PPCOR["8kext"]["PP2"] = .41; PPCOR["8kext"]["PP3"] = .5; PPCOR["8kext"]["PP4"] = .48; PPCOR["8kext"]["PP5"] = .52; PPCOR["8kext"]["PP7"] = .39; PPCOR["8kext"]["PP8"] = .38; PPCOR["16k"]["PP1"] = .41; PPCOR["16k"]["PP2"] = .38; PPCOR["16k"]["PP3"] = .49; PPCOR["16k"]["PP4"] = .47; PPCOR["16k"]["PP5"] = .52; PPCOR["16k"]["PP6"] = .49; PPCOR["16k"]["PP7"] = .33; PPCOR["16k"]["PP8"] = .35; PPCOR["16kext"]["PP1"] = .42; PPCOR["16kext"]["PP2"] = .38; PPCOR["16kext"]["PP3"] = .49; PPCOR["16kext"]["PP4"] = .47; PPCOR["16kext"]["PP5"] = .52; PPCOR["16kext"]["PP6"] = .49; PPCOR["16kext"]["PP7"] = .34; PPCOR["16kext"]["PP8"] = .35; PPCOR["32k"]["PP2"] = .37; PPCOR["32k"]["PP3"] = .48; PPCOR["32k"]["PP4"] = .45; PPCOR["32k"]["PP6"] = .48; PPCOR["32k"]["PP7"] = .33; PPCOR["32k"]["PP8"] = .35; PPCOR["32kext"]["PP2"] = .37; PPCOR["32kext"]["PP3"] = .48; PPCOR["32kext"]["PP4"] = .45; PPCOR["32kext"]["PP6"] = .48; PPCOR["32kext"]["PP7"] = .33; PPCOR["32kext"]["PP8"] = .35; if (fft in PPCOR && dvbt2_pilotpattern in PPCOR[fft]) add_cn += PPCOR[fft][dvbt2_pilotpattern]; } if (system in CNR && modulation in CNR[system] && fec in CNR[system][modulation]) { for (var i in CNR[system][modulation][fec]) { CNR[system][modulation][fec][i] += add_cn; } return CNR[system][modulation][fec]; } /* otherwise: unknown or unsupported */ return Array(NaN, NaN, NaN); } function DVBx_receptiondist(cn_arr, rf_bw) { /* ground wave propagation curves: 1kW, 200MHz and UHF, tx@150mHaat, field strength in dBuV/m, 50% location, 50% time */ var dist_km = [10,15,20,25,30,40,50,70,100,150]; var vhf_dBuVm = [77.5,69,64,59,55,48,42.5,34,24,11.5]; var uhf_dBuVm = [77,68,61.5,56.5,52,44,38,27.5,17,4.5]; var uhfL_dBuVm = [77,67,61,55,51,43,36,24,13,1]; /* tx power rel. to 1kW */ var txpwr_db1kW = new Object(); txpwr_db1kW["vhf3"] = 10; txpwr_db1kW["uhf4"] = 17; txpwr_db1kW["uhf5"] = 18; txpwr_db1kW["uhfL"] = 10; /* man made noise */ var mmn_db = new Object(); mmn_db["vhf3"] = 2; mmn_db["uhf4"] = 0; mmn_db["uhf5"] = 0; mmn_db["uhfL"] = 0; /* buildung penetration loss */ var penetrloss_db = new Object(); penetrloss_db["vhf3"] = 9; penetrloss_db["uhf4"] = 8; penetrloss_db["uhf5"] = 8; penetrloss_db["uhfL"] = 8; /* height correction 10m -> 1.5m */ var height_db = new Object(); height_db["vhf3"] = 12; height_db["uhf4"] = 16; height_db["uhf5"] = 18; height_db["uhfL"] = 21; /* rec. noise figure */ var recn_db = new Object(); recn_db["vhf3"] = 7; recn_db["uhf4"] = 7; recn_db["uhf5"] = 7; recn_db["uhfL"] = 7; /* antenna gain [inhouse, portable, fixed] */ var gain_dbd = new Object(); gain_dbd["vhf3"] = [-2.2,-2.2,7]; gain_dbd["uhf4"] = [0,0,10]; gain_dbd["uhf5"] = [0,0,12]; gain_dbd["uhfL"] = [0,0,15]; /* feeder loss [inhouse, portable, fixed] */ var feed_db = new Object(); feed_db["vhf3"] = [0,0,2]; feed_db["uhf4"] = [0,0,3]; feed_db["uhf5"] = [0,0,5]; feed_db["uhfL"] = [0,0,10]; /* location correction (50% -> 95%, inhouse or outdoor) [inhouse, portable, fixed] */ var location_db = new Object(); location_db["vhf3"] = [10,9,9]; location_db["uhf4"] = [13,9,9]; location_db["uhf5"] = [13,9,9]; location_db["uhfL"] = [13,9,9]; return Array( calc_emed_dist(200e6, rf_bw, txpwr_db1kW["vhf3"], cn_arr[2], recn_db["vhf3"], mmn_db["vhf3"], penetrloss_db["vhf3"], height_db["vhf3"], gain_dbd["vhf3"][0],feed_db["vhf3"][0], location_db["vhf3"][0], dist_km, vhf_dBuVm), calc_emed_dist(200e6, rf_bw, txpwr_db1kW["vhf3"], cn_arr[2], recn_db["vhf3"], mmn_db["vhf3"], 0, height_db["vhf3"], gain_dbd["vhf3"][1],feed_db["vhf3"][1], location_db["vhf3"][1], dist_km, vhf_dBuVm), calc_emed_dist(200e6, rf_bw, txpwr_db1kW["vhf3"], cn_arr[1], recn_db["vhf3"], mmn_db["vhf3"], 0, 0, gain_dbd["vhf3"][2],feed_db["vhf3"][2], location_db["vhf3"][2], dist_km, vhf_dBuVm), calc_emed_dist(500e6, rf_bw, txpwr_db1kW["uhf4"], cn_arr[2], recn_db["uhf4"], mmn_db["uhf4"], penetrloss_db["uhf4"], height_db["uhf4"], gain_dbd["uhf4"][0],feed_db["uhf4"][0], location_db["uhf4"][0], dist_km, uhf_dBuVm), calc_emed_dist(500e6, rf_bw, txpwr_db1kW["uhf4"], cn_arr[2], recn_db["uhf4"], mmn_db["uhf4"], 0, height_db["uhf4"], gain_dbd["uhf4"][1],feed_db["uhf4"][1], location_db["uhf4"][1], dist_km, uhf_dBuVm), calc_emed_dist(500e6, rf_bw, txpwr_db1kW["uhf4"], cn_arr[1], recn_db["uhf4"], mmn_db["uhf4"], 0, 0, gain_dbd["uhf4"][2],feed_db["uhf4"][2], location_db["uhf4"][2], dist_km, uhf_dBuVm), calc_emed_dist(800e6, rf_bw, txpwr_db1kW["uhf5"], cn_arr[2], recn_db["uhf5"], mmn_db["uhf5"], penetrloss_db["uhf5"], height_db["uhf5"], gain_dbd["uhf5"][0],feed_db["uhf5"][0], location_db["uhf5"][0], dist_km, uhf_dBuVm), calc_emed_dist(800e6, rf_bw, txpwr_db1kW["uhf5"], cn_arr[2], recn_db["uhf5"], mmn_db["uhf5"], 0, height_db["uhf5"], gain_dbd["uhf5"][1],feed_db["uhf5"][1], location_db["uhf5"][1], dist_km, uhf_dBuVm), calc_emed_dist(800e6, rf_bw, txpwr_db1kW["uhf5"], cn_arr[1], recn_db["uhf5"], mmn_db["uhf5"], 0, 0, gain_dbd["uhf5"][2],feed_db["uhf5"][2], location_db["uhf5"][2], dist_km, uhf_dBuVm), calc_emed_dist(800e6, rf_bw, txpwr_db1kW["uhfL"], cn_arr[2], recn_db["uhfL"], mmn_db["uhfL"], penetrloss_db["uhfL"], height_db["uhfL"], gain_dbd["uhfL"][0],feed_db["uhfL"][0], location_db["uhfL"][0], dist_km, uhfL_dBuVm), calc_emed_dist(800e6, rf_bw, txpwr_db1kW["uhfL"], cn_arr[2], recn_db["uhfL"], mmn_db["uhfL"], 0, height_db["uhfL"], gain_dbd["uhfL"][1],feed_db["uhfL"][1], location_db["uhfL"][1], dist_km, uhfL_dBuVm), calc_emed_dist(800e6, rf_bw, txpwr_db1kW["uhfL"], cn_arr[1], recn_db["uhfL"], mmn_db["uhfL"], 0, 0, gain_dbd["uhfL"][2],feed_db["uhfL"][2], location_db["uhfL"][2], dist_km, uhfL_dBuVm) ); } function calc_emed_dist(freq, rf_bw, txpwr_db1kW, cnratio_db, recn_db, mmn_db, penetrloss_db, height_db, gain_dbd, feed_db, location_db, x, y) { var freq_db = 20 * log10(freq); var bw_db = 10 * log10(rf_bw); var e_med = cnratio_db + recn_db + bw_db + freq_db - gain_dbd - 218.907 + feed_db + mmn_db + location_db + height_db + penetrloss_db; /* Bandwidth correction to be added to the C/N value (all C/N values above are for 7.61MHz systems only) */ var bwcorr = bw_db - 68.814; var d = find_x(x, y, e_med + bwcorr - txpwr_db1kW); return Array(e_med, d); } function find_x(x_vec, y_vec, y) { var i = 0; for (; i < y_vec.length; ++i) { if (y >= y_vec[i]) break; } if (i == 0) return 5+0*x_vec[0]; if (i >= y_vec.length) return x_vec[x_vec.length-1]; /* linear interpolation */ var m = (y_vec[i] - y_vec[i-1]) / (x_vec[i] - x_vec[i-1]); var n = y_vec[i] - m * x_vec[i]; var x = (y - n) / m; return x; } /**********************************************************************/ /* system - "DVB-T", "DVB-T2", "DVB-H" bw_mhz - numeric, in MHz fft - "1k", "2k", "4k", "8k", "8kext", "16k", "16kext", "32k", "32kext" guard - "1/4" ... "19/256" ... "1/128" mod - "QPSK", "16QAM", "64QAM", "256QAM", "QPSK+16QAM", "QPSK+64QAM" innercoderate - "1/2" ... "2/3" ... "7/8" innercoderate_lp - "1/2" ... "2/3" ... "7/8" dvbh_mpe - 0 / 1 dvbt2_pp - "PP1" ... "PP4" ... "PP8" dvbt2_trpapr - 0 / 1 */ function isFormValid(system, bw_mhz, fft, guard, mod, innercoderate, innercoderate_lp, dvbh_mpe, dvbt2_pp, dvbt2_trpapr) { isInvalid = 0; // forbidden parameter: if ("DVB-T" == system) { isInvalid = (isInvalid || "19/128" == guard || "19/256" == guard || "1/128" == guard); isInvalid = (isInvalid || "1k" == fft || "4k" == fft || "8kext" == fft || "16k" == fft || "16kext" == fft || "32k" == fft || "32kext" == fft); isInvalid = (isInvalid || "3/5" == innercoderate || "4/5" == innercoderate); isInvalid = (isInvalid || "256QAM" == mod); isInvalid = (isInvalid || 5.3 > bw_mhz || 8 < bw_mhz); } else if ("DVB-H" == system) { isInvalid = (isInvalid || "19/128" == guard || "19/256" == guard || "1/128" == guard); isInvalid = (isInvalid || "1k" == fft || "8kext" == fft || "16k" == fft || "16kext" == fft || "32k" == fft || "32kext" == fft); isInvalid = (isInvalid || "3/5" == innercoderate || "4/5" == innercoderate); isInvalid = (isInvalid || "256QAM" == mod || "QPSK+16QAM" == mod || "QPSK+64QAM" == mod); isInvalid = (isInvalid || 4.3 > bw_mhz || 8 < bw_mhz); } else if ("DVB-T2" == system) { isInvalid = (isInvalid || "7/8" == innercoderate); isInvalid = (isInvalid || "QPSK+16QAM" == mod || "QPSK+64QAM" == mod); } return !isInvalid; } function calcDATA(system, bw_mhz, fft, guard, mod, innercoderate, innercoderate_lp, dvbh_mpe, dvbt2_pp, dvbt2_trpapr) { var DATA = new Object(); /* init */ DATA["OK"] = 0; /* ok / error (wrong input) */ DATA["T_SYMBOL"] = ""; /* in us with 3 digits */ DATA["T_GUARD"] = ""; /* in us with 3 digits */ DATA["TX_DIST"] = ""; /* in km with 1 digit */ DATA["F_BWRF"] = ""; /* in MHz with 3 digits */ DATA["F_CARRIER"] = ""; /* in kHz with 3 digits */ DATA["MAXSPEED"] = ""; /* HTML Nodes */ DATA["R_SYMBOLS"] = ""; /* in MSym/s with 3 digits */ DATA["R_BRUTTO"] = ""; /* in MBit/s with 3 digits */ DATA["R_NETTO"] = ""; /* in MBit/s with 3 digits */ DATA["R_NETTO_INFO"] = ""; /* textual */ DATA["TXT_CAPACITY"] = ""; /* HTML Nodes */ DATA["TXT_NETTOPO"] = ""; /* textual */ DATA["TXT_RECPT"] = ""; /* textual */ DATA["TXT_CN"] = ""; /* in dB */ DATA["TXT_MINFS_1"] = ""; /* textual */ DATA["TXT_MINFS_2"] = ""; DATA["TXT_MINFS_3"] = ""; DATA["TXT_MINFS_4"] = ""; DATA["TXT_MINFS_5"] = ""; DATA["TXT_MINFS_6"] = ""; DATA["TXT_MINFS_7"] = ""; DATA["TXT_MINFS_8"] = ""; DATA["TXT_MINFS_9"] = ""; DATA["TXT_COVINFO"] = ""; /* textual */ var valid = isFormValid(system, bw_mhz, fft, guard, mod, innercoderate, innercoderate_lp, dvbh_mpe, dvbt2_pp, dvbt2_trpapr); if (!valid) { return DATA; } /* calc */ var data_brutto = 0; var data_netto = 0; var data_netto_hp = 0; var data_netto_lp = 0; var netto_info = ""; var t_usesymbol = DVBTx_SymbolDuration(system, fft) * 8 / bw_mhz; var t_guard = t_usesymbol * eval(guard); var carriers = DVBTx_Carriers(system, fft); var data_carriers = carriers[0]; var all_carriers = carriers[1]; var rf_bw = (all_carriers+1) / t_usesymbol; var global_symbolrate = data_carriers / t_usesymbol; if ("DVB-T" == system || "DVB-H" == system) { var coderates = DVBT_EffectiveCoderate(system, mod, innercoderate, innercoderate_lp, dvbh_mpe); var global_eff_coderate = coderates[0]; var global_eff_coderate_lp = coderates[1]; data_brutto = global_symbolrate * DVBX_bitspersymbol(mod) / (1 + eval(guard)); data_netto = data_brutto * global_eff_coderate; if (mod == "QPSK+16QAM" || mod == "QPSK+64QAM") { data_netto_hp = global_symbolrate * DVBX_bitspersymbol("QPSK") * global_eff_coderate / (1 + eval(guard)); if (mod == "QPSK+16QAM") data_netto_lp = global_symbolrate * DVBX_bitspersymbol("QPSK")* global_eff_coderate_lp / (1 + eval(guard)); else /* mod == "QPSK+64QAM") */ data_netto_lp = global_symbolrate * DVBX_bitspersymbol("16QAM")* global_eff_coderate_lp / (1 + eval(guard)); data_netto = data_netto_hp + data_netto_lp; netto_info = "(HP: " + roundto(data_netto_hp/1e6, 3) + String.fromCharCode(160) + "Mbit/s, " + "LP: " + roundto(data_netto_lp/1e6, 3) + String.fromCharCode(160) + "Mbit/s)"; } } else if ("DVB-T2" == system) { var t_p1 = 224e-6; var lf = DVBT2_MaxSymbolsPerFrame(fft, guard); var nettobits_per_fecframe = DVBT2_NettobitsPerFecframe(mod, innercoderate); var cells = DVBT2_Cells(fft, dvbt2_pp, dvbt2_trpapr); var c_p2 = cells[0]; var n_p2 = cells[1]; var c_data = cells[2]; var n_fc = cells[3]; var framclosing_used = (0 != n_fc); lf = Math.floor(lf * bw_mhz / 8); /* see chapter 8.3.1 */ if (0 == lf || 0 == c_p2 || 0 == c_data || 0 == n_p2) { ; } else { var end_lf = Math.floor(lf * 1/2); var max_lf = lf; var max_netto = 0; var start_lf = -1; var start_netto = 0; var netto = 0; /* see DVB-T2 implementation guidelines, page 50/51 */ /* we have to find the maximum data rate by decreasing lf by one each loop */ for (; lf >= end_lf && lf >= 1; lf -= 1) { if ((fft=="32k" || fft=="32kext") && 0 != (lf % 2)) { /* chapter 5.5 */ continue; } var l_data = lf - n_p2; var k_post_ex_pad = 102 + 79 + 32; var n_post_fec_block = Math.ceil(k_post_ex_pad / 7032); var k_sig = Math.ceil(k_post_ex_pad / n_post_fec_block); var n_post_temp = k_sig + 9168 - Math.floor(6*(7032-k_sig)/5); var d_l1_pre = 1840; var f = (n_p2 == 1 ? 2 : n_p2); var d_l1_post = f * n_post_fec_block * Math.ceil(n_post_temp / (f*DVBX_bitspersymbol(mod)) ); var d_l1 = d_l1_pre + d_l1_post; var c_total = 0; if (framclosing_used) { c_total = n_p2 * c_p2 + (l_data-1) * c_data + n_fc; } else { c_total = n_p2 * c_p2 + l_data * c_data; } var d_plp = c_total - d_l1; var n_b_max = Math.floor(d_plp / DVBT2_Ncells(mod)); var T = (t_p1 + lf * (t_usesymbol + t_guard)); netto = 188 * n_b_max * nettobits_per_fecframe / (187*T); // netto_info = "" + nettobits_per_fecframe + "/"+c_p2 + "/"+n_p2 + "/"+c_data + "/"+n_fc+":"+ // c_total+ "/"+d_plp+ "/"+n_b_max+ "/"+T; if (start_lf < 0) { start_netto = netto start_lf = lf; } if (netto > max_netto) { max_netto = netto max_lf = lf; } //netto_info = netto_info + ", " + lf; } data_netto = max_netto; data_brutto = data_netto * 64800 / nettobits_per_fecframe; end_netto = netto; end_lf = (lf+1); netto_info = "" + roundto(end_netto/1e6, 3) + "..." + roundto(start_netto/1e6, 3)+" Mbit/s " + "(" + end_lf + "..." + start_lf + " Symbols/Frame), "+ "Maximum was found at " + max_lf + " Symbols/Frame"; } } if (isNaN(data_netto) || data_netto <= 1000) { return DATA; } var guardint_as_dist = roundto(t_guard * global_constant_c0 / 1000, 1); var cnratio_db = DVBx_CNratio(system, bw_mhz, fft, mod, innercoderate, dvbh_mpe, dvbt2_pp, dvbt2_trpapr); var maxspeeds = calc_maxspeed(system, fft, 1/t_usesymbol); var receptioncond = DVBx_receptiondist(cnratio_db, rf_bw); var nettopo = getNetworkConfiguration(system, mod, innercoderate, innercoderate_lp, guardint_as_dist); var pref_rec = getReception(system, mod, innercoderate, innercoderate_lp, dvbh_mpe, maxspeeds); /* output */ DATA["T_SYMBOL"] = "" + roundto(t_usesymbol * 1e6, 1) + " µs"; DATA["T_GUARD"] = "" + roundto(t_guard * 1e6, 1) + " µs"; DATA["TX_DIST"] = "" + guardint_as_dist + " km"; DATA["F_BWRF"] = "" + roundto(rf_bw / 1e6, 3) + " MHz"; DATA["F_CARRIER"] = "" + roundto(1/(1000*t_usesymbol), 3) + " kHz"; DATA["MAXSPEED"] = getSpeedInfo(maxspeeds); DATA["R_SYMBOLS"] = "" + roundto(global_symbolrate / 1e6, 3) + " Msym/s";; DATA["R_BRUTTO"] = "" + roundto(data_brutto/1e6,3) + " Mbit/s"; DATA["R_NETTO"] = "" + roundto(data_netto/1e6, 3) + " Mbit/s"; DATA["R_NETTO_INFO"] = netto_info; DATA["TXT_CAPACITY"] = getCapacityInfo(data_netto); DATA["TXT_NETTOPO"] = "" + nettopo; DATA["TXT_RECPT"] = "" + pref_rec; if (isNaN(cnratio_db[0])) { DATA["TXT_CN"] = "not implemented, yet"; DATA["TXT_COVINFO"] = "not implemented, yet"; } else { DATA["TXT_CN"] = "" + roundto(cnratio_db[2],1) + "dB" + String.fromCharCode(160) + "/ " + roundto(cnratio_db[1],1) + "dB" + String.fromCharCode(160) + "/ " + roundto(cnratio_db[0],1) + "dB"; for (var i=0; i<12; ++i) { var emin = receptioncond[i][0]; var dist = receptioncond[i][1]; var ch = ""; if (dist<10.0) {ch = "<"; dist = 10.0; } if (dist>100.0){ch = ">"; dist = 100.0;} DATA["TXT_MINFS_"+(i+1)] = roundto(emin,1) + "dBµV/m" + String.fromCharCode(160) + "/" + String.fromCharCode(160) + ch + roundto(dist,1) + "km"; } if (cnratio_db.length > 3) { DATA["TXT_COVINFO"] = "Note: values for HP stream only (alpha=2)"; } } DATA["OK"] = 1; return DATA; } /**********************************************************************/ function calculate() { var data_brutto = 0; var data_netto = 0; var data_netto_hp = 0; var data_netto_lp = 0; /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - the following values are obtained directly from form: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ var system = document.dvbform.system.value; var bw_mhz = eval(document.dvbform.channelbw_mhz.value); var fft = document.dvbform.fftmode.value; var guard = document.dvbform.guardfraction.value; var mod = document.dvbform.mod.value; var innercoderate = document.dvbform.coderate.value; var innercoderate_lp = document.dvbform.coderate_lp.value; var dvbh_mpe = (document.dvbform.r_mpe.checked == true ? 1 : 0); var dvbt2_pp = document.dvbform.dvbt2_pp.value; var dvbt2_trpapr = (document.dvbform.r_papr.checked == true ? 1 : 0); update_form(system, mod); /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - calculate some values from the settings and take them: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ var DATA = calcDATA(system, bw_mhz, fft, guard, mod, innercoderate, innercoderate_lp, dvbh_mpe, dvbt2_pp, dvbt2_trpapr); var isOK = (0 != DATA["OK"]); /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - output - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ if (isOK) { document.getElementById("tuseable2").firstChild.data = DATA["T_SYMBOL"]; document.getElementById("tguard2").firstChild.data = DATA["T_GUARD"]; document.getElementById("tguard2distance2").firstChild.data = DATA["TX_DIST"]; document.getElementById("bwhf2").firstChild.data = DATA["F_BWRF"]; document.getElementById("txc2").firstChild.data = DATA["F_CARRIER"]; document.getElementById("maxspeed").replaceChild(DATA["MAXSPEED"], document.getElementById("maxspeed").firstChild); document.getElementById("symrate2").firstChild.data = DATA["R_SYMBOLS"]; document.getElementById("useablerate2").firstChild.data = DATA["R_NETTO"]; document.getElementById("useablerate2info").firstChild.data = DATA["R_NETTO_INFO"]; document.getElementById("bruttorate2").firstChild.data = DATA["R_BRUTTO"]; document.getElementById("pxcapacity").replaceChild(DATA["TXT_CAPACITY"], document.getElementById("pxcapacity").firstChild); document.getElementById("networktopo").firstChild.data = DATA["TXT_NETTOPO"]; document.getElementById("reception").firstChild.data = DATA["TXT_RECPT"]; document.getElementById("cnr").firstChild.data = DATA["TXT_CN"]; for (var i=0; i<12; ++i) { document.getElementById("cov"+(i+1)).firstChild.data = DATA["TXT_MINFS_"+(i+1)]; } document.getElementById("cov_info").firstChild.data = DATA["TXT_COVINFO"]; } else { document.getElementById("tuseable2").firstChild.data = String.fromCharCode(160); document.getElementById("tguard2").firstChild.data = String.fromCharCode(160); document.getElementById("tguard2distance2").firstChild.data = String.fromCharCode(160); document.getElementById("bwhf2").firstChild.data = String.fromCharCode(160); document.getElementById("maxspeed").replaceChild(document.createTextNode(""), document.getElementById("maxspeed").firstChild); document.getElementById("symrate2").firstChild.data = String.fromCharCode(160); document.getElementById("bruttorate2").firstChild.data = "Unsupported parameter combination!"; document.getElementById("useablerate2").firstChild.data= "Select another combination!"; document.getElementById("useablerate2info").firstChild.data = String.fromCharCode(160); document.getElementById("txc2").firstChild.data = String.fromCharCode(160); document.getElementById("pxcapacity").replaceChild(document.createTextNode(""), document.getElementById("pxcapacity").firstChild); document.getElementById("networktopo").firstChild.data = String.fromCharCode(160); document.getElementById("reception").firstChild.data = String.fromCharCode(160); document.getElementById("cnr").firstChild.data = String.fromCharCode(160); for (var i=0; i<12; ++i) { document.getElementById("cov"+(i+1)).firstChild.data = String.fromCharCode(160); } document.getElementById("cov_info").firstChild.data = String.fromCharCode(160); } }