Digital Signal Processing Reference
In-Depth Information
Rebuild the project, making sure that you are adding
c6713dskinit.c
from the
folder
loop
_
intr
(and not from the folder
support
). In this fashion, the correspond-
ing header file
c6713dskinit.h
that will be included will come from that same folder.
Load/run the executable file
loop
_
intr.out
, and verify that the output amplitude
is not attenuated and is the same as the input amplitude of 2 V p-p. Values for the
set-up register 0 from 0x0018 to 0x001c will cause the output amplitude to increase
from 0.8 to 2 V p-p.
The left input channel was selected since
input_sample
and
output_sample
default
to the left channel. Otherwise, if the right line-input volume is to be increased by
modifying the set-up register 1, an adapter/connector with two inputs and one
single-ended output connections would be needed. See Example 2.3 (
loop
_
stereo/
sine
_
stereo
).
Input from a Microphone
To select an input from a microphone in lieu of line input, modify the header file
set-up register 4 from 0x0011 to 0x0015 (third LSB as a 1) so that the ADC gets its
input from MIC IN. The microphone input and line input are multiplexed, and only
one is active at a time. Rebuild the project to verify your output, with the input to
the MIC IN connector.
Example 2.2: Loop Program Using Polling (
loop_poll
)
This example implements a polling-based loop program to illustrate the input and
output of a sample value every sample period
T
s
. Note that the program
loop_intr.c
in Example 2.1 is an interrupt-driven program. The C source
program
loop_poll.c
shown in Figure 2.5 implements this loop program. The
//
loop_poll.c
Loop program using polling.Output=delayed input
#include "DSK6713_AIC23.h" //codec-DSK file support
Uint32 fs=DSK6713_AIC23_FREQ_8KHZ; //set sampling rate
void main()
{
short sample_data;
comm_poll();
//init DSK, codec, McBSP
while(1)
//infinite loop
{
sample_data = input_sample(); //input sample
output_sample(sample_data); //output sample
}
}
FIGURE 2.5.
Loop program using polling (
loop_poll.c
).
Search WWH ::
Custom Search