MATLAB: Define a sine wave with fade in and out

sine wave

Hi
I neeed to create a wav file, from a specific sine wave. This sine wave comprising 3 sinusoidal partials of 500, 100, 1500 Hz with a duration of 75ms . Furthermore the sine wave must be created with something like a ramp function – like a "rise" and "fall" time – of 5 ms in the start and end of the sine wave. This is to make the sine sound like it's fading in and out..
How do I make this sine fading?

Best Answer

What have you tried so far?
Make a 1/4 period of a sine wave with a period of 20 ms. Make a 1/4 period of a sine wave with a period of 20 ms and a phase of pi/2. Make a vector of ones with a duration of 65 ms. Stick them all together, making sure that in the end you get an array with the same length equal to the length of you sound. Multiple this "window" with your sound.
Related Question