2012年7月16日 星期一

LTSpice 產生三角 方波 階梯 鋸齒波

LT Spice - 三角波, 方波, 階梯波, 鋸齒波波形 等等的發生 - PWL 的設置


鋸齒波
語法 :  PWL repeat forever (0 0 999.999e-6 1 1000.000e-6 0) endrepeat
或        PWL repeat forever (0 0 999.999u 1 1000.000u 0) endrepeat
1)Component輸入"voltage"零件


2)游標指向"V1"圖形,然後按CTRL+右鍵


3) 輸入參數

4)




5)按Simulation->Edit simulation command

6)按OK


7)按Simulation->RUN

8)點選"signal"電路節點,然後按滑鼠右鍵 畫出輸出波形 


9) 產生波形如下 


三角波: 
PWL repeat forever ( 0 0.6 157.23e-6  -0.6 314.46e-6  0.6 ) endrepeat
 

方波: (要自己算出來上升時間和下降時間, 然後從定的點的時間裏面扣除, 當然也可以多定一些點, 更精確的描述波形)



PWL repeat forever (0 0.6 157229n 0.6 157230n -0.6 314449n -0.6  314459n 0.6)endrepeat


階梯波形

PWL repeat forever (0 0 999.999e-6 0 1000.000e-6 0.1 1999.999e-6 0.1 2000.000e-6 0.2 2999.999e-6 0.2 3000.000e-6 0.3 3999.999e-6 0.3 4000.000e-6 0.4 4999.999e-6 0.4 5000.000e-6 0.5 5999.999e-6 0.5 6000.000e-6 0) endrepeat


反鋸齒
PWL repeat forever (0 0 0.000001 1 1000.000e-6 0) endrepeat




LTspice 可以產生電腦直接播放的WAV -- 任意波形發生

命令: .wave
LTspice can write .wav audio files.  These files can then be listened to or be used as the input of another simulation.

Syntax:  .wave    V(out) [V(out2) ...]

Example: .wave C:\output.wav 16 44.1K V(left) V(right)

is either a complete absolute path for the .wav file you wish to create or a relative path computed from the directory containing the simulation schematic or netlist.  Double quotes may be used to specify a path containing spaces.   is the number of sampling bits.  The valid range is from 1 to 32 bits.
is the number of samples to write per simulated second.  The valid range is 1 to 4294967295 samples be second. The remainder of the syntax lists the nodes that you wish to save. Each node will be an independent channel in the .wav file.  The number of channels may be as few as one or as many as 65535.  It is possible to write a device current, e.g., Ib(Q1) as well as node voltage.  The .wav analog to digital converter has a full scale range of -1 to +1 Volt or Amp.

Note that it is possible to write .wav files that cannot be played on your PC sound system because of the number of channels, sample rate or number of bits due to limitations of your PC's codec.  But these .wav files may still be used in LTspice as input for another simulation. See the sections LTspice=>Circuit Elements=>V. Voltage Source and I. Current source for information on playing a .wav file into an LTspice simulation. If you want to play the .wav file on your PC sound card, keep in mind that the more popularly supported .wav file formats have 1 or 2 channels; 8 or 16 bits/channel; and a sample rate of 11025, 22050, or 44100 Hz.

例子 :   
.wave C:\output.wav 16 44.1K V(n008)
上面這個例子翻譯成白話文,  "  節點 V(n008) 的電壓波形用 16bit  44.1KHz 的採樣參數另存為 C 碟根目錄下 OUTPUT.WAV 文件". 懂了嗎?----> OK!!!很好!!!

http://www.crystalradio.cn/thread-265546-1-1.html

Undocumented LTspice
http://ltwiki.org/index.php5?title=Undocumented_LTspice

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。