Ask a Question | Search DSPSR: |
Home
|
DSPSR user documentation: dspsrWrite time series data to file at some point in the signal pathImportant Note: Currently, dspsr can write only floating-point time-series data using the -dump command-line option (not binary "bit-series" data and not folded "phase-series" data). To use the -dump feature, it is useful to first run dspsr or digifil with the the additional -r command line option. After finishing, dspsr or digifil will report the time spent on each operation; e.g. digifil -r -F 128:16 -T 1.0 1644-4559.cpsr2 Operation Time Spent Discarded CPSR2 0.012247 0 CPSR2TwoBitCorrection 1.154202 0 Filterbank 5.958811 0 Detection 0.278981 0 Rescale 0.296702000000001 0 SigProcDigitizer 1.252813 0 SigProcOutputFile 0.027302 0The argument to the -dump option names the operation before which the timeseries should be dumped to disk; e.g., if you want to write out the timeseries before Detection, digifil -r -F 128:16 -T 1.0 -dump Detection 1644-4559.cpsr2When it finishes, you can view the header information that digifil wrote to the binary data file with either digihdr pre_Detection.dump or head -c 4096 pre_Detection.dump"NBIT 32" means "floating point" This file can be processed using dspsr or any other code that can load arrays of floating point binary data. (Just ignore the first 4096 bytes of ASCII header information.) Data are written in time major -- then frequency -- then polarization order (or TFP order) as in the following loop for (uint64_t itime = 0; itime < ntime; itime++) for (unsigned ifreq = 0; ifreq < nfreq; ifreq ++) for (unsigned ipol = 0; ipol < npol; ipol++) { const float* data = use->get_datptr (ifreq, ipol); fwrite (data + itime*ndim, sizeof(float), ndim, output); }Here "ndim=1" for real-valued data and "ndim=2" for complex-valued data.
|