Sie sind auf Seite 1von 12

THE GEORGE WASHINGTON UNIVERSITY

Peak Program Meter


Real-Time Digital Signal Processing-ECE 294
Tamir Bushra Suliman

Spring 2009
Professor: Milos Doroslovacki

Peak Program Meter


Tamir Suliman
Abstract-The good thing about volume unit VU Meters is that they show
you the average level of the signal- so they're great for recording to analog
tape or for mastering purposes where you want to know the overall general
level of the signal. However, they're very bad at telling you the peak level of
the signal. This paper focuses on the design and the implementation of a
peak program meter, which features a data-acquisition system, using a
C6713 DSP-based starter kit (DSK).

I. Introduction and Motivation

T
he last four decades have witnessed digital signal processing (DSP)
becoming a very well established discipline. DSP finds applications in
numerous fields, e.g. speech processing, communications and bio-
medical engineering. The ease of manipulating discrete-time data and the
abundant theoretical background, together with the low cost and availability
of sampling and processing hardware, makes digital solutions a first choice,
when handling continuous-time signals. It is therefore not surprising that the
Hi-Tech industry is craving for young engineers with profound theoretical
knowledge as well as application skills.
Most DSP algorithms are not very complicated. The good news is that most
major DSP manufacturers (e.g., Motorola, Texas Instruments, Analog
Devices, etc.) now provide low-cost evaluation
platforms for their DSP chips. Software almost always
includes assemblers, linkers, and simulators. The challenge
Implement Peak Program
A C compiler is often available. (The fact that a C
Meter based on the C6713
compiler can be used does not invalidate the need for
DSK starter kit that detect
the programmer to understand the architecture of the
and provide LED indication
DSP chip, though if the application represents a very
of/warning whenever an
light load on the processor, the programmer can
output value is
postpone detailed study during earlier stages in the
approaching the range
design process.) A major factor in choosing a DSP chip
limit of the DAC.
is whether it employs floating or fixed point math.
Fixed-point chips are generally much cheaper, but
floating point chips are easier to program (since one
does not have to worry about certain effects the fixed-

2
point math can produce).An increasingly popular trend in speech and audio
processing leads to the importance of getting the accurate measuring for
those signals.

Historically volume unit meters (VU) were used in audio systems to monitor
the signals level.VU meters however have displayed accuracy problems that
are largely due to the fact that meter takes an average measurement that is
severely restricted by the ballistics of the mechanical metering system.

This can result in short, but very loud transients being missed or improperly
displayed. More recently audio equipment manufacturers developed the
peak program meter (PPM) to overcome the VU meter’s lackluster
performance at displaying peak signal levels.

In the other hand, there are many applications where we need to know
exactly what the peak level of the signal is. Once upon a time, the only place
where this was necessary was in broadcasting - because if you overload a
transmitter, bad things happen. So, the people in the broadcasting world
didn't have much use for the VU Meter - they needed to see the peak of the
program material, so the Peak Program Meter or PPM was developed in
Europe around the same time as the VU Meter was in development in the US.

A PPM is substantially different from a VU Meter in many respects. These


days it has many different incarnations - particularly in its scale, but the
traditional one that most people think of is the UK PPM (also known as the
BBC PPM).

There are a number of other PPM Scales available to the buying public. In
addition to the UK PPM, there's the EBU PPM, the DIN PPM and the Nordic
PPM. Each of these has a different scale as is shown in Table 10.1 and the
corresponding Figure 1.1.

2
Figure 1 VU and PPM scales

II. Peak Program Meter Overview


As we referenced the PPM improves on the VU meter’s performance
problems by integrating the signal for 5 ms. this integration process will then
only detects peaks that are long enough to be heard by typical human
listener. There are two types of PPMs:

A. Type I PPM's

The attack time of type I PPM is defined using an integration time of 5 ms -


which corresponds to a time constant of 1.7 m.s. Therefore, a tone burst that
is 10 ms long will result in the indicator being 1 dB lower than the correct
level. If the burst is 5 ms long, the indicator will be 2 dB down, a 3 m.s burst
will result in an indicator that is 4 dB down. The shorter the burst, the more
inaccurate the reading will be. (Note however, that this is significantly faster
than the VU Meter.)Again, unlike the VU meter, the decay time of a Type I

1
PPM is not the reciprocal of the attack curve. This is defined by how quickly
the indicator drops - in this case, the indicator will drop 20 dB in 1.4 to 2.0
seconds.

B. Type II PPM's

The attack time of a Type II PPM is identical to a (Type I PPM).The decay of a


Type II PPM is somewhat different from its Type I cousin. The indicator falls
back at a rate of 24 dB in 2.5 to 3.1 seconds. In addition, there is a ``hold''
function on the peak where the indicator is held for 75 ms to 150 ms before
it starts to decay.

I. DSP system and PPM

To avoid unintended distortion we have to ensure that the analog signal that
is digitized by the analog to digital converter (ADC) shouldn’t exceed the
maximum voltage range of the converter. In other words, to be careful to
ensure that the ADC is not driven beyond the maximum input voltages
range, in either the positive or negative directions.

Even if the input analog signal remains within the proper range of the ADC, it
is still possible to distort the signal by exceeding the output range of the
digital to analog converter (DAC).As an example, the possible range for a 16
bit converter using two complement representations is +32,767 to
-32,768.The only way the signal can exceed the output range for the DAC is
if the DSP algorithm has a gain that exceeds 1.0.

II. TI C6713 and CCS

The Embedded Target for TI


C6000 DSP provides the APIs
required by real time workshop
to generate a code specifically
for the C6000 platform. Code
Composer Studio (CCS) is used

