real time dspprojetc-peak program meter-tamir suliman
TRANSCRIPT
-
8/8/2019 Real Time DSPprojetc-Peak Program Meter-Tamir Suliman
1/10
THE GEORGE WASHINGTON UNIVERSITY
Peak Program Meter
Real-Time Digital Signal Processing-ECE 294
Tamir Bushra Suliman
Spring 2009
Professor: Milos Doroslovacki
-
8/8/2019 Real Time DSPprojetc-Peak Program Meter-Tamir Suliman
2/10
2
The challenge
Implement Peak Program Mbased on the C6713 DSK sta
kit that detect and provide indication of/warning wheneve
output value is approachingrange limit of the DAC.
Peak Program MeterTamir 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 youwant 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 peakprogram meter, which features a data-acquisition system, using a C6713 DSP-based starter kit
(DSK).
I. Introduction and Motivation
he last four decades have witnessed digital signal processing(DSP) becoming a very wellestablished 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 ofsampling 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 foryoung engineers with profound theoreticalknowledge as well as application skills.
Most DSP algorithms are not very complicated. The good news is that most major DSPmanufacturers (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.
A C compiler is often available. (The fact that a C compiler can be
used does not invalidate the need for the programmer to understandthe architecture of the DSP chip, though if the application represents a
very light load on the processor, the programmer can postponedetailed study during earlier stages in the design process.) A major
factor in choosing a DSP chip 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 toworry about certain effects the fixed-point math can produce).An
increasingly popular trend in speech and audio processing leads to theimportance 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 displayedaccuracy problems that are largely due to the fact that meter takes an
average measurement that is severely restricted by the ballistics ofthe mechanical metering system.
T
-
8/8/2019 Real Time DSPprojetc-Peak Program Meter-Tamir Suliman
3/10
3
This can result in short, but very loud transients being missed or improperly displayed.Morerecently audio equipment manufacturers developed the peak program meter (PPM) to overcome
the VU meters 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 inbroadcasting - 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 theprogram 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 manydifferent 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 UKPPM, 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.
Figure 1 VU and PPM scales
-
8/8/2019 Real Time DSPprojetc-Peak Program Meter-Tamir Suliman
4/10
4
II. PeakProgram Meter OverviewAs we referenced the PPM improves on the VU meters performance problems by integrating the
signal for 5 ms. this integration process will then only detects peaks that are long enough to beheard by typical human listener. There are two types of PPMs:
A. Type IPPM'sThe 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 indicatorbeing 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 moreinaccurate 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 PPM is not the reciprocal of theattack 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 IIPPM'sThe 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 to3.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.
III. DSP system and PPMTo avoid unintended distortion we have to ensure that the analog signal that is digitized by the
analog to digital converter (ADC) shouldnt 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 inputvoltages 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 todistort 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.
Analog SignalA/D
converterDSP
algorithmsD/A
converter
Reconstructed Analog
Signal
-
8/8/2019 Real Time DSPprojetc-Peak Program Meter-Tamir Suliman
5/10
5
IV. TI C6713 and CCSThe 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 toinvoke the C code building process.
This code can then be downloaded onthe target from where it runs. CCS
diagnostic test is shown in FigureCode Composer Studio or CCS
provides an integrated development forIDE 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 Studiob- 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 PCd- Power Supply +5 v for the DSK boarde- PCf- Oscilloscope, signal generator and audio cables.
Figure 2 Diagnostic utility for DSK kit
Figure 3 TMS320C6713 Board
-
8/8/2019 Real Time DSPprojetc-Peak Program Meter-Tamir Suliman
6/10
6
V. DSKImplementation in CLike 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 ofLEDs 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
.These turn on levels are shown the Figure below , where the sinusoidal signalis 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
VI. Initial setup for TMS 320C6713 and the C code explanation1- 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
Figure 4 PPM LED Utilization for a sine wave
-
8/8/2019 Real Time DSPprojetc-Peak Program Meter-Tamir Suliman
7/10
7
maxOutput = _fabsf(outputLeft);
if(maxOutput < _fabsf(outputRight))
maxOutput = _fabsf(outputRight);
if (maxOutput > 32767) {
LED_3_counter = RESET;
LED_2_counter = RESET * 2;
LED_1_counter = RESET * 3; }
else if (maxOutput > 32000) {
if(LED_2_counter < RESET)
LED_2_counter = RESET;
if(LED_1_counter < RESET * 2)
LED_1_counter = RESET * 2;
2- The C Code1. The first lines determine maxOutput (The maximum of the absolute value of both the left
and the right output channels.
2. If the maxOutput is greater than 32676 in magnitude then LEDs 1, 2, 3 are turned ON.Counters forLED 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.
3. If the maxOutput is greater than 32000 in magnitude then LEDs 1 and 2 are turned ON.Counters forLED 1 and 2 are set at 9600 and 4800 counter values keep LEDs 1, 2, and
ON for .2, and .1 seconds respectively.
-
8/8/2019 Real Time DSPprojetc-Peak Program Meter-Tamir Suliman
8/10
8
else if (maxOutput > 28000) {
if(LED_1_counter < RESET)
LED_1_counter = RESET;
}
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
4. If the maxOutput is greater than 28000 in magnitude then LEDs 1 turned ON. Counter forLED 1 is set at 4800 counter values keep LEDs 1 ON for .1 seconds respectively.
5. Updates the LED Mask based on the status of the LED counters6. Calls the UpdateLEDs () subroutine, which as its name implies updates the status of the
systems LEDs.
-
8/8/2019 Real Time DSPprojetc-Peak Program Meter-Tamir Suliman
9/10
9
VII. ConclusionIts 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 insituations where pops and distortion are a problem. Thefall time of a PPM (the time it takes the
meter to return to a lower reading) is much slower.
-
8/8/2019 Real Time DSPprojetc-Peak Program Meter-Tamir Suliman
10/10
10
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 fromMATLAB to C with the TMS320C6x DSK
[3] Texas Instruments Inc., TMS320C6713 DSK Users 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