Digital Signal Processing Reference
In-Depth Information
// Echo_control.gel Sliders vary time delay,amplitude,and type of echo
menuitem "Echo with Fading"
slider Amplitude(1,8,1,1,amplitude_parameter) /*incr by 1, up to 8*/
{
amplitude = amplitude_parameter; /*vary amplit of echo*/
}
slider Delay(1,8,1,1,delay_parameter)
/*incr by 1, up to 8*/
{
delay = delay_parameter; /*vary buffer size*/
}
slider Type(0,1,1,1,echo_typeparameter) /*incr by 1, up to 1*/
{
echo_type = echo_typeparameter; /*echo type for fading*/
}
FIGURE 2.18. GEL file for echo control of amplitude,
delay,
and fading
( echo_control.gel ).
tion 5, and set the delay slider to position 3. Since the delay is not equal to
delay_flag , the size of the buffer has changed. The new buffer size is
bufferlength = 1000
3000. These two slider settings correspond to
the same conditions as in Example 2.10. The delay slider can take on the values
1,2,...,8,allowing for buffer lengths of 1000, 2000, 3000,...,8000. Increase
the delay slider to position 4, and then to position 5, to produce a longer time
delay between the newest and oldest samples and listen to the echo effects.
3. The slider “type” in position 1 creates/adds a fading effect, since the output
becomes the most recent output. A clearer fading effect is produced just after
you stop “playing” the input .wav file.
¥
3
=
Experiment with the three sliders for different echo effects.
Example 2.12: Sine Generation with Table Values Generated
within the Program ( sinegen_table )
This example creates one period of sine data values for a table. Then these values
are output for generating a sine wave. Figure 2.19 shows a listing of the program
sinegen_table.c , which implements this project. The frequency generated is
f
800 Hz.
Build and run this project as sinegen_table . Verify a sine wave generated with
a frequency of 800 Hz. Change the number of points to generate a 400-Hz sine wave
(only table_size needs to be changed).
=
F s /(number of points)
=
8000/10
=
Search WWH ::




Custom Search