Figure 2 Diagnostic utility for DSK kit


to invoke the C code building process. This code can then be downloaded on
the target from where it runs. CCS diagnostic test is shown in Figure
Code Composer Studio or CCS provides an integrated development for IDE
for real time digital signal processing applications based on the C
programming language. It incorporates a C compiler, an assembler, and a
linker .It has graphical capabilities and support real time debugging.

Most of the work presented in this paper used the following tools:

1- A Texas Instruments DSP starter kit DSK which includes:


a- Code Composer Studio
b- A Circuit board (the TMS320C6713) is shown in Fig containing a
digital signal processor and a 16 bit stereo codec for analog input
and output signal.
c- A Universal Synchronous Bus (USB) cable that connects the DSK
board and the PC
d- Power Supply +5 v for the DSK board
e- PC
f- Oscilloscope, signal generator and audio cables.

I. DSK
Implementation in C

Like Figure 3 TMS320C6713 Board


the VU
meter and PPM, the primary function of this program is to detect and provide
an LED indication /warning whenever an output value is approaching the
range limit of the DAC. Since these condition are checked every Ts =1/Fs, a
dwell time is required to maintain the ON status of each of LEDs without this
dwell time the LED would cycle on/off too rapidly to be visible. The output
value s above which an LED turns ON were chosen to be ±28000, ±32000,

2
±32767.These turn on levels are shown the Figure below , where the
sinusoidal signal is at the maximum amplitude for the DAC.

The LEDs on the DSK are controlled by updating the bit pattern at IO PORT
address (0x90008000) with the function UpdateLEDs () in the main program

II.II. Initial setup for TMS 320C6713 and the C code explanation

Figure 4 PPM LED Utilization for a sine wave

1- The Setup

In this experiment an audio cable from the signal generator is connected to


Line In connector of C6713 DSK and line out from the DSK are connected to
the oscilloscope channel as an output.
To build and run the model, the following tasks are to be completed.

➢ Tested the board connectivity by running the diagnostic tests utility.


➢ Ensure that project build options has the right settings and that it
points toward the folder locations
➢ Build the model and add the required configurations files to your
project
➢ Run the program and compile it and modify it in case of any errors
➢ Observe the LEDs output while you increasing or decreasing the signal
amplitude

1- The C Code

2
1. The first lines determine maxOutput (The maximum of the absolute
value of both the left and the right output channels.

maxOutput = _fabsf(outputLeft);
if(maxOutput < _fabsf(outputRight))
maxOutput = _fabsf(outputRight);

2. If the maxOutput is greater than 32676 in magnitude then LEDs 1, 2, 3


are turned ON. Counters for LED 1 ,2 ,and 3 are set at 14400,9600 ,
and 4800 these counter values keep LEDs 1 ,2 , and 3 ON for .3 .2 ,
and .1 seconds respectively.

if (maxOutput > 32767) {


LED_3_counter = RESET;
LED_2_counter = RESET * 2;
LED_1_counter = RESET * 3; }
}

3. If the maxOutput is greater than 32000 in magnitude then LEDs 1 and


2 are turned ON. Counters for LED 1 and 2 are set at 9600 and 4800
counter values keep LEDs 1, 2, and ON for .2, and .1 seconds
respectively.

else if (maxOutput > 32000) {


if(LED_2_counter < RESET)
LED_2_counter = RESET;
if(LED_1_counter < RESET * 2)
LED_1_counter = RESET * 2;
}

1
4. If the maxOutput is greater than 28000 in magnitude then LEDs 1
turned ON. Counter for LED 1 is set at 4800 counter values keep LEDs
1 ON for .1 seconds respectively.

else if (maxOutput > 28000) {


if(LED_1_counter < RESET)
LED_1_counter = RESET;
}

5. Updates the LED Mask based on the status of the LED counters

6. Calls the UpdateLEDs () subroutine, which as its name implies updates


the status of the system’s LEDs.

LED_Mask = 0; // all LEDs off


if (LED_3_counter) {
LED_3_counter--;
LED_Mask |= LED3_BIT; // LED3 on
}
if (LED_2_counter) {
LED_2_counter--;
LED_Mask |= LED2_BIT; // LED2 on
}
if (LED_1_counter) {
LED_1_counter--;
LED_Mask |= LED1_BIT; // LED1 on }
UpdateLEDs(LED_Mask); // update LED status

1
I. Conclusion

Its general function is similar to a VU meter but there are some important
differences. The rise time of a PPM (the time it takes to register the level of a
sound) is much faster than a VU meter, typically 10 milliseconds compared
to 300 milliseconds. This makes transient peaks easier to measure. PPM
meters are very good for reading fast, transient sounds. This is especially
useful in situations where pops and distortion are a problem. The fall time of
a PPM (the time it takes the meter to return to a lower reading) is much
slower.

2
References
[1] S K Hasnain and Pervez Akhter, Digital Signal Processing (Theory and worked examples)-
Jan 2006.

[2] Thad B. Welch, Cameron H. G. Wright, Michael G. Real-time digital signal


processing from MATLAB to C with the TMS320C6x DSK

[3] Texas Instruments Inc., TMS320C6713 DSK User’s Guide, 2005.

[4] http://www.redcedar.com/learndsp.htm

[5] http://www.mediacollege.com/audio/monitoring/ppm.html

[6] http://www.mediacollege.com/audio/monitoring/ppm.html

[7] http://www.sweetwater.com/expert-center/glossary/t--PPM

2
3

Das könnte Ihnen auch gefallen