ijjss06-204

Embed Size (px)

Citation preview

  • 8/13/2019 ijjss06-204

    1/6

    Abstract---We review the design of three audio effect

    using TMS320 C6713 DSK. The effect has different

    types, which are fuzz, echo, and reverb. The

    applications of the effects are widely used in music and

    entertainment industry. Our design has effectively

    implemented the algorithm on a low cost platform DSP

    board using C programming. The results are analyzed

    using FFT method and to be assesed for meeting the

    design purpose. The results shows that TMS320 C6713

    DSK designs, can be develop into a real-time applicationfor audio effects in electronic devices and acoustic.

    Keyword---Audio effect, Algorithm

    I. INTRODUCTION

    Audio effects are one of many applications ofDSP. The principle of an audio effect is to manipulate

    input signals to a new output signal just as expected. In

    daily life, audio effects are commonly used inentertainment industry. Before digital era, audio effects

    are created using analog circuit, but the use of analog

    circuit for multiple audio effects in one circuit needs avery complex circuit. This complex circuit refers to time,

    budget, and also inflexibility. Audio effects using a DSPprocessor is not as complex as the audio effects build

    using an analog circuit. Even though using a DSP

    processor can create multiple audio signals in one project,the circuit is not significantly change or added, but the

    program will be much more complex. The DSP processor

    that is use in this audio effects design is the DSK

    TMS320C6713. In the DSK, applications build in

    algorithms using the C language, or the Assembler

    language. So the first thing to do is to do the coding. Thenafter the coding is done, the algorithm can be implicated

    directly to the DSK, and then the output and theperformance of the program can be analyzed.In general, audio effects are classified into three

    types, which are Drive/Distortion, Modulation, and

    Ambience. Before implementing these effects in the DSKTMS320C6713, we have to know how these audio effects

    works. Knowing how it works will help us to make the

    algorithm of the audio effects.

    ANALYSIS OF REAL TIME AUDIO EFFECT DESIGN

    USING TMS320 C6713 DSK

    Rio Harlan, Fajar Dwisatyo, Hafizh Fazha, M. Suryanegara, Dadang Gunawan

    Departemen Elektro Fakultas Teknik Universitas IndonesiaKampus Baru UI Depok

    [email protected],

    [email protected]

    This paper will review about the performance ofa real-time audio effects design for fuzz, echo, and reverb.

    The DSK TMS320C6713 is used for the design process.

    The result shows that designing using the DSP board, can

    be develop into a real-time application for audio effects inelectronic devices and acoustic. So then the design can be

    written in the C6713 chip device and can be fabricated.

    II. AUDIO EFFECT IN DSP BOARD

    A. DSP BOARD TMS320 C6713

    DSK TMS320 C6713 is a DSP board, a platform

    where someone can build a signal processing application

    by writing a program in the DSP board [1].

    The process of the DSP board is very simple, the

    analog signal coming from port mic in/line in then, it issampled to digital signal by the codec. After that, the

    signal will be processed digitally by the DSP. How the

    DSP process this signal depends on how the user programthe DSP board. Then, the output signal will be release

    thru line out/headphone.

    As mentioned before, signal processing by DSPdepends on program algorithm given from user to theDSP processor. Writing a program in the DSP processor

    is as same as writing a program in other processors, which

    is using the machine language or assembler. As an

    alternative, we can also use C language to program theDSP processor. To development an application with DSK,

    Texas Instrument provides software called Code

    Composer Studio (CCS). CCS is software that is used for

    interfacing user and the DSP board. CCS provides a workenvironment that contains all of the tools needed to

    program the DSP processor [3]. The tools are integrated

    with the CCS. It is also flexible software that can work

    together with popular software, such as MATLAB,LabView, Visual Basic, etc.

    B. FUZZ

    Basic principle of fuzz is making a harmonic

    distortion from a signal, it means occurrence of anotherfrequency component other than fundamental frequency.

    mailto:[email protected]:[email protected]
  • 8/13/2019 ijjss06-204

    2/6

    The method used to make harmonic distortion is clipping

    method. In this method, output value is limited in some

    range. When the output value surpasses this limit, output

    signal will automatically clip.

    0 2 4 6 8 10 12 14-1

    -0.8

    -0.6

    -0.4

    -0.2

    0

    0.2

    0.4

    0.6

    0.8

    1Grafik input

    Waktu

    Amplitudo

    Fig. 1. Input signal

    0 2 4 6 8 10 12 14-0.8

    -0.6

    -0.4

    -0.2

    0

    0.2

    0.4

    0.6

    0.8Grafik output

    Waktu

    Amplitudo

    Fig. 2. Clipped input signal

    Fig. 1 show input signal with assumed amplitude 1 volt.

    After the fuzz effect applied to the input, the result will

    showed in Fig. 2. It can be seen from this figure that

    signal is clipped at 0.7 volt changing the signal shape.

    C. ECHO

    Echo is a sound reflection that comes to thelistener in a period amount of time after the original sound.

    Generally, echo has a time delay that is relative long,which is more than 1 second. So that in echo effect, the

    true sound and the artificial sound are clearly separated,

    so that human hearings can tell the difference. The

    mechanism of echo can be seen below.

    Fig. 3. Echo mechanism

    As seen in Fig. 3, the signal goes from the sourceto the listener in two paths [2]. First, the signal from the

    source goes directly to the listener. Second, the signal

    goes to the wall and then reflected to the user. The secondprocess will takes more time than the first process, so the

    listener will hear two sounds in a different period of time.

    The signal power from the second process will be

    attenuated due to the reflection process.

    D. REVERBERATION

    Reverb is the sum of all sound reflections. The

    principle of reverberations is more like echo, but in reverb

    the sound reflections comes very often in a short period of

    time. In reverb effect, usually the listener can not tell the

    difference between the original sound and the reflectedsound. The mechanism can be seen below.

    Fig.4. Reverb mechanism

    Fig. 4 shows the mechanism of reverb effect.Every reflection from the source can be a new sound

    source. There are two important parameters in

    reverberation [5], which are:- Predelay, is the period amount of time of the first

    sound reflection

    - Reverb decay, is the period amount of time ofreverb since the input stops.

    III. DESIGN

    There are a few steps taken working in thisproject. The first step is to do an initialization on the

    board. There are many types of initialization. We

    initialize the board components that we use for the project.For example, in this audio effects project, the codec for

    audio input and output jack in this board must be

    initialized. If the other components like the switches and

    LEDs are used, its must be initialize first. The

    initialization can be written in C language.The next step is to write the main program. In

    this section, the input signal will be manipulated with a

    certain algorithm so that the output will create signals asexpected.

    With the help of CCS features and external

    analysis tools, the performance of the output such as

    attenuation, delay, and noise can be analyzed. From here,the performance of DSP also can be seen, and it

    represents the efficiency of the algorithm created by the

    user.

  • 8/13/2019 ijjss06-204

    3/6

    A. FUZZ

    From the principles explained above, the

    algorithm of fuzz effect can be made using C language.

    int fuzz(int input)

    {

    int output;

    output = gain * input;

    if (output > batasclip)

    {

    output = batasclip;

    }

    else if (output < -batasclip)

    {

    output = -batasclip;

    }

    return(output);

    }

    From the program above, the gain parameter and

    batasclip are the parameters that have been defined before.

    The use of the batasclip parameter is for the limit where a

    signal will be clipped. The gain parameter is needed tostrengthen the signal that is located under the clipping

    limit, so the signal will also be clipped.

    B. ECHO

    The algorithm of this effect can be seen below.

    int echo(int input){

    int temp,output;

    static int i=0;

    temp = buffer[i];

    buffer[i] = input;

    i++;

    if (i==buffer_size) i=0;

    output = temp * 0.5;

    output = output + input;

    return(output);

    }

    The main line of the algorithm is located in theend of the algorithm. In the end of the algorithm, the latest

    output will come together with the new output. The outputwill be attenuated, just like the theory of this effect. The

    attenuation value used in this algorithm is 50%. The

    buffer[i] parameter is an array that helps the delay process.In echo, the delay process is done in the input.

    C. REVERB

    The algorithm to implement this effect in DSK

    TMS320C6713 can bee seen below

    int reverb(int input)

    {

    int temp,output;static int i=0;

    temp = buffer1[i];

    output = temp * 0.5;

    output = output + input;buffer1[i] = output;

    i++;

    if (i==buffer_length) i=0;

    return(output);}

    The difference between the reverb algorithm andthe echo algorithm is not significant. The difference takes

    place in the program structure, and the delay process. Inreverb, the delay process is applied in the output. These

    differences create a different effect character.

    IV. RESULT AND DISCUSSION

    The result of this application is analyzed with

    audio editor software. A sinusoid signal with 1 kHzfrequency applied as the input to the board. This signal is

    generated using computer software and sent to the line in

    on the board. Then output from the board is sent to thecomputer to be analyzed in the same software.

    Fig. 6. Input signal in frequency domain

  • 8/13/2019 ijjss06-204

    4/6

    Fig. 7. FFT graph of output signal without effect

    Fig. 6 and Fig. 7 show the FFT (Fast Fourier

    Transform) graph of input and output signal without usingaudio effect algorithm where the axis represents the

    frequency of a signal in Hertz and ordinate represent the

    signal power in dB. It can be seen from the graph that inthe output, there are some other frequency component

    beside the fundamental frequency. These frequency

    components are not wanted and known as noise. But if welook from signal intensity, the noise signals have a very

    low power compare to the main signal, which is causingthe noise effect not significant. Next, if the input and

    output is compared, it will be found that there are 9,64 dB

    of attenuation between these signal. This attenuationoccurs because of the characteristic and setting from the

    board. But the attenuation will not be a big problem,

    because when the application running, the output can be

    amplified using an external amplifier.When fuzz effect algorithm is implemented to

    the input, the harmonic distortion will occur as can be

    seen in Fig. 8.

    Fig. 8. FFT graph of output signal from fuzz effect

    As it mention in the theory, that the harmonic

    distortion should occur in the odd number of harmonic. Inthe figure above, there are two main frequency

    components, 1 kHz and 3 kHz, which is match with the

    theory. However, there are other frequency components

    with lower power and unwanted around two main

    frequencies. These unwanted frequencies can occurbecause of the noises that already occur before, when the

    input is not using fuzz effect. Noise occurs because of

    some factor, for example a poor audio transmission cable,noise from other instrument that is used, etc. However,

    the signal that comes out from this fuzz effect is still can

    be heard as the original signal, it means the frequency that

    is heard is still 1 kHz, just in a distorted form. It can be

    proved from the graph where the signal that has thehighest power is 1 kHz.

    In delay based audio effect, the parameter thatcan be analyzed is the delay time. The delay time must be

    analyzed in time domain.

    Fig. 9. Echo output signal in time domain

    Fig. 9 show two output signals from echo effect. The

    original signal is in the left side while the reflected signal

    is in the right side. The delay time is measured from the

    beginning of the first signal to the second signal, resulting1,024 second. The attenuation between those signals can

    be measure by comparing the FFT graph.

    Fig. 10. FFT graph of original signal from echo effect

  • 8/13/2019 ijjss06-204

    5/6

    Fig. 11. FFT graph of reflected signal from echo effect

    From Fig. 10 and Fig. 11 show the attenuation between

    original signal and reflected signal is 6,19 dB. Noise in

    this graph is the same noise as discussed earlier.

    Fig. 12. Reverb output signal in t ime domain

    Fig. 12 shows the output result from reverb effect. As

    mention before, there are two parameter that can bemeasured in reverb effect, predelay and reverb decay,

    which are 320 ms and 2,239 s respectively. Theseparameter can be vary depend on buffer variable that is

    used in reverb algorithm. Same as echo effect, the

    attenuation between original signal and reflected signalcan be seen in FFT (Fig. 13 and Fig. 14). The attenuation

    is 6,09 dB and constant for every reflected signal.

    Fig. 13. FFT graph of original output signal from reverb effect

    Fig. 14. FFT graph of reverb reflected signal, showing the signalattenuation

    The time delay that is measured in echo and

    reverb effect depends on buffer value in its algorithm. Afurther analysis can be done by finding mathematical

    expression that shows relationship between these variablewith iteration method. With this function, we can easily

    control the time delay.

    0.3840.512

    0.64

    0.768

    0.896

    1.021

    1.1521.28

    1.408

    1.536

    0

    5000

    10000

    15000

    20000

    25000

    30000

    0 0.5 1 1.5 2

    Delay (s)

    Buffer

    Fig. 15. Iteration graph for echo effect

  • 8/13/2019 ijjss06-204

    6/6

    0.32

    0.448

    0.575

    0.704

    0.832

    0.96

    1.088

    1.216

    1.344

    1.472

    0

    5000

    10000

    15000

    20000

    25000

    0 0.5 1 1.5 2

    Delay (s)

    Buffer

    Fig. 16. Iteration graph for reverb effect

    Fig. 15 and Fig. 16 show the iteration graph from

    echo and reverb respectively. Because both graph are look

    similar, we may conclude that buffer value have sameimpact in echo and reverb algorithm. The relation

    between buffer and time delay can be written in

    mathematic expression, resulting y = 15627x + 2.6468and y = 15621x + 4,8843 for echo and reverb respectively.

    As we can see in both graph, y is defined as the buffervalue and x is defined as time delay.

    However, we found that there is a weakness inboth algorithms. The value of buffer is limited in some

    constant. If the value surpasses this limit, overflow can

    occur. This weakness shows that the algorithm is not

    perfect yet and has to be developed further.

    V. CONCLUSION

    The design of audio effect can be applied to the

    DSP board successfully. It also can be used in real time

    application. The input signal of audio effect can be a

    music instrument or voice. The measured performances inevery effect give a good result and the purpose of thedesign is met. Noises still occur in this application, but the

    effect is not significant so this noise will not disturb the

    process of application.

    VI. REFERENSI[1] TMS320C6713 DSK Technical Reference,

    Spectrum Digital, Inc., Mei 2003

    [2] Sikora R.,Implementing Echo and Reverberationusing the Audio Daughter Card and the

    TMS320C5402 DSK and the TMS320C6711 DSK,

    22 July 2001

    [3] Code Composer Studio Help, Texas Instrument,2003

    [4] Chassaing R., Digital Signal Processing andApplications with C6713 and C6416 DSK, John

    Wiley & Sons, Hoboken, New Jersey, 2005

    [5] Lehman,S.,Reverberation, http://www.harmony-

    central.com/Effects/Articles/Reverb/, 5 Juni 2006