LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Check out the related Code Repository Files or visit the LabVIEW Wiki Development Environment Portal


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> Creating sound with Fade in and fade out, Attempting to create a sound fade in method
crewex
post Aug 19 2008, 02:06 PM
Post #1


One hit wonder!


Member
Posts: 1
Joined: 5-August 08
Member No.: 12203
Using LabVIEW Since:2008
LV:8.5.1 ,. ,.
Nothing Selected Nothing Selected Nothing Selected


In developing a diagnostic medical device (similar to a hearing test) that uses pulsed sounds one has to create fade in and fade out.

WHY??

Because if you start and stop a sound a headset and it is stripped of file formating so all it is is a sound wave the speaker POPS!

The way to avoid this is to create a .5 - 1 second fade in where you linearly increase the amplitude of the wave.

Here is my problem, I'm using a while loop to create the desired sound pulse and ramp up. The loop is not looping fast enough to produce a nice smooth fade in, the steps are too large. The only way to make smaller steps would be to increase the length of time the fade in takes place. Any suggestions?

This post has been edited by crewex: Aug 19 2008, 02:07 PM
Attached thumbnail(s)
Attached Image
 

Attached File(s)
Attached File  Test_and_load_sound.vi ( 73.32K ) Number of downloads: 53
 


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Aug 19 2008, 02:06 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
LV_FPGA_SE
post Aug 19 2008, 03:01 PM
Post #2


Very Active
***

NI
Posts: 124
Joined: 28-October 05
From: Austin, TX
Member No.: 3370
Using LabVIEW Since:1993
LV:8.5.1 ,8.2.1 ,8.6
us_texas Canada Germany My Gallery


You'll want to use a second simple waveform (ramp up, ramp down) to scale your actual signal. So rather than varying the amplitude of the signal generator, use a constant amplitude and then scale the generated waveform by multiplying it by the ramp waveform.

Here's a partial solution showing how to generate a ramp up and using it to scale your sine signal. This will ramp up continuously so you'll need to figure out how to stop the ramp and keep it level at your final amplitude and then add the ramp down for the end of your signal.

Attached Image



--------------------
Christian L
NI Systems Engineering - Real-Time and Embedded Control Technologies
"I like my G code neat."


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
jdunham
post Aug 19 2008, 05:23 PM
Post #3


Very Active
***

Member
Posts: 231
Joined: 6-March 05
From: Mountain View, CA
Member No.: 1764
Using LabVIEW Since:1994
LV:8.5 ,. ,.
United States us_california Nothing Selected


QUOTE (LV_FPGA_SE @ Aug 19 2008, 08:01 AM) *
You'll want to use a second simple waveform (ramp up, ramp down) to scale your actual signal. So rather than varying the amplitude of the signal generator, use a constant amplitude and then scale the generated waveform by multiplying it by the ramp waveform.


The Windowing functions are also commonly used for this purpose. (Palettes -> Signal Processing -> Windows) Cosine window is pretty good. It's easier than a ramp because you don't have to calculate the starting and stopping. It gets trickier if you signal spans mulitple iterations of the loop, and if you can't pre-generate the whole signal at once, but it doesn't seem like you are in that situation.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 8th January 2009 - 10:18 PM