Document Sample
048 Powered By Docstoc
                                            Peter Kubinec
 Department of radioelectronics, FEI-STU, Ilkovičova 3, 812 19 Bratislava, Slovak Republic
       tel. No:00421-7-60291-647(answ.) (743, 674), E-mail:
        There is an digital audio effect called pitch transposer described in this paper. It shifts
spectrum of an input signal to higher or lover frequencies maintaining its time duration. Using
FIR filters it splits signal into two parts which are processed independently and then summed
together. As a result is better damping of unwanted amplitude modulation at certain input sig-
nal frequencies. Also, the algorithm was implemented into DSP starterkit with TMS320C26
processor and output signal was measured.
There are two approaches how to make the frequency shift of signal; first works in so called
time domain - it means sampled signal is stored into circular buffer in memory and then in is
read with non equal speed as he was written using interpolation. Second approach means: to
transform input signal into frequency domain using a FFT, then manipulate with coefficients
and finally do an IFFT. The algorithm described here works in time domain, there is introdu-
ced more elaborated version as it has published in [4]. The article was ispirated by [1,2,3].
The focus was put on better elimination of discontinuities they appear by reading of data me-
Theory of operation
The algorithm previously published in [1] writes samples of input sampled signal into circular
buffer, so the oldiest sample written is overwritten by newest one. Then there are four loca-
tions in that buffer where are samples read from. At these locations point four read pointers.
They are moving along the circular buffer, but their speed or better said incrementation is
different from regulary incrementation of write pointer; it is controlled by fractional arithme-
tics [1]. They can move faster or slower then write pointer, so they can overtake it or be o-
vertaken by it. Read pointers are divided into two twins; both twins are moving across buffer
always in oposite to each other; pointers of each twin are used to calculate linear interpolated
value between locations they are pointing. Finally, there are two values which are weighted
and then summed and outputed via D/A converter. Weighting depends on distance between
write pointer and the first resp. second twin of pointers. The smaller distance is, the lower is
the weight of interpolated value.This is done to avoid reading discontinuities they generaly
can arrise when pointers are overtaking the write pointer to each other. As was written above,
the partial signals came from two interpolation are added, distance between twins is equal to
half of circular buffer length and remains constant. There arise a comb filter which attenuates
some input frequencies f:
                   fs ⋅ (2 ⋅ n + 1)
              f=                           and            f < fs 2     (1)
where N is length of circular buffer and fs is the sampling frequency. This attenuation changes
in time, depending on the mutual instantaneous position of the pointers.
The aim was to make algorihm to be able to pass all input frequencies. If one of interpolated
value is inverted and then added then attenuated frequencies are:
                                           fs ⋅ 2 ⋅ n
                                      f=                         (2)

It looks simply, to put the input signal into two paralel circular buffers, and their outputs add,
but again, there are new group of frequencies, where won‘t pass through algorithm without
being affected by the AM modulation. This „interference“ wouldn‘t have been happened if
the signal, entering both buffers didn‘t contain the same frequency spectrum. So if the input
signal is splited by passing through two filters, there wouldn‘t be any interfrerence. These
filters would have periodical frequency response (comb like) and after adding their outputs
final frequency response would be frequency independent. Figure 1 shows, how the signal
path looks like:

                                                                r14      lin. iterp.

                                                w1                              -1
                                 fs                    r12
 Input signal       filter 1
                                              lin. iterp.

                    filter 2                                    r24      lin. iterp.
                                                                   r23                          Σ
                                              lin. iterp.

       Fig.1: The block diagram of the pitch transposer. (wx,rx are write,read- pointers).
As input splitting filters are used two most simple filters – first order FIR filters, which can be

          H1(z ) = 0.5 − 0.5 ⋅ z −N 2   and     H2 (z ) = 0.5 + 0.5 ⋅ z −N 2           (3,4).
Because the frequency responses of filter overlap, output signal still suffers from modulation,
but although there were no overlaping (use of higher order filter), there is coming back mo-
dulation from simply, single-circular buffer algorithm. The use of linear interpolation is for its
simplicity and that for aim this work (periodical frequency behavior) wasn‘n necessary to use
more precise one – differencies in precision will appear mostly at higer input frequencies.
The algorithm described here was implemented into DSP starterkit with TMS 320C26 by Te-
xas Instruments. Sampling frequency of 14bit-codec TLC 32040 was set to 17950Hz. The
lenghts of circular buffers were 256. Input signal frequency was chosen about 2100Hz, but
precisely tuned, to show the worst and the best case –see later. At first, there were measured
splitting filters, their minims have been repeated periodicaly with period 140Hz, and minims
have been alternated to each other. Then was measured whole algorithm, modulation at its
output was most apparent at the other groups of frequencies. Tab.1 are shown frequencies,
where minimum and modulation encoutered.

Tab.1. – Frequencies (in Hz), where minimum encoutered or corruption was the deepest. Me-
         asured by the frequency counter KABiD ZOPAN KZ2026A and the scope CI 140.
           filter „1“       2031      2171      2310      2450
           whole algorithm.   2065 2136 2205 2275 2345 2416
           filter „2“            2100      2240      2380

The next waveforms were maesured by soudblaster audio card (its sampling freq. was set to
32kHz, 16bit resolution) end visualised by software Cooledit96. There is depicted an output
signal; frequency of input signal are chosen to show: the worst case – deep corruption of an
output signal (fig.2), intermediate (fig.3) and the best case without corruption (fig.4). Output
signal has not even high of peaks because of linear interpolation (in stabil region).

                                                                             samples (time)

               Fig.2 – The measured waveform of the output signal, worst case.

               Fig.3 – The measured waveform of the output signal, better case.

           Fig.4 – The measured waveform of the output signal, without corruption.

      [1] J. C. Dattorro, "Effect design, part 2: Delay Line Modulation and Chorus" Journal of
the Audio Engineering Society, vol. 45, pp. 764-788 (1998 Oct.).

     [2] L. R. Rabiner, "Digital Techniques for Changing the Sampling Rate of a Signal"
Collected Papers from the AES Premiere Conference,Rye, New York 1982, June 3-6.

     [3] C. Smetana & col.,"Praktická elektroakustika" SNTL Praha 1981, str. 237

      [4] Kubinec, P.: A pitch transposer with TMS320C26 - a digital sound effect. Interna-
tional conference Radioelektronika 1999, Brno 1999, Czech republic.
   This work is supported by the Ministry of Education of the Slovak Republic under
                               Grant No. 102/VTP/2000.


Shared By: