esc to close

Wi-Fi Channel Explorer

Search, analyze, and visualize Wi-Fi channels across 2.4 GHz, 5 GHz, and 6 GHz. Find channels by number or frequency in different notations and view bandwidths from 20 to 320 MHz.

Quick Search Help

Search channels in multiple ways:

  • Basic channels: Enter the channel number (e.g., "36" or "1")
  • Bonded channels: Enter the full notation (e.g., "42[36]" or "1+5")
  • Center channels: Enter only the center channel (e.g., "42")
  • Primary channels: Add brackets to search by primary channel (e.g., "[36]")
Wi-Fi Channels
Channel Bandwidth Frequency Note

Channel Visualization

Wi-Fi Bands & Channels

Frequency Bands

  • 2.4 GHz Band (802.11b/g/n): Heavily used, higher interference, better wall penetration.
  • 5 GHz Band (802.11a/n/ac/ax): Less interference, higher data rates, lower range through walls.
  • 6 GHz Band (802.11ax/be): Introduced with Wi-Fi 6E, less congested, high speeds, short range.

Channel Naming & Notation

  • 2.4 GHz band: Bonded channels named by combining primary and secondary channels (e.g., "1+5")
  • 5 GHz & 6 GHz bands: Bonded channels named by center frequency and primary channel (e.g., "42[36]")
  • Alternative notation (e.g., "36+40") shown when hovering over bonded channels
  • Primary channel determines the control channel for management frames
Technical Information
  • Channel Bandwidth: Wider channels (40/80/160/320 MHz) provide higher data rates but are more susceptible to interference.
  • DFS (Dynamic Frequency Selection): Detects radar and automatically changes channel when needed.
  • TPC (Transmit Power Control): Automatic adjustment of transmission power.
  • BFWA (Broadband Fixed Wireless Access): Channels outside standard U-NII bands, typically used for licensed or coordinated point-to-point links (e.g., Channel 169 at 5845 MHz).
  • Regional Restrictions: Different regions (EU, US, etc.) allow different channels, especially in 6 GHz band.
  • Wi-Fi 7 Features: Support for 320 MHz channels in 6 GHz band, providing extremely high throughput.

