voice recod dsk6713

Upload: ashish-mangal

Post on 02-Jun-2018

245 views

Category:

Documents


3 download

TRANSCRIPT

  • 8/10/2019 VOice recod DSK6713

    1/14

    MINIPROJECT DOCUMENTATION ON

    VOICE RECORDING AND PLAYBACK USING DSK6713

    BATCH: 2007-2011

    GOKARAJU RANGARAJU INSTITUTE OF

    ENGINEERING AND TECHNOLOGY

    (Affiliated to Jawaharlal Nehru Technological University)

    HYDERABAD

    SUMEETH JAJU

    07241A04B1

    ECE-B

  • 8/10/2019 VOice recod DSK6713

    2/14

    MINIPROJECT DOCUMENTATION ON

    VOICE RECORDING AND PLAYBACK USING DSK6713

    Introduction :

    The basic system consists of an analog-to-digital converter (ADC) to capture an inputsignal. The resulting digital representation of the captured signal is thenprocessed by a digital

    signal processor such as the C6x and then output through adigital-to-analog converter (DAC).

    Also included within the basic system are a special input filter for anti-aliasing to eliminateerroneous signals and an outputfilter to smooth or reconstruct the processed output signal.

    Digital signal processors such as the TMS320C6x (C6x) family of processors are like fast

    special-purpose microprocessors with a specialized type of architecture and an instruction set

    appropriate for signal processing. The C6x notation is used to designate a member of TexasInstruments (TI) TMS320C6000 family of digital signal processors. The architecture of the C6x

    digital signal processor is very well suited for numerically intensive calculations. Based on a

    very-long-instruction-word

    (VLIW) architecture, the C6x is considered to be TIs most powerful processor.

    Applications:

    Digital signal processors are used for a wide range of applications, from communications

    and controls to speech and image processing. The general-purpose digital signal processor is

    dominated by applications in communications (cellular).

    Applications embedded digital signal processors are dominated by consumer products.

    They are found in cellular phones, fax/modems, disk drives, radio, printers, MP3 players, high-

    definition television (HDTV), digital cameras, and so on.

    DSP techniques have been very successful because of the development of low-cost

    software and hardware support. For example, modems and speech recognition can be lessexpensive use DSP techniques.

  • 8/10/2019 VOice recod DSK6713

    3/14

    DSP SUPPORT TOOLS:

    1. TIs DSP starter kit (DSK). The DSK package includes:(a) Code Composer Studio (CCS), which provides the necessary software support tools.CCS

    provides an integrated development environment (IDE), bringing together the C compiler,

    assembler, linker, debugger, and so on.(b) The contains the TMS320C6713 (C6713) floating-point digital signal processor as well as a

    32-bit stereo codec for input and output (I/O) support.

    (c) A universal synchronous bus (USB) cable that connects the DSK board to a PC.(d) A 5V power supply for the DSK board.

    2. An IBM-compatible PC. The DSK board connects to the USB port of the PC through the USB

    cable included with the DSK package.3. An oscilloscope, signal generator, and speakers. A signal/spectrum analyzer is optional.

    Shareware utilities are available that utilize the PC and a sound card to create a virtual instrument

    such as an oscilloscope, a function generator, or

    a spectrum analyzer.

    DSP BOARD:

    The DSK board, with an approximate size of 5 X 8 inches includes the C6713 floating-

    point digital signal processor and a 32-bit stereo codec TLV320AIC23 (AIC23) for input andoutput.

    The onboard codec AIC23 [37] uses a sigmadelta technology that provides ADC and

    DAC. It connects to a 12-MHz system clock. Variable sampling rates from 8 to 96 kHz can beset readily.

    A daughter card expansion is also provided on the DSK board. Two 80-pin connectors

    provide for external peripheral and external memory interfaces. The DSK board includes 16MB(megabytes) of synchronous dynamic random access memory (SDRAM) and 256kB of flash

    memory. Four connectors on the board provide input and output: MIC IN for microphone input,

    LINE IN for line input, LINE OUT for line output, and HEADPHONE for a headphone output(multiplexed with line output). The status of the four user dip switches provides the user with a

    feedback control interface.

  • 8/10/2019 VOice recod DSK6713

    4/14

    TMS320C6713 Digital Signal Processor: The C67xx (such as the C6701, C6711, and C6713) belong to the family of the C6x

    floating-point processors, whereas the C62xx and C64xx belong to the family of the C6x

    fixed-point processors. The C6713 is capable of both fixed- and floating point processing.

    CODE COMPOSER STUDIO:

    CCS provides an IDE to incorporate the software tools. CCS includes tools for code

    generation, such as a C compiler, an assembler, and a linker. It has graphical capabilities and supports real-time debugging. It provides an easy-to-use

    software tool to build and debug programs.

    The C compiler compiles a C source program with extension .c to produce an assembly sourcefile with extension.asm.The assembler assembles an.asm source file to produce a machine

    language object file with extension.obj.The linker combines

    object files and object libraries as input to produce an executable file with extension.out. This

    executable file represents a linked common object file format (COFF), popular in Unix-basedsystems and adopted by several makers of digital signal processors . This executable file can be

    loaded and run directly on the C6713 processor.

  • 8/10/2019 VOice recod DSK6713

    5/14

    CCS Installation and Support:A number of files included in the following subfolders/directories within c:\C6713 (suggested

    structure during CCS installation) can be very useful:

    1. myprojects: a folder supplied only for your projects.

    2. bin:contains many utilities.3. docs:contains documentation and manuals.

    4. c6000\cgtools:contains code generation tools.

    5. c6000\RTDX:contains support files for real-time data transfer.6. c6000\bios:contains support files for DSP/BIOS.

    7. examples: contains examples included with CCS.

    8. tutorial:contains additional examples supplied with CCS.

    Useful Types of Files:

    1. file.pjt: to create and build a project named file

    2. file.c:C source program

    3. file.asm: assembly source program created by the user, by the C compiler, or by the linearoptimizer

    4. file.sa:linear assembly source program.The linear optimizer uses file.sa as input to produce anassembly program file.asm

    5. file.h:header support file

    6. file.lib:library file, such as the run-time support library filerts6700.lib

    7. file.cmd:linker command file that maps sections to memory

    8. file.obj:object file created by the assembler9. file.out:executable file created by the linker to be loaded and run on the C6713 processor

    10. file.cdb:configuration file when using DSP/BIOS

    SUPPORT FILES:

    1. C6713dskinit.c: contains functions to initialize the DSK, the codec, the serial ports, and for

    I/O. It is not included with CCS.2. C6713dskinit.h: header file with function prototypes. Features such as those used to select the

    mic input in lieu of line input (by default), input gain, and so on are obtained from this header

    file (modified from a similar file included with CCS).3. C6713dsk.cmd: sample linker command file. This generic file can be changed when using

    external memory in lieu of internal memory.

    4. Vectors_intr.asm: a modified version of a vector file included with CCS to handle interrupts.Twelve interrupts, INT4 through INT15, are available, and INT11 is selected within this vector

    file.They are used for interrupt-driven programs.

    5. Vectors_poll.asm: vector file for programs using polling.

    6. rts6700.lib,dsk6713bsl.lib,csl6713.lib: run-time, board, and

    chip support library files, respectively. These files are included with CCS and are located

    inC6000\cgtools\lib, C6000\dsk6713\lib, and c6000\bios\lib, respectively.

    Input and Output with the DSK:

  • 8/10/2019 VOice recod DSK6713

    6/14

    The DSK board includes the TLV320AIC23 (AIC23) codec for input and output.The ADC

    circuitry on the codec converts the input analog signal to a digital representation to be

    processed by the DSP. The maximum level of the input signal to be converted is

    determined by the specific ADC circuitry on the codec, which is 6Vp-p with the onboard

    codec. After the captured signal is processed, the result needs to be sent to the outsideworld. Along the output path is a DAC, which performs the reverse operation of the ADC.

    An output filter smooths out or reconstructs the output signal. ADC, DAC, and all required

    filtering functions are performed by the single-chip codec AIC23 on board the DSK.TheAIC23 is a stereo audio codec based on sigmadelta technology [15].

    Sigmadelta converters can achieve high resolution with high oversampling ratios but withlower sampling rates. They belong to a category in which the sampling rate can be much

    higher than the Nyquist rate. Sample rates of 8, 16, 24, 32,44.1, 48, and 96kHz aresupported and can be readily set in the program.

    A digital interpolation filter produces the oversampling. The quantization noise power in such

    devices is independent of the sampling rate. A modulator is included to shape the noise so that itis spread beyond the range of interest. The noise spectrum

    is distributed between 0 and Fs/2, so that only a small amount of noise is within the signal

    frequency band. Therefore, within the actual band of interest, the noise power is considerably

    lower. A digital filter is also included to remove the out-ofband noise.A 12-MHz crystal supplies the clocking to the AIC23 codec (as well as to the DSP and the USB

    interface).The sampling rate is set by the codecs register SAMPLERATE.The ADC converts an input signal into discrete output digital words in a 2scomplement format

    that corresponds to the analog signal value. The DAC includes an interpolation filter and a digital

    modulator.A decimation filter reduces the digital data rate to the sampling rate.The DACsoutput is first passed through an internal

    lowpass reconstruction filter to produce an output analog signal. Low noise performance for both

    ADC and DAC is achieved using oversampling techniques with noise shaping provided by

    sigmadelta modulators.

    Creating Project:

    1. To create the project file Voice_Recording_and_Playback.pjt, Select Project New. Type

    Voice_Recording_and_Playback for the project name. This project file is saved in the folder

  • 8/10/2019 VOice recod DSK6713

    7/14

    Voice_Recording_and_Playback(withinc:\ccstudio_v3.1\myprojects).The .pjt file stores project

    information on build options, source filenames, and dependencies.2. To add files to the project. Select Project , Add Files to Project. Look in the folder support,

    Files of type C Source Files. Double-click on the C source file C6713dskinit.c to add it to the

    project. Click on the + symbol to the left of the Project Files window within CCS to expand

    and verify that this C source file has been added to the project.3. Repeat step 2, use the pull-down menu for Files of type, and select ASM Source Files.

    Double-click on the assembly source vector file vectors_poll.asm to add it to the project. Repeat

    again and select Files of type: Linker Command File, and add C6713dsk.cmd to the project.4. To add the library support files to the project. Repeat the previous step, but select files of type:

    Object and Library Files. Look in c:\c6713\c6000\cgtools\lib and select the run-time support

    library file rts6700.lib (which supports the C67x architecture) to add to the project. Continue thisprocess to add the BSL file dsk6713bsl.lib located in c:\c6713\c6000\dsk6713\lib, and the chip

    support library (CSL) file csl6713.lib located in c:/c6713\c6000\bios\lib.

    5. Verify from the Files window that the project (.pjt) file, the linker command (.cmd) file, the

    three library (.lib) files, the two C source (.c) files, and the assembly (.asm) file have been added

    to the project. The GEL file dsk6713.gel is added automatically when you create the project. Itinitializes the C6713 DSK invoking the BSL to use the phase-locked loop (PLL) to set the

    central processing unit (CPU) clock to 225MHz (otherwise, the C6713runs at 50 MHz by default).

    6. Select Project : Scan All File Dependencies. This adds/includes the header files

    c6713dskinit.h, along with several board and chip support header files included with CCS.

  • 8/10/2019 VOice recod DSK6713

    8/14

    Code Generation and Options:

    It includes two methods: Compiler options

    Linker options.

  • 8/10/2019 VOice recod DSK6713

    9/14

    Compiler options:

  • 8/10/2019 VOice recod DSK6713

    10/14

    Linker options:

    Building and Running the Project

    Correcting Program Errors

  • 8/10/2019 VOice recod DSK6713

    11/14

    FLOW CHART:

  • 8/10/2019 VOice recod DSK6713

    12/14

  • 8/10/2019 VOice recod DSK6713

    13/14

    C PROGRAM:

    #include "dsk6713_aic23.h" //codec support

    Uint32 fs=DSK6713_AIC23_FREQ_8KHZ; //set sampling rate

    #define DSK6713_AIC23_INPUT_MIC 0x0015

    #define DSK6713_AIC23_INPUT_LINE 0x0011Uint16 inputsource=DSK6713_AIC23_INPUT_MIC;

    #define N 2400000

    long i;short buffer[N];

    #pragma DATA_SECTION(buffer,".EXT_RAM")

    void main()

    {

    short recording = 0;

    short playing = 0;

    for (i=0 ; i

  • 8/10/2019 VOice recod DSK6713

    14/14

    playing = 0;

    DSK6713_LED_off(0);}

    }

    }

    }}

    EXPLANATION:

    The sampling frequency is set to 8KHz.

    The input source is taken as mic. The output is taken from headphones.

    The pragma directive is used for allocating memory space in the external memory of size

    required for 300 sec. duration. Within the function main, the function comm_poll, is called that is located in the

    communication and initialization support file c6713dskinit.c. It initializes the DSK, the AIC23 codec onboard the DSK, and the two McBSPs on the

    C6713 processor. Within c6713dskinit.c, the function DSK6713_init initializes the BSL file, which must be

    called before the two subsequent BSL functions, DSK6713_LED_init and

    DSK6713_DIP_init, are invoked that initialize the four LEDs and the four dip switches. The statement while (1) within the function main creates an infinite loop. When dip switch

    #3 is pressed, LED #3 turns on and the voice is recording is started.

    When dip switch #3 is pressed, LED #3 turns on and the voice is recording is started. Whendip switch #0 is pressed, LED #0 turns on and the voice is playbacked.

    The voices are sampled at sampling frequency and the digital data is stored in buffer(external

    memory).

    The stored voice is playbacked until new voice is recorded.

    CONCLUSION:

    Thus recording and playback of voices is achieved using DSK6713.