Step 5Other types of voltage sources, other types of sounds.
Using the bv component to generate noise involves defining the voltage based on a formula. The formula for generating noise looks like this: V=white(time*X)*Y The white function creates a random voltage between -0.5 and +0.5 V using the current time value as a seed. Setting Y to 2 gives a +/- 1V swing. Setting X between 1,000 (1e3) and 100,000 (1e5) affects the spectrum of the noise and changes the sound.
The voltage controlled switch also needs some parameters to be set in a .model statement. You can use multiple voltage controlled switches and multiple model statements to make each one behave differently if you want. You have to tell the simulator the "on" and "off" resistances and the threshold voltage at which it switches. Vh is "hysteresis voltage". Set it to some positive value like 0.4V and there won't be any clicking sounds when the switch opens and closes.
>>>Update: here's an even easier way to make a gated noise source- just multiply the noise voltage by a pulsed source- see easy_gated_noise.asc, below.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|
















































