LTSpice raw file format - Page 1
Forum section: electronics / projects

author: Dajgoro
author_rank: Frequent Contributor
timestamp: April 16, 2018, 02:25:52 pm
content: Hi.I'm doing a little program that reads the LTSpice raw file in ascii form.I can read it and parse it, but the values are a bit odd.Does anyone know how to convert its values to proper volt/div or db.I tried googling, but did not find much.Example file:Code:Date: Thu Feb 15 12:55:36 2018Plotname: AC AnalysisFlags: complex forward logNo. Variables: 2No. Points: 31Offset: 0.0000000000000000e+000Command: Linear Technology Corporation LTspice XVIIBackannotation: u1 1 2 3 4 5Backannotation: u2 1 2 3 4 5Variables:0frequencyfrequency1V(out)voltageValues:01.000000000000000e+002,0.000000000000000e+000-1.626518856620160e-002,-9.551513683488917e-00211.258925411794167e+002,0.000000000000000e+000-2.548386343783640e-002,-1.185709723353771e-00121.584893192461114e+002,0.000000000000000e+000-3.966943922076229e-002,-1.460225368287132e-00131.995262314968880e+002,0.000000000000000e+000-6.114131287846677e-002,-1.776278940395874e-00142.511886431509581e+002,0.000000000000000e+000-9.283895878522219e-002,-2.120560965692974e-00153.162277660168380e+002,0.000000000000000e+000-1.379246579823883e-001,-2.461515057595745e-00163.981071705534974e+002,0.000000000000000e+000-1.987065926553117e-001,-2.742655002594494e-00175.011872336272725e+002,0.000000000000000e+000-2.747782471208155e-001,-2.883233246579412e-00186.309573444801935e+002,0.000000000000000e+000-3.610195848819268e-001,-2.794861417388469e-00197.943282347242819e+002,0.000000000000000e+000-4.470428929739705e-001,-2.414772558163595e-001101.000000000000001e+003,0.000000000000000e+000-5.193724975464125e-001,-1.739027534434180e-001111.258925411794168e+003,0.000000000000000e+000-5.654966066820114e-001,-8.324384586458757e-002121.584893192461114e+003,0.000000000000000e+000-5.773229892855986e-001,1.889108888292795e-002131.995262314968881e+003,0.000000000000000e+000-5.527540012500585e-001,1.185960154049208e-001142.511886431509582e+003,0.000000000000000e+000-4.959901405761502e-001,2.023916401796307e-001153.162277660168381e+003,0.000000000000000e+000-4.169504282714027e-001,2.600688065588075e-001163.981071705534975e+003,0.000000000000000e+000-3.290208728611678e-001,2.874286868162068e-001175.011872336272726e+003,0.000000000000000e+000-2.450646349004209e-001,2.872085078066406e-001186.309573444801937e+003,0.000000000000000e+000-1.737464922602154e-001,2.670462660867667e-001197.943282347242821e+003,0.000000000000000e+000-1.183618339686348e-001,2.358472615876586e-001201.000000000000001e+004,0.000000000000000e+000-7.811774744811929e-002,2.009448784923966e-001211.258925411794168e+004,0.000000000000000e+000-5.022665867729482e-002,1.670784171246787e-001221.584893192461115e+004,0.000000000000000e+000-3.151485940084169e-002,1.366844733676346e-001231.995262314968881e+004,0.000000000000000e+000-1.923101681151168e-002,1.106415994705496e-001242.511886431509583e+004,0.000000000000000e+000-1.128085095418522e-002,8.895151518056553e-002253.162277660168383e+004,0.000000000000000e+000-6.182405771845288e-003,7.120295762316413e-002263.981071705534977e+004,0.000000000000000e+000-2.931641267481686e-003,5.683967187196902e-002275.011872336272729e+004,0.000000000000000e+000-8.661326845264538e-004,4.529698620930402e-002286.309573444801940e+004,0.000000000000000e+0004.441153098338711e-004,3.606226185748888e-002297.943282347242825e+004,0.000000000000000e+0001.275558889318605e-003,2.869536818902944e-002301.000000000000000e+005,0.000000000000000e+0001.805125571330276e-003,2.282995601629139e-002

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 16, 2018, 03:02:24 pm
content: For AC analysis, for each "value":Code:point number, frequency (Hz), 0 (always), real part of variable 1, imaginary part of variable 1, ...For transient:Code:point number, time (s), variable 1, ...

author: Dajgoro
author_rank: Frequent Contributor
timestamp: April 16, 2018, 03:12:49 pm
content: Aah, yes, I thought it could be something like that.

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 16, 2018, 03:26:43 pm
content: Yep. The values are in the base unit for the given variable (V, A, ...)For AC analysis, the values are complex numbers (same as with Spice anyway). So to get the magnitude and phase, you have to convert from rectangular to polar. Then the magnitude will be in the base unit, and the angle will be the phase.

author: Dajgoro
author_rank: Frequent Contributor
timestamp: April 16, 2018, 04:43:44 pm
content: Yes, I converted it and it works fine now.Thanks for the info.