How to import corrupted s-parameter (touchstone) file up to X Ghz?

2 visualizaciones (últimos 30 días)
I have a large touchstone 1.0 file that got corrupted during save when PC ran out of memory. The file in question is ~5GB but I routinely work with ~15GB files (s384p) with many frequency points. Because it is not easy to open the file and chop off corrupted data after X frequency (because DC -> X are still valid), how can I do a frequency span selectable read using the RF toolbox "sparameters" function? Is there an alternative way to edit this large of a txt file in-line to remove corrupted (incomplete) frequency points? Recall touchstone stores frequency data for all points sequentially, so chopping off data after X frequency should not hurt the integrity of the remaining file.

Respuesta aceptada

Scotty Neally
Scotty Neally el 3 de Jun. de 2022
Psuedo-code (faster with git bash installed):
  • fopen() toucshtone for read, fseek() to end of file (eof).
  • fseek() backwards and appropriate amount (as determined by number of ports) to before last frequency point.
  • Read line-by-line, and use regexp test to find valid frequency as first entry.
  • Record start of chop point (before valid frequency entry) using ftell()
  • Run git bash split (matlab dos execution), cleanup unneccesary files, & rename corrected file
  • or use fprintf() to rewrite a new touchstone file (can be time intensive for large files)
Usage:
ClipLastFreq(filename,0) or ClipLastFreq(filename) %for git bash split
ClipLastFreq(filename,1) %for matlab fprintf()

Más respuestas (0)

Categorías

Más información sobre Visualization and Data Export en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by