Write an application to read a wav file into an array and


Lab - Audio Processing

Theory:

Some interesting effects can be achieved by delaying audio samples. This introduces an echo effect to the audio samples. In listening spaces, the soundwaves reflect off surfaces and arrive at our ears with differing amounts of delay and gain. A single reflection or echo of a signal can be implemented by the following filter, which adds to the direct signal an attenuated and delayed copy of itself:

y(n) = x(n) + ax(n-D)

1796_Audio Processing.jpg

The following algorithm can accomplish the echo effect:
int delayMilliseconds = 500; // half a second

int delaySamples =
         (int)((float)delayMilliseconds * 44.1f); // assumes 44100 Hz sample rate

float decay = 0.5f;

for (int i = 0; i < buffer.length - delaySamples; i++)

{

buffer[i + delaySamples] += (short)((float)buffer[i] * decay);

}

Lab:

Write an application to read a wav file into an array and introduce a delay. Reduce the gain of the delayed sample and feed it back into the input to create an echo effect.

Request for Solution File

Ask an Expert for Answer!!
MATLAB Programming: Write an application to read a wav file into an array and
Reference No:- TGS02520334

Expected delivery within 24 Hours