矿石收音机论坛

 找回密码
 加入会员

QQ登录

只需一步,快速开始

搜索
查看: 8644|回复: 12

LTspice 可以产生电脑直接播放的WAV文件 -- 任意波形发生

[复制链接]
     
发表于 2012-4-9 18:30:53 | |阅读模式
本帖最后由 e3po 于 2012-4-9 13:23 编辑

命令: .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 <filename.wav> <Nbits>  <SampleRate> V(out) [V(out2) ...]

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

<filename.wav> 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.  <Nbits> is the number of sampling bits.  The valid range is from 1 to 32 bits.
<SampleRate> 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)

翻译成白话文,   把 节点 n008 的电压波形用 16bit  44.1KHz 的采样参数另存为 C 盘根目录下 OUTPUT.WAV 文件.



播放,  您可以用千千静听等工具回放.





     
 楼主| 发表于 2012-4-9 18:35:32 |
本帖最后由 e3po 于 2012-4-9 11:53 编辑



     再例如,   您仿真了个三管收音机,  可以把输出的波形存成 wav 文件.



    这样,  您就终于可以将仿真的世界和您生活的现实世界建立某种联系.




       另外,  您也不需要到处去找波形发生器,   LTspice 可以产生各种稀奇古怪的波形,  您只要把它存成 wav .


LT Spice PWL - 三角波, 方波, 阶梯波, 锯齿波波形 等等的发生
http://www.crystalradio.cn/thread-250519-1-1.html
     
发表于 2012-4-9 21:24:06 |
业余搞搞单管机、二管机等的,也可以用

搞段高保真的话音或音乐,AM调制,进自己待DIY电路,从喇叭处录音,到文件

然后分别放原始的,和经过自己收音机电路的文件,就知道自己待DIY的收音机音质如何
     
 楼主| 发表于 2012-4-11 04:52:53 |
ace919 发表于 2012-4-9 05:24
业余搞搞单管机、二管机等的,也可以用

搞段高保真的话音或音乐,AM调制,进自己待DIY电路,从喇叭处录音 ...






对的,  这就是仿真的目的之一
     
 楼主| 发表于 2012-7-24 06:43:04 |

复习一下。

老了, 记性不好了
     
发表于 2012-7-24 06:59:29 |
e3po绝对是本坛电路仿真的导师
发表于 2012-7-24 19:39:46 |
e3po绝对是本坛电路仿真的导师


2nd that.
发表于 2012-7-24 19:47:06 |
请教复制代码之后如何在LT里操作,生成图和运行呢?
俺实在是初学者,问题多多啊。。。
     
 楼主| 发表于 2012-7-25 07:37:02 |
millwood 发表于 2012-7-24 03:39
2nd that.




       YOU’RE TOO KIND。


      YOU POINTED OUT THE DIRECTION。


      THANKS!
     
 楼主| 发表于 2012-7-25 07:39:11 |
kolmogolov 发表于 2012-7-24 03:47
请教复制代码之后如何在LT里操作,生成图和运行呢?
俺实在是初学者,问题多多啊。。。




        选个电压源, 贴入相应的代码。

LT Spice PWL - 三角波, 方波, 阶梯波, 锯齿波波形 等等的发生
http://www.crystalradio.cn/thread-250519-1-1.html


       跑。
     
 楼主| 发表于 2014-7-17 17:17:42 |




           想念  millwood ,  又找到这个老贴
     
发表于 2014-7-17 17:53:19 |
Proteus 可以直接把仿真声音结果从电脑音箱播放出来呢,而且是实时的。.
比如,你做了个音频信号发生电路,在电路中接入喇叭,那电脑音箱就可以实时的发声。
发表于 2014-7-17 22:58:48 |
proc 发表于 2014-7-17 17:53
Proteus 可以直接把仿真声音结果从电脑音箱播放出来呢,而且是实时的。.
比如,你做了个音频信号发生电 ...

的确Proteus也可以看声音波形并可听到声音、、、但感觉用LTspice顺手些,要听也可以把它录成WAV、、、

小黑屋|手机版|矿石收音机 ( 蒙ICP备05000029号-1 )

蒙公网安备 15040402000005号

GMT+8, 2024-5-6 04:03

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表