{"id":30174201,"url":"https://github.com/kmoraza/spectrum_analyzer_software","last_synced_at":"2025-08-12T00:44:23.996Z","repository":{"id":293258141,"uuid":"983452404","full_name":"KMORaza/Spectrum_Analyzer_Software","owner":"KMORaza","description":"Spektrumanalysator-Software (Spectrum Analyzer Software)","archived":false,"fork":false,"pushed_at":"2025-05-14T12:34:26.000Z","size":1603,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-14T13:33:07.086Z","etag":null,"topics":["electrical-engineering","electronics-engineering","engineering","engineering-sim","mathematics","physics","physics-simul","simulation","simulations","simulator","simulators","spectrum","spectrum-analysis","spectrum-analyzer"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KMORaza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-14T12:02:08.000Z","updated_at":"2025-05-14T12:34:29.000Z","dependencies_parsed_at":"2025-05-20T18:01:32.833Z","dependency_job_id":null,"html_url":"https://github.com/KMORaza/Spectrum_Analyzer_Software","commit_stats":null,"previous_names":["kmoraza/spectrum_analyzer_software"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KMORaza/Spectrum_Analyzer_Software","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KMORaza%2FSpectrum_Analyzer_Software","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KMORaza%2FSpectrum_Analyzer_Software/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KMORaza%2FSpectrum_Analyzer_Software/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KMORaza%2FSpectrum_Analyzer_Software/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KMORaza","download_url":"https://codeload.github.com/KMORaza/Spectrum_Analyzer_Software/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KMORaza%2FSpectrum_Analyzer_Software/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269981695,"owners_count":24507281,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["electrical-engineering","electronics-engineering","engineering","engineering-sim","mathematics","physics","physics-simul","simulation","simulations","simulator","simulators","spectrum","spectrum-analysis","spectrum-analyzer"],"created_at":"2025-08-12T00:44:23.077Z","updated_at":"2025-08-12T00:44:23.961Z","avatar_url":"https://github.com/KMORaza.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Spektrumanalysator-Software (Spectrum Analyzer Software)\n\n### Initialization\n- **Purpose**: Starting the application.\n- **Logic**:\n  - Loads the `spectrum_analyzer.fxml` file to define the UI layout.\n  - Applies the `style.css` stylesheet for visual styling (black background, yellow text, etc.).\n  - Creates a window (`Stage`) titled \"Spectrum Analyzer\" with a resolution of 1200x800 pixels.\n  - Starts the application using `launch(args)` in the `main` method.\n### User Interface and Control\n- **Purpose**: Manages the UI components and user interactions, coordinating updates to the visualization and signal processing.\n- **Key UI Elements**:\n  - **Sliders**: Adjust max frequency (20 Hz to 50 GHz), dynamic range (100–200 dB), and sweep speed (0.1–10).\n  - **ComboBoxes**: Select display mode (Spectrum/Persistence), analysis mode (FFT/Swept-Tuned), window function (Hanning, Blackman-Harris, etc.), and demodulation type (None, AM, FM, etc.).\n  - **TextFields**: Set channel bandwidth and number of channels (1–5).\n  - **ToggleButton**: Enable/disable logarithmic frequency scale.\n  - **Button**: Export power report to a CSV file.\n  - **Labels**: Display metrics like channel power, ACPR (Adjacent Channel Power Ratio), signal type, and window function info.\n  - **Canvas Containers**: Host the spectrum and demodulation visualizations.\n- **Initialization Logic**:\n  - Creates a `SignalProcessor` to handle signal data generation.\n  - Initializes `SpectrumCanvas` (1160x400) and `DemodCanvas` (1160x150) for visualizations.\n  - Sets up listeners for UI controls to update `SignalProcessor` and `SpectrumCanvas` parameters (e.g., frequency range, dynamic range, sweep speed).\n  - Configures an `AnimationTimer` to continuously update the canvases and metrics.\n- **Key Functions**:\n  - **`updateMetrics()`**: Updates labels for channel power, ACPR, and signal type based on `SpectrumCanvas` calculations and `SignalProcessor` classification.\n  - **`updateWindowInfo()`**: Displays window function characteristics (e.g., sidelobe levels, resolution) based on the selected window.\n  - **`exportPowerReport()`**: Writes channel power and ACPR to a CSV file (`power_report.csv`).\n### Signal Processing\n- **Purpose**: Generates simulated signal data, applies window functions, demodulation, and analysis modes.\n- **Key Parameters**:\n  - FFT size: 16,384 points.\n  - Frequency range: Min (default 20 Hz) to max (default 1 kHz, adjustable).\n  - Analysis mode: FFT or Swept-Tuned.\n  - Window function: Hanning, Blackman-Harris, Kaiser, Flat-Top, or Gaussian.\n  - Demodulation type: None, AM, FM, PM, QAM, PSK, or OFDM.\n  - Sweep speed: Affects amplitude attenuation in Swept-Tuned mode.\n- **Logic**:\n  - **Data Generation**:\n    - Uses an `ExecutorService` to run data generation asynchronously.\n    - Generates a noise floor based on the max frequency (`-160 - 20 * log10(maxFreq / 1000)` dB).\n    - Simulates signals for specific frequency bands:\n      - Wi-Fi (100–200 Hz, +100 dB Gaussian peak at 150 Hz).\n      - Bluetooth (2400–2480 MHz, +80 dB peak at 2440 MHz).\n      - LTE (700–2700 MHz, +90 dB peak at 1800 MHz).\n      - 5G NR (3500–3700 MHz, +85 dB peak at 3600 MHz).\n      - Zigbee (2400–2450 MHz, +75 dB peak at 2425 MHz).\n    - Adds Gaussian noise (±10 dB) to the noise floor.\n    - Generates random phases (0 to 2π) for each frequency bin.\n  - **Window Application**:\n    - Applies the selected window function to the amplitude data to reduce spectral leakage.\n    - Supports Hanning, Blackman-Harris, Kaiser, Flat-Top, and Gaussian windows, each with specific coefficients or parameters (e.g., Kaiser uses a Bessel function with β=8.6).\n  - **Demodulation**:\n    - If a demodulation type is selected, applies the `Demodulator` to modify amplitudes based on phases (see Demodulator section).\n  - **Analysis Mode**:\n    - In Swept-Tuned mode, attenuates amplitudes based on sweep speed (`0.8 / sweepSpeed`).\n  - **Data Storage**:\n    - Updates a `SpectrumData` object with amplitudes, phases, and frequency range.\n### Spectrum Visualization\n- **Purpose**: Renders the signal spectrum or persistence display on a canvas.\n- **Key Features**:\n  - Display modes: Spectrum (real-time plot) or Persistence (intensity-based history).\n  - Adjustable dynamic range (default 160 dB).\n  - Logarithmic or linear frequency scale.\n  - Channel markers for bandwidth and count.\n  - Grid and labels for frequency and amplitude.\n- **Logic**:\n  - **Spectrum Mode**:\n    - Clears the canvas with a black background.\n    - Plots amplitudes as a yellow line, scaled to canvas dimensions.\n    - Supports logarithmic frequency scaling if enabled.\n    - Draws red markers for channel boundaries based on center frequency, bandwidth, and channel count.\n    - Adds a grid (10x10) with frequency (Hz) and amplitude (dBm) labels.\n  - **Persistence Mode**:\n    - Maintains a 400-frame buffer of amplitude histories.\n    - Fades older data (0.95 decay) and updates with new amplitudes.\n    - Colors pixels green based on intensity (0–255).\n  - **Metrics**:\n    - **`getChannelPower()`**: Calculates average power (dBm) within the channel bandwidth around the center frequency.\n    - **`getACPR()`**: Computes the power ratio (dB) between the main channel and adjacent channels (up to 3x bandwidth).\n### Demodulation Graphics\n- **Purpose**: Displays the demodulated signal waveform.\n- **Logic**:\n  - Clears the canvas with a black background.\n  - Retrieves amplitude data from `SignalProcessor` (post-demodulation).\n  - Plots the waveform as a yellow line, centered vertically, with amplitude scaled to ±400 units.\n  - Draws a dark gray centerline for reference.\n  - Updates in sync with the `AnimationTimer`.\n### Demodulation \n- **Purpose**: Applies demodulation to the signal based on the selected type.\n- **Supported Types**:\n  - **AM**: Multiplies amplitude by `cos(phase)`.\n  - **FM**: Computes phase differences (`(phase[i] - phase[i-1]) / 2π`).\n  - **PM**: Normalizes phases (`phase / 2π`).\n  - **QAM**: Combines in-phase (`I = amplitude * cos(phase)`) and quadrature (`Q = amplitude * sin(phase)`) components as `sqrt(I² + Q²)`.\n  - **PSK**: Quantizes phases to nearest multiples of `π/4`.\n  - **OFDM**: Applies AM with a random phase offset (±π/8).\n- **Logic**:\n  - Copies input amplitudes to a result array.\n  - Modifies the result based on the demodulation type using amplitude and phase data.\n  - Returns the demodulated amplitudes.\n### Signal Classification\n- **Purpose**: Identifies the signal type based on spectral characteristics.\n- **Logic**:\n  - Analyzes the `SpectrumData` amplitudes to find the peak amplitude and corresponding frequency.\n  - Counts peaks with the same amplitude to adjust confidence (fewer peaks → 90%, more → 70%).\n  - Classifies based on frequency and amplitude thresholds:\n    - **Bluetooth**: 2400–2480 MHz, \u003e-100 dBm.\n    - **Wi-Fi**: 100–200 Hz, \u003e-80 dBm.\n    - **LTE**: 700–2700 MHz, \u003e-90 dBm.\n    - **5G NR**: 3500–3700 MHz, \u003e-95 dBm.\n    - **Zigbee**: 2400–2450 MHz, \u003e-105 dBm.\n    - **Unknown**: Default, 50% confidence.\n  - Returns a string with the signal type and confidence percentage.\n### Data Storage \n- **Purpose**: Stores and provides access to spectral data.\n- **Logic**:\n  - Holds arrays for amplitudes and phases (size 16,384).\n  - Stores min and max frequencies.\n  - Provides getters for data access and an `update` method to refresh data\n### UI Layout \n- **Purpose**: Defines the UI structure using JavaFX components.\n- **Structure**:\n  - A `BorderPane` with a top `Label` (\"Spectrum Analyzer\").\n  - A center `SplitPane` containing:\n    - **Left Panel**: Control panel with sliders, ComboBoxes, TextFields, ToggleButton, and export Button, organized in `TitledPane` sections (Frequency, Analysis Mode, etc.).\n    - **Right Panel**: Canvas containers for spectrum and demodulation visualizations, plus metric labels (channel power, ACPR, signal type, window info).\n  - Styled via `style.css` for a dark theme with yellow accents.\n### Styling \n- **Purpose**: Defines the visual appearance of the UI.\n- **Key Styles**:\n  - Black background for most components.\n  - Yellow text and accents for labels, buttons, and sliders.\n  - Dark gray for tracks, borders, and backgrounds of interactive elements.\n  - Courier New font, 12px size.\n  - Custom styling for sliders, ComboBoxes, ToggleButtons, and scrollbars.\n\n---\n\n| ![](https://github.com/KMORaza/Spectrum_Analyzer_Software/blob/main/Spectrum%20Analyzer/src/main/screenshots/screen%20(1).png) | ![](https://github.com/KMORaza/Spectrum_Analyzer_Software/blob/main/Spectrum%20Analyzer/src/main/screenshots/screen%20(2).png) |\n|--------------------------------------------------|-------------------------------------|\n| ![](https://github.com/KMORaza/Spectrum_Analyzer_Software/blob/main/Spectrum%20Analyzer/src/main/screenshots/screen%20(3).png) | ![](https://github.com/KMORaza/Spectrum_Analyzer_Software/blob/main/Spectrum%20Analyzer/src/main/screenshots/screen%20(4).png) |\n| ![](https://github.com/KMORaza/Spectrum_Analyzer_Software/blob/main/Spectrum%20Analyzer/src/main/screenshots/screen%20(5).png) | ![](https://github.com/KMORaza/Spectrum_Analyzer_Software/blob/main/Spectrum%20Analyzer/src/main/screenshots/screen%20(6).png) |\n| ![](https://github.com/KMORaza/Spectrum_Analyzer_Software/blob/main/Spectrum%20Analyzer/src/main/screenshots/screen%20(7).png) | ![](https://github.com/KMORaza/Spectrum_Analyzer_Software/blob/main/Spectrum%20Analyzer/src/main/screenshots/screen%20(8).png) |\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmoraza%2Fspectrum_analyzer_software","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkmoraza%2Fspectrum_analyzer_software","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmoraza%2Fspectrum_analyzer_software/lists"}