¿ªÔÆÌåÓý

fft and ltspice


 

ltspice group:

hi?

?suppose i have a sine wave and i sampled this wave for example with Matlab software? so? i have samples of this wave and i save them for example in a text file.

how can i do fft of these sample in ltspice( this work can be done easly in Matlab but i want do in ltspice) and how import the samples in ltspice?

thanks


 

The very simplest way to get data from MATLAB into LTspice is to use .wav files.? MATLAB can read and write wave files and LTspice can read and write these files.? See examples:

C:\Program Files\LTC\LTspiceXVII\examples\Educational\wavein.asc
C:\Program Files\LTC\LTspiceXVII\examples\Educational.waveout.asc

Note: You have to look at the folder where you installed LTspice which might not be same as me.

Good luck,
Dan


 

Hello,

A V-source can read its PWL-data from a file.

Therefore place a V-source in the schematic. Then right-mouse-click on it and choose PWL-file.

LTspice will interpolate between the data points, if the FFT has to calculate data points between the defined data points.

If the simulation has finhshed, you can start the FFT.
Right-mouse-click into the waveform window -> View -> FFT.

Data format of the file: time value
I guess space(s), comma and tab(s) are possible seperation characters.


2 0
2.1 -1
2.2 0.5
2.3 0
2.4 -0.3
2.5 0.0
2.6 -0.1
2.7 0
2.8 0

Best regards,
Helmut


 

Hello Dan,

The drawback of wave files is that the data values has to be between -1 and +1. That's why I prefer PWL-files. They have no such restrictions.

Best regards,
Helmut


 

thanks for your answer