`); printWindow.document.close(); } // Update the band info function updateBandInfo() { const bandInfoText = getBandInfo(aktuellesBand); calculatorForm.bandInfo.textContent = bandInfoText; calculatorForm.bandInfo.style.display = bandInfoText ? 'block' : 'none'; } // Update the bandwidth info function updateBandbreiteInfo() { const bandbreiteInfoText = getBandbreiteInfo(aktuelleBandbreite); calculatorForm.bandbreiteInfo.textContent = bandbreiteInfoText; calculatorForm.bandbreiteInfo.style.display = bandbreiteInfoText ? 'block' : 'none'; } // Update the frequency field depending on band function updateFrequenzFeld() { const anzeigeband = aktuellesBand === 'auto' ? (aktuellesSuchergebnis ? aktuellesSuchergebnis.band : '2.4GHz') : aktuellesBand; calculatorForm.frequenzLabel.textContent = `Frequency:`; // Update placeholder based on selected unit updateFrequenzPlaceholder(); // Set appropriate unit for the band updateFrequenzEinheit(); } // Update frequency placeholder based on selected unit and band function updateFrequenzPlaceholder() { const anzeigeband = aktuellesBand === 'auto' ? (aktuellesSuchergebnis ? aktuellesSuchergebnis.band : '2.4GHz') : aktuellesBand; const unit = calculatorForm.frequenzUnit.value; if (unit === 'GHz') { /* 60GHz-Bedingung auskommentiert if (anzeigeband === '60GHz') { calculatorForm.frequenz.placeholder = "e.g. 60.48 or 58.32"; } else */ if (anzeigeband === '6GHz') { calculatorForm.frequenz.placeholder = "e.g. 5.955 or 6.105"; } else if (anzeigeband.startsWith('5GHz')) { calculatorForm.frequenz.placeholder = "e.g. 5.18 or 5.5"; } else { calculatorForm.frequenz.placeholder = "e.g. 2.412 or 2.462"; } } else { /* 60GHz-Bedingung auskommentiert if (anzeigeband === '60GHz') { calculatorForm.frequenz.placeholder = "e.g. 60480 or 58320"; } else { */ calculatorForm.frequenz.placeholder = "e.g. 2412 or 5180"; /* Schließende Klammer auskommentiert } */ } } // Set appropriate frequency unit based on band function updateFrequenzEinheit() { const anzeigeband = aktuellesBand === 'auto' ? (aktuellesSuchergebnis ? aktuellesSuchergebnis.band : '2.4GHz') : aktuellesBand; // Auto-select GHz for 60GHz band, MHz for others /* 60GHz-Bedingung auskommentiert if (anzeigeband === '60GHz' && calculatorForm.frequenzUnit.value !== 'GHz') { calculatorForm.frequenzUnit.value = 'GHz'; } else */ if (calculatorForm.frequenzUnit.value === '') { calculatorForm.frequenzUnit.value = 'MHz'; } updateFrequenzPlaceholder(); } // Handle frequency unit change function handleFrequenzUnitChange() { updateFrequenzPlaceholder(); // If there's a value in the frequency field, convert it if (calculatorForm.frequenz.value) { const oldUnit = calculatorForm.frequenzUnit.value === 'MHz' ? 'GHz' : 'MHz'; const oldValue = parseFloat(calculatorForm.frequenz.value); if (!isNaN(oldValue)) { let newValue; if (oldUnit === 'GHz' && calculatorForm.frequenzUnit.value === 'MHz') { // Convert from GHz to MHz newValue = (oldValue * 1000).toFixed(0); } else if (oldUnit === 'MHz' && calculatorForm.frequenzUnit.value === 'GHz') { // Convert from MHz to GHz newValue = (oldValue / 1000).toFixed(3); // Remove trailing zeros newValue = newValue.replace(/\.?0+$/, ''); } calculatorForm.frequenz.value = newValue; } } } // Show or hide error function setzeError(inputElement, errorElement, message) { const inputContainer = inputElement.parentElement; if (message) { inputContainer.classList.add('error'); errorElement.style.display = 'block'; errorElement.textContent = message; } else { inputContainer.classList.remove('error'); errorElement.style.display = 'none'; } } // Combined function for band information function getBandInfo(bandName) { switch (bandName) { case 'auto': return 'The band selection is done automatically based on the entered frequency or channel number.'; case '2.4GHz': return 'Max. 100mW (20dBm). Very congested band, recommended channels: 1, 6, 11 (non-overlapping) for 20 MHz or 1+5 (bonded) for 40 MHz.'; case '5GHz-U-NII-1': return 'Indoor use only. No DFS/TPC required. Max. 200mW (23dBm). Frequency range: 5150-5250 MHz.'; case '5GHz-U-NII-2': return 'Indoor use only. DFS/TPC required (radar detection). Max. 200mW (23dBm). Frequency range: 5250-5350 MHz.'; case '5GHz-U-NII-2E': return 'Outdoor allowed. DFS/TPC required (radar detection). Max. 1000mW (30dBm). Frequency range: 5470-5725 MHz.'; case '5GHz-BFWA': return 'Outdoor allowed. DFS/TPC required (no DFS from 5850MHz). Max. 4W (36dBm). Only for registered commercial users! Frequency range: 5725-5875 MHz.'; case '6GHz': return 'New band for Wi-Fi 6E and Wi-Fi 7. Currently regulated differently in each region. Very high data rates, limited range, low interference.'; /* 60GHz-Fall auskommentiert case '60GHz': return 'Indoor and outdoor allowed. Max. 10W, with >30dBi antenna gain up to 316W (only outdoor fixed installations). Multi-gigabit speeds. Frequency range: 57-71 GHz.'; */ default: return ''; } } // Combined function for bandwidth information function getBandbreiteInfo(bandbreite) { switch (bandbreite) { case 'all': return 'Showing all available channel bandwidths.'; case '20': return 'Standard channel width for legacy networks. Compatible with all Wi-Fi devices.'; case '40': return 'Introduced with 802.11n. Doubles throughput compared to 20 MHz.'; case '80': return 'Introduced with 802.11ac. High throughput, but limited number of non-overlapping channels.'; case '160': return 'Maximum channel width for 802.11ac/ax. Very high throughput, very limited number of channels.'; case '320': return 'New for Wi-Fi 7 (802.11be). Ultra high throughput, available only in 6 GHz band.'; /* 60GHz-Bandbreiten auskommentiert case '2160': return 'Standard channel width for 802.11ad in 60 GHz band. Multi-gigabit speeds.'; case '4320': return 'Channel bonding for 802.11ay in 60 GHz band. Even higher speeds.'; case '6480': return 'Triple channel bonding for 802.11ay in 60 GHz band.'; case '8640': return 'Quadruple channel bonding for 802.11ay in 60 GHz band. Maximum throughput.'; */ default: return ''; } } // Combined function for channel notes function getKanalHinweis(band, kanalNum, bandbreite) { // 2.4 GHz Band if (band === '2.4GHz') { if (typeof kanalNum === 'string' && kanalNum.includes('+')) { // Notes for 40 MHz channels const kanalTeile = kanalNum.split('+'); if (kanalTeile[0] === '1' || kanalTeile[0] === '2' || kanalTeile[0] === '3') { return 'Recommended bonded channel for less interference'; } else if (kanalTeile[0] === '7' || kanalTeile[0] === '8' || kanalTeile[0] === '9') { return 'May cause interference with neighboring networks'; } return '40 MHz channel (two 20 MHz channels combined)'; } else { // Notes for 20 MHz channels if (kanalNum === 1 || kanalNum === 6 || kanalNum === 11) { return 'Recommended non-overlapping channel'; } else if (kanalNum === 9) { return 'Most microwave ovens operate at 2,455 GHz and can interfere with this channel!'; } else if (kanalNum === 12 || kanalNum === 13) { return 'Only allowed in the EU'; } else if (kanalNum === 14) { return 'Only allowed in Japan'; } } } // 5 GHz U-NII-1 Band else if (band === '5GHz-U-NII-1') { if (bandbreite === '20') { return 'Indoor use only, no DFS required'; } else if (bandbreite === '40') { return 'Indoor use only, 40 MHz channel bonding (two 20 MHz channels)'; } else if (bandbreite === '80') { return 'Indoor use only, 80 MHz channel bonding (four 20 MHz channels)'; } else if (bandbreite === '160') { return 'Indoor use only, 160 MHz channel bonding (eight 20 MHz channels), spans U-NII-1 and U-NII-2'; } } // 5 GHz U-NII-2 Band else if (band === '5GHz-U-NII-2') { const dfsHinweis = 'DFS and TPC required. Weather radar detection.'; if (bandbreite === '20') { return dfsHinweis; } else if (bandbreite === '40') { return dfsHinweis + ' 40 MHz channel bonding (two 20 MHz channels).'; } else if (bandbreite === '80') { return dfsHinweis + ' 80 MHz channel bonding (four 20 MHz channels).'; } } // 5 GHz U-NII-2E Band else if (band === '5GHz-U-NII-2E') { let basisHinweis = 'DFS and TPC required. '; // Special notes for certain channels if (kanalNum === 120 || kanalNum === 124 || kanalNum === 128 || (typeof kanalNum === 'string' && kanalNum.includes('120'))) { basisHinweis += 'Radar area. '; } else if (kanalNum === 116 || kanalNum === 132 || (typeof kanalNum === 'string' && (kanalNum.includes('116') || kanalNum.includes('132')))) { basisHinweis += 'Radar edge area. '; } // Bandwidth notes if (bandbreite === '40') { basisHinweis += '40 MHz channel bonding (two 20 MHz channels).'; } else if (bandbreite === '80') { basisHinweis += '80 MHz channel bonding (four 20 MHz channels).'; } else if (bandbreite === '160') { basisHinweis += '160 MHz channel bonding (eight 20 MHz channels).'; } return basisHinweis; } // 5 GHz BFWA Band else if (band === '5GHz-BFWA') { let hinweis = ''; // No DFS required from 5850MHz if (kanalNum === 169 || kanalNum === 173 || (typeof kanalNum === 'string' && kanalNum.includes('169'))) { hinweis = 'No DFS required from 5850MHz. '; } else { hinweis = 'DFS/TPC required. '; } // Note on commercial use hinweis += 'Only for registered commercial users! '; // Bandwidth notes if (bandbreite === '40') { hinweis += '40 MHz channel bonding (two 20 MHz channels).'; } else if (bandbreite === '80') { hinweis += '80 MHz channel bonding (four 20 MHz channels).'; } return hinweis; } // 6 GHz Band else if (band === '6GHz') { let hinweis = 'Wi-Fi 6E/7 only. '; // Check if this is a Wi-Fi 7 channel (320 MHz) if (bandbreite === '320') { hinweis = 'Wi-Fi 7 only. Ultra-high throughput. '; // Add regional restrictions if (kanalNum === '31[1]' || kanalNum === '63[33]' || kanalNum === '95[63]' || (typeof kanalNum === 'string' && (kanalNum.includes('1-61') || kanalNum.includes('33-93') || kanalNum.includes('63-127')))) { hinweis += 'Available in US, not in EU. '; } } else { // Add regional restrictions for other bandwidths if (parseInt(bandbreite) >= 160) { if (kanalNum === '15[1]' || kanalNum === '1-29') { hinweis += 'Available in both US and EU. '; } else { hinweis += 'Available in US, not in EU. '; } } } // Bandwidth specific notes if (bandbreite === '40') { hinweis += '40 MHz channel bonding (two 20 MHz channels).'; } else if (bandbreite === '80') { hinweis += '80 MHz channel bonding (four 20 MHz channels).'; } else if (bandbreite === '160') { hinweis += '160 MHz channel bonding (eight 20 MHz channels).'; } else if (bandbreite === '320') { hinweis += '320 MHz channel bonding (sixteen 20 MHz channels).'; } return hinweis; } /* 60GHz-Bedingung auskommentiert // 60 GHz Band else if (band === '60GHz') { let hinweis = 'Ultra-short range. Line-of-sight required. '; // Bandwidth notes if (bandbreite === '2160') { hinweis += 'Standard 802.11ad channel.'; } else if (bandbreite === '4320') { hinweis += 'Bonded 802.11ay channel (2x 2160 MHz).'; } else if (bandbreite === '6480') { hinweis += 'Bonded 802.11ay channel (3x 2160 MHz).'; } else if (bandbreite === '8640') { hinweis += 'Bonded 802.11ay channel (4x 2160 MHz).'; } return hinweis; } */ return null; } // Show the search result function zeigeErgebnis(ergebnis) { if (!ergebnis) { calculatorForm.suchergebnis.style.display = 'none'; return; } calculatorForm.suchergebnis.style.display = 'block'; // Show main result calculatorForm.ergebnisBand.textContent = ergebnis.band; calculatorForm.ergebnisKanal.textContent = ergebnis.kanal; // Show bandwidth const bandbreitenText = ergebnis.band === '60GHz' ? `${(ergebnis.bandbreite / 1000).toFixed(2)} GHz` : `${ergebnis.bandbreite} MHz`; calculatorForm.ergebnisBandbreite.textContent = bandbreitenText; // Format frequency based on user's selected unit const unit = calculatorForm.frequenzUnit.value; if (unit === 'GHz') { calculatorForm.ergebnisFrequenz.textContent = `${(ergebnis.exakteFrequenz / 1000).toFixed(3).replace(/\.?0+$/, '')} GHz`; } else { calculatorForm.ergebnisFrequenz.textContent = `${ergebnis.exakteFrequenz} MHz`; } // Show note if available const hinweis = getKanalHinweis(ergebnis.band, ergebnis.kanal, ergebnis.bandbreite.toString()); if (hinweis) { calculatorForm.hinweisText.textContent = hinweis; calculatorForm.ergebnisHinweis.style.display = 'block'; } else { calculatorForm.ergebnisHinweis.style.display = 'none'; } // Show other matches if available if (ergebnis.alleErgebnisse && ergebnis.alleErgebnisse.length > 1) { calculatorForm.weitereTreeffer.style.display = 'block'; // Clear list calculatorForm.trefferListe.innerHTML = ''; // Add other matches (from the second match) ergebnis.alleErgebnisse.slice(1).forEach(treffer => { const listItem = document.createElement('li'); const bandbreitenText = treffer.band === '60GHz' ? `${(treffer.bandbreite / 1000).toFixed(2)} GHz` : `${treffer.bandbreite} MHz`; listItem.textContent = `Band: ${treffer.band}, Channel: ${treffer.kanal}, Bandwidth: ${bandbreitenText}, Frequency: ${ treffer.band === '60GHz' ? `${(treffer.frequenz / 1000).toFixed(2)} GHz` : `${treffer.frequenz} MHz` }`; calculatorForm.trefferListe.appendChild(listItem); }); } else { calculatorForm.weitereTreeffer.style.display = 'none'; } // Update visualization if on visualization tab if (document.getElementById('visualization-tab').classList.contains('active')) { renderChannelVisualization(); } } // Render the channel table function renderKanalTabelle() { // Determine current band const anzeigeband = aktuellesBand === 'auto' ? (aktuellesSuchergebnis ? aktuellesSuchergebnis.band : '2.4GHz') : aktuellesBand; // Determine channels to display based on bandwidth and band let anzuzeigende_kanäle = []; // Get all available bandwidths for the current band const verfügbareBandbreiten = Object.keys(kanalDaten[anzeigeband]); if (aktuelleBandbreite === 'all') { // Show all bandwidths verfügbareBandbreiten.forEach(bandbreite => { kanalDaten[anzeigeband][bandbreite].forEach(kanal => { anzuzeigende_kanäle.push({ ...kanal, bandbreite: parseInt(bandbreite) }); }); }); } else { // Show only specific bandwidth const bandbreitenKey = `${aktuelleBandbreite}MHz`; if (kanalDaten[anzeigeband][bandbreitenKey]) { anzuzeigende_kanäle = kanalDaten[anzeigeband][bandbreitenKey].map(kanal => ({ ...kanal, bandbreite: parseInt(aktuelleBandbreite) })); } } // Clear table calculatorForm.kanalTabelle.innerHTML = ''; // If no channels to display if (anzuzeigende_kanäle.length === 0) { const row = document.createElement('tr'); const cell = document.createElement('td'); cell.colSpan = 4; cell.textContent = 'No channels available for this bandwidth in the selected band.'; cell.style.textAlign = 'center'; row.appendChild(cell); calculatorForm.kanalTabelle.appendChild(row); return; } // Sort channels by number anzuzeigende_kanäle.sort((a, b) => { // Primary by bandwidth (larger first) const bandbreitenDiff = b.bandbreite - a.bandbreite; if (bandbreitenDiff !== 0) return bandbreitenDiff; // Secondary by channel number (numeric or string) if (typeof a.kanal === 'number' && typeof b.kanal === 'number') { return a.kanal - b.kanal; } else if (typeof a.kanal === 'string' && typeof b.kanal === 'string') { // Extract first number from string (e.g. "36+40" -> 36) const aNum = parseInt(a.kanal.split(/[+\-]/)[0]); const bNum = parseInt(b.kanal.split(/[+\-]/)[0]); return aNum - bNum; } else { // Mixed types, number before string return typeof a.kanal === 'number' ? -1 : 1; } }); // Add channels anzuzeigende_kanäle.forEach(kanal => { const row = document.createElement('tr'); // Highlight selected channel if (aktuellesSuchergebnis && aktuellesSuchergebnis.band === anzeigeband && aktuellesSuchergebnis.kanal.toString() === kanal.kanal.toString() && aktuellesSuchergebnis.bandbreite === kanal.bandbreite) { row.classList.add('highlight'); } // Add Wi-Fi 7 class if applicable if (kanal.wifi7) { row.classList.add('wifi7-channel'); } // Channel const kanalCell = document.createElement('td'); kanalCell.textContent = kanal.kanal; // Add tooltip for alternative notation if available if (kanal.altNotation) { kanalCell.title = `Alternative notation: ${kanal.altNotation}`; kanalCell.style.cursor = 'help'; } row.appendChild(kanalCell); // Bandwidth const bandbreiteCell = document.createElement('td'); if (anzeigeband === '60GHz') { bandbreiteCell.textContent = `${(kanal.bandbreite / 1000).toFixed(2)} GHz`; } else { bandbreiteCell.textContent = `${kanal.bandbreite} MHz`; } // Add Wi-Fi 7 badge for 320 MHz if (kanal.bandbreite === 320) { const badge = document.createElement('span'); badge.textContent = ' (Wi-Fi 7)'; badge.style.color = 'var(--wifi7-color)'; badge.style.fontSize = '0.9em'; bandbreiteCell.appendChild(badge); } row.appendChild(bandbreiteCell); // Frequency const frequenzCell = document.createElement('td'); const unit = calculatorForm.frequenzUnit.value; if (unit === 'GHz') { frequenzCell.textContent = `${(kanal.frequenz / 1000).toFixed(3).replace(/\.?0+$/, '')} GHz`; } else { frequenzCell.textContent = `${kanal.frequenz} MHz`; } row.appendChild(frequenzCell); // Note const hinweisCell = document.createElement('td'); const hinweis = getKanalHinweis(anzeigeband, kanal.kanal, kanal.bandbreite.toString()); hinweisCell.textContent = hinweis || '-'; row.appendChild(hinweisCell); calculatorForm.kanalTabelle.appendChild(row); }); } // Search for channels based on frequency function sucheKanalPerFrequenz(freq) { if (!freq) { aktuellesSuchergebnis = null; zeigeErgebnis(null); return; } // Convert input to MHz let frequenzNum; const unit = calculatorForm.frequenzUnit.value; if (unit === 'GHz') { // GHz format (e.g. 5.18 or 60.48) - convert to MHz frequenzNum = Math.round(parseFloat(freq) * 1000); } else { // MHz format (e.g. 5180 or 2412) frequenzNum = parseInt(freq, 10); } if (isNaN(frequenzNum)) { setzeError(calculatorForm.frequenz, calculatorForm.frequenzError, `Please enter a valid frequency in ${unit}`); aktuellesSuchergebnis = null; zeigeErgebnis(null); return; } // Automatically determine band and update UI let gefundenesBand = bestimmeBandAusFrequenz(frequenzNum); // Update band dropdown aktuellesBand = gefundenesBand; calculatorForm.band.value = aktuellesBand; updateBandInfo(); updateFrequenzFeld(); // Update bandwidth dropdown aktualisiereBandbreitenDropdown(); // Search for matching channel let allesuchErgebnisse = sucheKanalInAllenBändern(frequenzNum, gefundenesBand); if (allesuchErgebnisse.length > 0) { const gefundenerKanal = allesuchErgebnisse[0]; // Update bandwidth if (aktuelleBandbreite === 'all' || aktuelleBandbreite !== gefundenerKanal.bandbreite.toString()) { aktuelleBandbreite = gefundenerKanal.bandbreite.toString(); calculatorForm.bandbreite.value = aktuelleBandbreite; updateBandbreiteInfo(); } // Update channel field calculatorForm.kanal.value = gefundenerKanal.kanal; // Save search result aktuellesSuchergebnis = { exakteFrequenz: gefundenerKanal.frequenz, kanal: gefundenerKanal.kanal, band: gefundenerKanal.band, bandbreite: gefundenerKanal.bandbreite, alleErgebnisse: allesuchErgebnisse.slice(0, 5), // Top 5 matches wifi7: gefundenerKanal.wifi7, altNotation: gefundenerKanal.altNotation }; // Show result zeigeErgebnis(aktuellesSuchergebnis); renderKanalTabelle(); } else { setzeError(calculatorForm.frequenz, calculatorForm.frequenzError, `No matching channels found for frequency ${freq} ${unit}`); aktuellesSuchergebnis = null; zeigeErgebnis(null); } } // Function to determine band from frequency function bestimmeBandAusFrequenz(frequenzNum) { if (frequenzNum >= 2400 && frequenzNum < 2500) { return '2.4GHz'; } else if (frequenzNum >= 5150 && frequenzNum < 5250) { return '5GHz-U-NII-1'; } else if (frequenzNum >= 5250 && frequenzNum < 5350) { return '5GHz-U-NII-2'; } else if (frequenzNum >= 5470 && frequenzNum < 5725) { return '5GHz-U-NII-2E'; } else if (frequenzNum >= 5725 && frequenzNum < 5875) { return '5GHz-BFWA'; } else if (frequenzNum >= 5925 && frequenzNum < 7125) { return '6GHz'; } /* 60GHz-Bedingung auskommentiert else if (frequenzNum >= 57000 && frequenzNum < 71000) { return '60GHz'; } */ return 'auto'; } // Function to search channels in all bands function sucheKanalInAllenBändern(frequenzNum, gefundenesBand) { const toleranz = 10; // Tolerance in MHz let allesuchErgebnisse = []; // Determine which bands to search const suchBänder = gefundenesBand !== 'auto' ? [gefundenesBand] : Object.keys(kanalDaten); suchBänder.forEach(bandName => { Object.keys(kanalDaten[bandName]).forEach(bandbreite => { // Skip if specific bandwidth is chosen and not this one if (aktuelleBandbreite !== 'all' && parseInt(aktuelleBandbreite) !== parseInt(bandbreite)) { return; } const kanäle = kanalDaten[bandName][bandbreite]; kanäle.forEach(kanal => { const abweichung = Math.abs(kanal.frequenz - frequenzNum); if (abweichung <= toleranz) { allesuchErgebnisse.push({ band: bandName, kanal: kanal.kanal, frequenz: kanal.frequenz, bandbreite: parseInt(bandbreite), abweichung: abweichung, wifi7: kanal.wifi7, altNotation: kanal.altNotation }); } }); }); }); // Sort by smallest deviation return allesuchErgebnisse.sort((a, b) => a.abweichung - b.abweichung); } // Event handler for frequency change function handleFrequenzChange(event) { const neuFrequenz = event.target.value; // Reset error field setzeError(calculatorForm.frequenz, calculatorForm.frequenzError, null); if (suchTimeout) { clearTimeout(suchTimeout); } if (neuFrequenz) { // Delayed call of the search function suchTimeout = setTimeout(() => { sucheKanalPerFrequenz(neuFrequenz); }, 500); } else { // Empty field, reset search result aktuellesSuchergebnis = null; zeigeErgebnis(null); renderKanalTabelle(); } } // Hilfsfunktion, um zu prüfen, ob ein Kanal mit der Suchanfrage übereinstimmt function matchesChannelSearch(kanalObj, suchKanal) { let matchPriority = 0; // Higher is better match // Exact string match (highest priority) if (kanalObj.kanal === suchKanal) { if (typeof suchKanal === 'string' && (suchKanal.includes('[') || suchKanal.includes('+'))) { return { match: true, priority: 4 }; // Exact notation match gets highest priority } return { match: true, priority: 3 }; // Exact match but not notation } // String in Zahl konvertieren, falls möglich const numSuchKanal = typeof suchKanal === 'string' ? parseInt(suchKanal, 10) : suchKanal; // Für numerische Suche (z.B. 47) in Mittenfrequenzformaten (z.B. "47[33]") if (!isNaN(numSuchKanal) && typeof kanalObj.kanal === 'string') { // Format "47[33]" - extrahiere Mittenfrequenz if (kanalObj.kanal.includes('[')) { const centerChannel = parseInt(kanalObj.kanal.split('[')[0], 10); if (centerChannel === numSuchKanal) { return { match: true, priority: 2 }; // Center channel match } } } // Suche nach Primärkanal mit []-Notation (z.B. "[36]") if (typeof suchKanal === 'string' && suchKanal.startsWith('[') && suchKanal.endsWith(']')) { const primaryChannelSearch = parseInt(suchKanal.replace(/[\[\]]/g, ''), 10); // Prüfe, ob das Objekt eine primärkanal-Eigenschaft hat if (kanalObj.primärkanal && kanalObj.primärkanal === primaryChannelSearch) { return { match: true, priority: 3 }; // Primary channel match with bracket notation } // Oder check im String-Format wie "47[36]" if (typeof kanalObj.kanal === 'string' && kanalObj.kanal.includes('[')) { const primaryChannelPart = kanalObj.kanal.split('[')[1].split(']')[0]; const primaryChannel = parseInt(primaryChannelPart, 10); if (primaryChannel === primaryChannelSearch) { return { match: true, priority: 3 }; // Primary channel match with bracket notation } } } return { match: false, priority: 0 }; } function sucheFrequenzPerKanal(kanalNum) { if (!kanalNum) { aktuellesSuchergebnis = null; zeigeErgebnis(null); return; } // Check for special notations first before trying to convert to number let suchKanal; if (typeof kanalNum === 'string' && (kanalNum.includes('+') || kanalNum.includes('['))) { // It's a special notation - keep as string suchKanal = kanalNum; } else { // Try to convert to number suchKanal = parseInt(kanalNum, 10); if (isNaN(suchKanal)) { suchKanal = kanalNum; } } // Check if it's a valid search if (typeof suchKanal === 'string' && !suchKanal.includes('[') && !suchKanal.includes('+') && isNaN(parseInt(suchKanal, 10))) { setzeError(calculatorForm.kanal, calculatorForm.kanalError, 'Please enter a valid channel number or format'); aktuellesSuchergebnis = null; zeigeErgebnis(null); return; } // Search in all bands for the channel let gefundeneKanäle = []; // First search in the current band if (aktuellesBand !== 'auto') { // Search in selected band Object.keys(kanalDaten[aktuellesBand]).forEach(bandbreite => { // Skip if specific bandwidth is chosen and not this one if (aktuelleBandbreite !== 'all' && parseInt(aktuelleBandbreite) !== parseInt(bandbreite)) { return; } const kanäle = kanalDaten[aktuellesBand][bandbreite]; kanäle.forEach(k => { const matchResult = matchesChannelSearch(k, suchKanal); if (matchResult.match) { gefundeneKanäle.push({ band: aktuellesBand, kanal: k.kanal, frequenz: k.frequenz, bandbreite: parseInt(bandbreite), abweichung: 0, wifi7: k.wifi7, altNotation: k.altNotation, priority: matchResult.priority }); } }); }); } // If nothing found in current band or "auto", search in all bands if (gefundeneKanäle.length === 0 || aktuellesBand === 'auto') { // Search in all bands Object.keys(kanalDaten).forEach(band => { if (band !== aktuellesBand || aktuellesBand === 'auto') { Object.keys(kanalDaten[band]).forEach(bandbreite => { // Skip if specific bandwidth is chosen and not this one if (aktuelleBandbreite !== 'all' && parseInt(aktuelleBandbreite) !== parseInt(bandbreite)) { return; } const kanäle = kanalDaten[band][bandbreite]; kanäle.forEach(k => { const matchResult = matchesChannelSearch(k, suchKanal); if (matchResult.match) { gefundeneKanäle.push({ band: band, kanal: k.kanal, frequenz: k.frequenz, bandbreite: parseInt(bandbreite), abweichung: 0, wifi7: k.wifi7, altNotation: k.altNotation, priority: matchResult.priority }); } }); }); } }); } // If at least one channel was found if (gefundeneKanäle.length > 0) { // Sort first by whether it matches the selected band, then by priority gefundeneKanäle.sort((a, b) => { // First sort by whether it matches the selected band (if not in auto mode) if (aktuellesBand !== 'auto') { if (a.band === aktuellesBand && b.band !== aktuellesBand) return -1; if (a.band !== aktuellesBand && b.band === aktuellesBand) return 1; } // Then sort by priority return b.priority - a.priority; }); const besterTreffer = gefundeneKanäle[0]; // Always update band to that of the found channel // This is the key change - update always, not just in auto mode aktuellesBand = besterTreffer.band; calculatorForm.band.value = aktuellesBand; updateBandInfo(); updateFrequenzFeld(); // Update bandwidth dropdown aktualisiereBandbreitenDropdown(); // Set bandwidth to match the found channel if (aktuelleBandbreite === 'all' || aktuelleBandbreite !== besterTreffer.bandbreite.toString()) { aktuelleBandbreite = besterTreffer.bandbreite.toString(); calculatorForm.bandbreite.value = aktuelleBandbreite; updateBandbreiteInfo(); } // Update frequency field based on the selected unit const unit = calculatorForm.frequenzUnit.value; if (unit === 'GHz') { calculatorForm.frequenz.value = (besterTreffer.frequenz / 1000).toFixed(3).replace(/\.?0+$/, ''); } else { calculatorForm.frequenz.value = besterTreffer.frequenz; } // Save search result aktuellesSuchergebnis = { exakteFrequenz: besterTreffer.frequenz, kanal: besterTreffer.kanal, band: besterTreffer.band, bandbreite: besterTreffer.bandbreite, alleErgebnisse: gefundeneKanäle, wifi7: besterTreffer.wifi7, altNotation: besterTreffer.altNotation }; // Show result zeigeErgebnis(aktuellesSuchergebnis); renderKanalTabelle(); } else { setzeError(calculatorForm.kanal, calculatorForm.kanalError, `Channel ${kanalNum} was not found in any frequency band with the selected bandwidth`); aktuellesSuchergebnis = null; zeigeErgebnis(null); } } // Tab-Funktionalität function setupTabs() { const tabButtons = document.querySelectorAll('.tab-button'); tabButtons.forEach(button => { button.addEventListener('click', () => { // Aktiven Tab deaktivieren const activeButton = document.querySelector('.tab-button.active'); const activeContent = document.querySelector('.tab-content.active'); if (activeButton) activeButton.classList.remove('active'); if (activeContent) activeContent.classList.remove('active'); // Neuen Tab aktivieren button.classList.add('active'); const tabId = button.getAttribute('data-tab'); const tabContent = document.getElementById(`${tabId}-tab`); if (tabContent) { tabContent.classList.add('active'); // Bei Wechsel zur Visualisierung aktualisieren if (tabId === 'visualization') { renderChannelVisualization(); } } }); }); } // Initialize the app init(); });

Loading Page Rating...
ILAC-MRA DAkkS-01 ILAC-MRA DAkkS-01