Tutorial 2: Delay Based Effects
In this section, we define a function to create echo effect on input audio. Echo can be modeled as attenuated, delayed copies of the original signal added to itself. Here, it can be seen as an FIR filtering operation. The FIR filter we constructed is of form [1, delayed_sec*Fs-1, a], where delayed_sec is the number of seconds for the echo to arrive and a: 0<a<=1.
We can also make the amount of delay a function of time to make more interesting effects, such as flanger. The following function implements the flanger effect using a triangular function for time-varying delay, shown in the figure below..
Source code and test audio file: tutorial2