crewex Posted August 20, 2008 Report Share Posted August 20, 2008 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? Quote Link to comment
LAVA 1.0 Content Posted August 20, 2008 Report Share Posted August 20, 2008 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. Quote Link to comment
jdunham Posted August 20, 2008 Report Share Posted August 20, 2008 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.