On Jan 11, 9:50 am, Jim Thompson <To-Email-Use-The-Envelope-I...@On-My-
Web-Site.com> wrote:
On Wed, 11 Jan 2012 08:32:27 -0800 (PST), Robert Macy
robert.a.m...@gmail.com> wrote:
On Jan 10, 5:19 pm, Jim Thompson <To-Email-Use-The-Envelope-I...@On-My-
Web-Site.com> wrote:
On Tue, 10 Jan 2012 16:02:20 -0800 (PST), Robert Macy
robert.a.m...@gmail.com> wrote:
On Jan 10, 8:38 am, Jim Thompson <To-Email-Use-The-Envelope-I...@On-My-
Web-Site.com> wrote:
On Tue, 10 Jan 2012 07:03:11 -0800 (PST), Robert Macy
robert.a.m...@gmail.com> wrote:
On Jan 9, 6:23 pm, Jim Thompson <To-Email-Use-The-Envelope-I...@On-My-
Web-Site.com> wrote:
On Mon, 9 Jan 2012 15:47:39 -0800 (PST), Robert Macy
robert.a.m...@gmail.com> wrote:
On Jan 9, 9:09 am, Jim Thompson <To-Email-Use-The-Envelope-I...@On-My-
Web-Site.com> wrote:
On Mon, 9 Jan 2012 07:50:41 -0800 (PST), Robert Macy
robert.a.m...@gmail.com> wrote:
On Jan 8, 2:01 pm, Sergius <sergey...@gmail.com> wrote:
I;m trying to get transient data for future Matlab - calculating SNR
of
ADC output, but time scale of .txt exported file is not uniform- time
steps
seem to different from point to point. What I must to linearize or
resample?
this has been covered several times with the LTspicegroup. And, yes,
Iforgot how to do it.
There is some form of the way to export the data file that includes
the step size, or number of steps, ??
I wrote a function to linearnize the steps for LTpsice and used it
until I found that out .
Did you oin the LTspice group, it's easy.
Robert, Is there a way to get uniform time-step data?
This is all I know of, from Helmut [Digest # 4440]:
[begin quote from LTspice group]
--- In LTsp...@yahoogroups.com, "jtanalog" <yahoo@...> wrote:
Is there any way in LTspice to generate a .OUT file such as are found in other Spice variants?
Or is there some alternate way to "print" data points in a list?
- Jim Thompson
Hello Jim,
Make the waveform window the active window.
From the menu click File and then Export.
Best regards,
Helmut
[end quote from LTspice group]
In PSpice you just insert a .print statement into your .cir file with
the stepsize you want. The data appears in the .out file.
...Jim Thompson
--
| James E.Thompson, CTO | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon
athttp://www.analog-innovations.com|1962 |
I love to cook with wine. Sometimes I even put it in the food.
Jim,
I played with the form to try it out and now have NO idea where it is,
or what I had done. I'll look around to see if I can find it.
Thanks!
It sure seems that Mikey would have an equivalent to every other
Spice, the .print statement ???
...Jim Thompson
--
| James E.Thompson, CTO | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon
athttp://www.analog-innovations.com|1962 |
I love to cook with wine. Sometimes I even put it in the food.
Here's the function I wrote to use in free Matlab clone, octave
2.1.50a which should work in later versions:
function [t,v]=fillinsteps(x,y,n);
% FILLINSTEPS to smooth an ordinate varying waveform
% use the form [t,v,n]=fillinsteps(x,y,n);
% where x is the ordinate
% y is the abcissa
% n is the number of steps
if (nargin==0)
help fillinsteps;
return;
endif
if (nargin ~=3)
help fillinsteps;
return;
endif
[ry,cy]=size(y);
t=max(x)*(1:n)/n;
for i=1:n
[xx,ix]=min(abs(x-t(i)));
if (t(i)>=x(ix))
if (ix==cy)
v(i)=y(cy);
else
v(i)=y(ix)+(y(ix+1)-y(ix))*(t(i)-x(ix))/(x(ix+1)-x(ix));
endif
else
if (ix==1)
v(i)=y(1);
else
v(i)=y(ix-1)+(y(ix)-y(ix-1))*(t(i)-x(ix-1))/(x(ix)-x(ix-1));
endif
endif
endfor
Note, it IS a linear interpolation, so you will see the noise floor
come up in the FFTs.
I think there is some finagling to get the x and y into this function,
probably export, or print, then past onto Excel, maybe, then scoop up
and put into the array, or...
Maybe it was simply strip off the header from LTspice and 'read' the
text file as a variable, then strip out x and y. Yeah that sounds
better.
What do you get with LTspice if you choose "ASCII data files" (CSDF)?
...Jim Thompson
--
| James E.Thompson, CTO | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon
athttp://www.analog-innovations.com|1962 |
I love to cook with wine. Sometimes I even put it in the food.
I don't know.
But someone finally posted the complete method:
Use LTspice2Matlab.m function to read and convert the .raw file to
uniform steps.
Before I knew that existed, I would go to FILE, select Export, and the
file automatically comes out as a two column non-uniform text list of
calculations.
I would remove the Header with a text editor, and simply 'read' the
file into octave, then I used my custom fillinsteps.m [not knowing
someone had already written interp1.m and was a built-in function]
then I would save the data in ascii and get a text list of uniform
steps.
A bit of a workaround, but when you don't do this often, workarounds
take less time. Probably would go through all these steps if I did it
again, because I tend to reinvent the wheel each time and that's the
logical sequence
It occurs to me that one could simply import the text list into PSpice
as a PWL, run it as a source, but call a .PRINT statement with the
timestep I choose to convert it to evenly spaced.
Is LTspice2Matlab.m a Matlab routine, or where do you run it?
...Jim Thompson
--
| James E.Thompson, CTO | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon
athttp://www.analog-innovations.com| 1962 |
I love to cook with wine. Sometimes I even put it in the food.
If you have Matlab, run as a normal function putting in all the
arguments and requesting all your outputs.
In octave, you can place it in a script file to run, or run from the
console line entry.
I only used it to verify and found it did work. But, every time I
'uniformed' the steps, I always reverted to my old technique since I
could count on it.
Do you have Matlab, or free octave?
Did you try the waveform source and PRINT function to see if that
worked?
Neither. But with the requests for Spice to IBIS coming in I do need
a convenient numeric processor.
...Jim Thompson
--
| James E.Thompson, CTO | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon
athttp://www.analog-innovations.com| 1962 |
I love to cook with wine. Sometimes I even put it in the food.
Stay away from trying to use Excel ;)
I recommend octave 2.1.50a for its plotting! However, if you're doing
high power arrays, latest version is better, accepts 3 indices.
More advantageous, the users group will usually post help response
within a few hours 24/7. If you're like me, you work anytime and don't
want to interface with 'customer service' only during business hours.
I use octave to test DSP algorithms BEFORE writing the C, C++ code.
First time Directions:
Get a good text editor, like SC1 from Scilab. Set it up to open .m
files.
Install octave.
place all your working .txt files and .m files in the octave_files
folder.
Run octave.
Either command line prompt, step by step, or
write a TestScript.m file using the editor
At the prompt type in the name of the script file, in this case
TestScript [don't add the .m It's implied] and octave will run your
script.
You can open files, read files either text or binary, save files
either text or binary. etc.
Fastest way to learn is try to do the first thing you want done?
LTspice analyze the problem and export results in text format. Keep
simple. only one variable. Edit the file to remove header, only have
numbers, save as out.txt.
At the command prompt type
read("out.txt");
then type
t=out(:,1)'; v=out(",2)';
that will put the thing into 'normal' forms
you now have time as t in nonuniform steps and you have v at each time
point.
How many points do you want? 1000?
type in
[T,V]=fillinsteps(t,v,1000);
[or use the built in function interp1.m]
and voila! even number of steps
save as a text file by typing
save -ascii "StepsUniform.txt" T V;
and then look at that file. You'll find that the arrays are across and
not down
if you want down like the original format change the variables:
T=T'; V=V'; save "StepsUniform.txt" T V;
or if you want the 'down' array to be in the similar format as the
original:
OUT=[T,V]; save -ascii "OUT.txt" OUT;
then you can use your text editor to change the header to the original
header and you're done.
| Analog Innovations, Inc. | et |
I love to cook with wine. Sometimes I even put it in the food.