forked from stpaine/FERS
-
Notifications
You must be signed in to change notification settings - Fork 1
Pulse CSV File Loading
David Young edited this page Apr 30, 2025
·
1 revision
Loads a pulse waveform from a Comma-Separated Value (.csv) file. This function expects the file to adhere to a specific format: the first line must contain the total number of complex samples and the sample rate (in Hz), separated by a comma. Subsequent lines should each contain one complex data point, parsable by the standard C++ stream extraction operator (operator>>) for ComplexType (likely expecting formats like (real,imag) or real,imag). The loaded data represents the baseband complex envelope of the pulse.
- Assumes the specified CSV file exists and is readable by the application.
- Assumes the CSV file strictly follows the required format:
- Line 1:
num_samples,sample_rate - Lines 2 to N+1: complex data points (where N =
num_samples).
- Line 1:
- Assumes the complex number format on each line is correctly parsable by
std::complex<RealType>'s stream extraction operator. - Assumes the
sample_ratespecified within the CSV file accurately reflects the rate at which the complex data points were sampled. - Assumes the complex data points represent the desired baseband complex envelope of the pulse waveform.
- Format Rigidity: The loader is highly sensitive to the exact CSV format. Any deviation (e.g., missing first line, incorrect number of samples, different complex number formatting) will likely lead to parsing errors or incorrect behavior.
- Limited Value Validation: Error checking primarily focuses on the number of samples read matching the count specified in the header. It performs limited validation on the values themselves beyond basic parseability.
-
Parameter Override: The signal duration (
RadarSignal::_length) and the signal sample rate (Signal::_ratebefore potential upsampling) are determined solely by thenum_samplesandsample_ratevalues read from the CSV file header. These values may override or conflict with other potentially related simulation parameters (e.g.,params::rate()might be intended for something else but doesn't influence the rate read here). - File Size: Representing complex waveforms in human-readable CSV format can lead to potentially large file sizes compared to binary formats, impacting storage and loading times.
-
pulse_factory.cpp::loadPulseFromCsvFile(The implementing function) -
RadarSignal(The class holding the loaded signal information) -
Signal(The class holding the raw complex data vector and rate) - Pulse Handling (Overall capability category)
- Pulse XML Definition (Where the filename is specified)
- Needs Verification: The robustness of the parser against common CSV formatting errors and the interaction of the CSV-defined sample rate with other system parameters needs thorough testing.
-
Key Areas for Validation:
- Correct parsing of validly formatted CSV files.
- Error handling behavior with malformed files (incorrect header, wrong number of samples, unparsable complex numbers).
- Verification that
RadarSignal::_lengthandSignal::_rateare set correctly based only on the CSV header values. - Identify potential conflicts if
params::rate()is used elsewhere and has a different value than the rate loaded from the CSV. - Performance impact of loading large CSV pulse files.
- Priority: Medium (Core functionality for custom waveforms, but with known fragility).