The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers.    


Datasheet Search Engine   
 
Part # or Description: • 5V RS232 Driver • 2SC5066* • "Real Time Clock" • "USB connector" • "blue led" 5mm • 10 watt zener diode • 2N3055* motorola
 
Search Tip: Try entering the part number only. Include a wildcard (eg. lm317* or 1n4148*)

 

 

Aaron Kofi Aboagye C5000 Software Applications Abstract prog


Datasheet Thumbnail

  

Download PDF



Top Searches for this datasheet



Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
Aaron Kofi Aboagye C5000 Software Applications
Abstract
programmers faced with problem dealing with overflows that occur result some computation. typical case that implementation recursive infinite impulse response (IIR) digital filters. These implementations very prone overflows, recursive naturs filters. this application report, different methodologies presented help programmers avoid deal with these overflow conditions. application report also presents simple design example that utilizes techniques
Contents
Introduction Second Order Filter Sections Scale Factor Computation.5 Norm Chebychev Norm Norm Scaling Techniques.6 Fixed Scaling Second Order Coefficients Split Fixed Scaling Feedforward Feedback Coefficients.7 Fixed Scaling Input Samples Adaptive Scaling Second Order Coefficients Example Step Determine required order filter meet specs Step Determine filter coefficients Step Break filter into second order sections Step Calculate scale factors scale coefficients each section Conclusion
Figures
Figure Figure Figure Figure Figure Figure Figure Figure Figure Direct Form Structure Block Diagram Direct Form Structure Block Diagram Direct Form Scaling Structure Block Diagram Results Unscaled Computation Results Scaled Computation (Method Results Scaled Computation (Method Signal-to-Noise Ratio (SNR) Plots Method Method Results Worst-Case Analysis (Method Results Worst-Case Analysis (Method
Digital Signal Processing Solutions
1999
Introduction
most important issues digital filter implementations fixed-point devices prevention handling overflow results, precision hardware. certain cases, occurrence overflow noncatastrophic; while catastrophic others. This shown nature recursive (IIR) nonrecursive (FIR) digital filter implementations. nonrecursive filters, overflow computation affects result that particular computation, y[n]. contrast, overflow computation recursive filter affects that particular result, y[n], remaining results inherent feedback their structure. objective this application report present different techniques that used prevent overflows implementations digital filters Texas Instruments TMS320 family digital signal processors (DSPs). This application report focuses TMS320C54x DSP; however, concepts applied other DSP. Note that most implementations currently available `C54x devices based direct form structured second order sections (biquads) and, such, discussion here will with respect second order filter sections. general solution this problem scaling, ensure that overflows occur. However, choice scale factors where when scale optimal precision efficiency trivial. main categories scaling techniques will examine are:
fixed scaling second order coefficients split fixed scaling feed-forward feed-back coefficients fixed scaling input samples adaptive scaling second order coefficients
will discuss methodologies each category.
Second Order Filter Sections
design implement high order filters, general transfer function given equation (1).
However, when coefficients (a1. quantized, resulting errors significantly alter desired filter characteristics. been shown that breaking transfer function into lower-order sections connecting these cascade parallel reduce this sensitivity coefficient quantization. case, chose direct form structured second order sections implementations. transfer function this section given equation corresponding direct form block diagram shown Figure
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
Figure Direct Form Structure Block Diagram
x[n]
d[n]
y[n]
difference equations used implementation direct form structure shown Figure
x[n] y[n]
certain implementations cascaded filters, only four coefficients used instead five shown Figure This reduction number coefficients achieved dividing numerator thus making coefficient term equal giving entire system gain doing this, change number representation coefficients necessary since possible with numerator coefficients larger than transfer function that case
where
Figure shows structure direct form filter. main difference between direct form direct form implementations amount buffer space required. direct form implementation requires delay buffers x[n] y[n]; direct form requires only buffer d[n]. presence guard bits `C54x devices allows entire computation difference equation direct form done accumulator overflow only needs taken care y[n]. This makes direct form structure less susceptible overflows than direct form structure. However, drawback direct form structure that implementation consumes more cycles than direct form
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
Figure Direct Form Structure Block Diagram
x[n]
y[n]
difference equation used implementation direct form structure shown Figure
y[n] x[n]
functions TMS320C54X function library, 54DSPLIB, accessible from ftp://ftp.ti.com/, feature both implementation structures. DSPLIB implements direct form filters with four five coefficients biquad direct form filter with five coefficients biquad.
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
Scale Factor Computation
Each techniques will discuss utilizes same scale factor computation technique. differences where when apply scale factor/gain. Following convention that each fixed-point number represents fraction, each node network (see Figure must constrained have amplitude less than avoid overflow. wk[n] denote value node variable, hk[n] denote impulse response from input, x[n] node variable wk[n], then:
will present three different methods computing scale factor ensure that
wk[n]
Norm
norm evaluated
h[n]
this method computing signal assured overflow.
Chebychev Norm
Chebychev norm frequency response H(f) evaluated
This method computing only assures that steady-state response system sine wave will overflow.
Norm
norm evaluated
This method computing also allows overflows inherently uses measure probability overflow.
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
Scaling Techniques
Fixed Scaling Second Order Coefficients
first step identify nodes each second order section where overflow could occur. Looking back Figure identified nodes d[n] y[n] potential overflow nodes. this stage, transfer function each these nodes needs evaluated. transfer function d[n] shown equation (9). Note that transfer function y[n] same that given equation (2).
With these transfer functions, position calculate scale factor, each node block diagram. Depending application types inputs, three methods outlined previous section should chosen computation alternative evaluate three values each node. Then, having evaluated different values nodes section, highest value chosen, even though this will very conservative means scaling. this point, should used scale coefficients that section. This process should repeated each subsequent second order section filter. essential reduce risk overscaling ensuring that subsequent scale factors take into consideration scaling previous section. method achieving this ensure that each transfer function/impulse response evaluated should relative input x[n] input that section. this case, scaled coefficients preceding sections should used computing these transfer functions/impulse responses. Another method calculate scale factor each biquad independently, actual scale factor used biquad
Figure shows structure previous method scale factor allocation. this method, only coefficients scaled. scale factor each section introduced bi's preceding section there will overflow nodes. scale factor first stage, introduced input scale factor shown Figure subsequently, there will scaling last stage since scale factor that stage will have been introduced previous stage.
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
Figure Direct Form Scaling Structure Block Diagram
x[n] d1[n] y1[n] d2[n] y[n]
b01'
-a12
-a11 b11'
-a21 b21' -a22
Figure scale factor section used scale coefficients section follows:
Since this example only second order sections, coefficients last section left unchanged. C54x DSPLIB, expected scale input signal prior invoking direct form functions. input will still Q.15 coefficients should kept number format, QN.M that ensures that largest coefficient just fits. indication this number format, number integer bits N-1, also passed function.
Split Fixed Scaling Feedforward Feedback Coefficients
This technique very similar that previously described except that transfer function second order section (biquad) split into feedforward (FIR) feedback (AllPole) functions. Equation (10) shows feedforward transfer function.
(10)
Splitting scaling procedure into paths ensures that overflow does occur either direction during computation. Based application types signals question, norms evaluated each transfer functions, equations 10), corresponding coefficients, bk's feedforward ak's feedback, scaled calculated norms. When scaling feedback coefficients, ak's, essential determine whether actual norm calculated sufficient negation necessary. This because computation norm uses absolute values and, such, summation coefficients impulse response equation (9), less than some cases, absolute value computed always used.
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
workaround (-a1 Scale with else Scale with This procedure repeated independently each biquad entire structure. certain implementations, desirable scale output each biquad back expected value prior computing output next stage. This because this procedure tends overscale certain cases. However, this scaling procedure also leads another possibility overflow care should taken this approach adopted.
Fixed Scaling Input Samples
main idea this technique scale inputs with fixed scale factor. scale factor, computed using scale factor computation methods outlined previous section each node previously discussed, three scale factors evaluated each node. maximum scale factor then chosen, since this only avoid overflow each node. There typically ways applying this scale factor. scale factor applied each node/register network (scaling coefficients) prior during computation input samples scaled prior computation. either case, this technique results lower signal-to-noise ratio (SNR) than other techniques described.
Adaptive Scaling Second Order Coefficients
This scaling technique different from three techniques previously discussed, that, scaling coefficients done time. overflow checked determine overflow occurs node second order section during computation and, results computation that node scaled down sufficiently avoid overflow. value also checked underflow occurred (result small) and, result scaled However, even though this technique provides best means scaling, fact that risk overscaling greatly minimized, MIPS consumption very high does make practical implementation technique fixed point device.
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
Example
example fixed scaling second order coefficients technique developed Matlab specified filter using cascaded second order sections, with five coefficients biquad. This example uses norm evaluate scale factor but, previously mentioned, other techniques used. problem design Nth-order elliptic low-pass filter with following specifications: pass-band edge frequency, 0.2fs pass-band ripple 0.2dB stop-band edge frequency, 0.3fs stop-band ripple, -20dB solution will presented stepwise fashion with Matlab script interleaved when necessary.
Step Determine required order filter meet specs
ellipord(0.2, 0.3, 0.2,
Step Determine filter coefficients
ellip(N, 0.2, Wn);
Step Break filter into second order sections
Transform transfer function into zero-pole representation: tf2zp(B, Transform zero-pole representation into second order section coefficients, coeff zp2sos(Z,
coeff1 coeff; coeff2 coeff; coeff3 coeff; copy coeffs method copy coeffs method copy coeffs scaling
this point, have order, coefficients, coeff, corresponding biquads. From results script, following coefficients shown transfer function:
0.1571 0.0656 0.1571Z 0.6911 0.9895Z 0.6911Z 1.2109 0.4596 1.4857 0.8877
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
Using same implementation that used 54DSPLIB, output response random input evaluated. Matlab script
Inputs, Outputs, Intermediate results size(coeff,1); 100; zeros(Ns, Nx+2); (rand(1,Nx)-0.5)*2]; zeros(Ns, Nx+2); number sections
3:Nx+2 1:Ns x(n) y(i,n);
y(2, y(2, Figure shows plots intermediate computational results. that overflows occur both intermediate stages computation even though final outputs stages overflow; therefore, scaling needed. previously stated, this example makes norm calculating scale factors. methods determining scale factors subsequent biquads following first will used results compared.
Figure Results Unscaled Computation
plot -0.5 plot -0.5 plot plot
Matlab script evaluating norms methods scaling coefficients second order sections this example shown step Note that implementation structure used methods same that shown Figure
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
Step Calculate scale factors scale coefficients each section
zeros(Ns,159); zeros(Ns,159); i=1:Ns Method impulse responses norm evaluation Ha(i,:) impz([1 coeff(i,4:6), 80)'; Hb(i,:) impz(coeff(i,1:3), coeff(i,4:6), 80)'; l1_H1(i,1) sum(abs(Ha(i,:))); l1_H1(i,2) sum(abs(Hb(i,:))); Gk(i) max(l1_H1(i,:)); l1_1(i) Gk(i) prod(l1); l1_norm first node l1_norm second node scale factor section Gk(I) product previous scale factors
Method impulse responses norm evaluation H1(i,1:80) impz([1 coeff2(i,4:6), 80)'; H2(i,1:80) impz(coeff2(i,1:3), coeff2(i,4:6), 80)'; else H1(i,:) conv(impz(coeff2(i-1,1:3), coeff2(i-1,4:6), 80), impz([1 coeff2(i,4:6), 80))'; H2(i,:) conv(impz(coeff2(i-1,1:3), coeff2(i-1,4:6), 80), impz(coeff2(i,1:3), coeff2(i,4:6), 80))'; l1_H2(i,1) sum(abs(H1(i,:))); l1_H2(i,2) sum(abs(H2(i,:))); l1_2(i) max(l1_H2(i,:)); l1_norm first node l1_norm second node scale factor section
Scaling coefficients coeff(i-1,1:3) coeff(i-1,1:3) l1_1(i); Scale coeffs (bi's) Method coeff1(i-1,1:3) coeff1(i-1,1:3) l1_2(i); Scale coeffs (bi's) Method coeff2(i,1:3) coeff2(i,1:3) l1_2(i); Scale coeffs (bi's) Method convolution
results previous script provide with following numerical results: l1_1 [4.6801 3.8934] l1_2 [4.6801 2.3940] Matlab script actual implementation with both scale factors
Using scaled coefficients from method 3:Nx+2 x(n) x(n) l1_1(1); 1:Ns d(i,n) x(n) coeff(i,5)*d(i,n-1) coeff(i,6)*d(i,n-2); y(i,n) coeff(i,1)*d(i,n) coeff(i,2)*d(i,n-1) coeff(i,3)*d(i,n-2); x(n) y(i,n); y(2,:) prod(l1_1)
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
Using scaled coefficients from method 3:Nx+2 x1(n) x1(n) l1_2(1); 1:Ns d1(i,n) x1(n) coeff1(i,5)*d1(i,n-1) coeff1(i,6)*d1(i,n-2); y1(i,n) coeff1(i,1)*d1(i,n) coeff1(i,2)*d1(i,n-1) coeff1(i,3)*d1(i,n-2); x1(n) y1(i,n); y1(2,:) prod(l1_2)
Figure Figure show results from methods respectively. that none results overflow. also observe that output using method scaled more severely than output method This because method based assumption that input stage range, y1[n] which case.
Figure Results Scaled Computation (Method
plot -0.5 -0.1 -0.2 plot
plot
plot
0.04 0.02 -0.02 -0.04
0.04 0.02 -0.02 -0.04
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
Figure Results Scaled Computation (Method
plot -0.5 -0.2 -0.4 plot
plot
plot
0.05 -0.05 -0.1
0.05 -0.05 -0.1
Figure shows plots error scaling corresponding signal-to-noise ratio (SNR) both methods. that almost same both implementations only differentiating factor severity scaling method compared method
Figure Signal-to-Noise Ratio (SNR) Plots Method Method
plot error1
plot error2
plot
plot
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
further illustrate effectiveness both techniques, input data changed constant stream which represents worst-case scenario. results this shown Figure Figure
Figure Results Worst-Case Analysis (Method
plot 0.05 plot 0.06 0.08 0.06 0.04 0.02 0.02 plot 0.25 0.15 plot
0.04
Figure Results Worst-Case Analysis (Method
plot plot 0.08 0.06 0.04 0.02 0.05 0.15 plot plot
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
Conclusion
This application report presented four techniques overflow avoidance implementations filters fixed-point devices. results example also demonstrate these techniques. However, should noted that choice scaling technique depends greatly application required accuracy. determine whether fixed scaling technique adaptive technique adequate. fixed technique used, choice scale factor will still depend application.
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
Contact Numbers
INTERNET Semiconductor Home Page www.ti.com/sc Distributors www.ti.com/sc/docs/distmenu.htm PRODUCT INFORMATION CENTERS Americas Phone +1(972) 644-5580 +1(972) 480-7800 Email sc-infomaster@ti.com Europe, Middle East, Africa Phone Deutsch +49-(0) 8161 3311 English +44-(0) 1604 3399 +34-(0) Francais +33-(0) 1-30 Italiano +33-(0) 1-30 +44-(0) 1604 Email epic@ti.com Japan Phone International +81-3-3344-5311 Domestic 0120-81-0026 International +81-3-3344-5317 Domestic 0120-81-0036 Email pic-japan@ti.com
Asia Phone International +886-2-23786800 Domestic Australia 1-800-881-011 Number -800-800-1450 China 10810 Number -800-800-1450 Hong Kong 800-96-1111 Number -800-800-1450 India 000-117 Number -800-800-1450 Indonesia 001-801-10 Number -800-800-1450 Korea 080-551-2804 Malaysia 1-800-800-011 Number -800-800-1450 Zealand 000-911 Number -800-800-1450 Philippines 105-11 Number -800-800-1450 Singapore 800-0111-111 Number -800-800-1450 Taiwan 080-006800 Thailand 0019-991-1111 Number -800-800-1450 886-2-2378-6808 Email tiasia@ti.com
trademark Texas Instruments Incorporated. Matlab trademark Mathworks, Inc.
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's
IMPORTANT NOTICE Texas Instruments subsidiaries (TI) reserve right make changes their products discontinue product service without notice, advise customers obtain latest version relevant information verify, before placing orders, that information being relied current complete. products sold subject terms conditions sale supplied time order acknowledgement, including those pertaining warranty, patent infringement, limitation liability. warrants performance semiconductor products specifications applicable time sale accordance with TI's standard warranty. Testing other quality control techniques utilized extent deems necessary support this warranty. Specific testing parameters each device necessarily performed, except those mandated government requirements. CERTAIN APPLICATIONS USING SEMICONDUCTOR PRODUCTS INVOLVE POTENTIAL RISKS DEATH, PERSONAL INJURY, SEVERE PROPERTY ENVIRONMENTAL DAMAGE ("CRITICAL APPLICATIONS"). SEMICONDUCTOR PRODUCTS DESIGNED, AUTHORIZED, WARRANTED SUITABLE LIFE-SUPPORT DEVICES SYSTEMS OTHER CRITICAL APPLICATIONS. INCLUSION PRODUCTS SUCH APPLICATIONS UNDERSTOOD FULLY CUSTOMER'S RISK. order minimize risks associated with customer's applications, adequate design operating safeguards must provided customer minimize inherent procedural hazards. assumes liability applications assistance customer product design. does warrant represent that license, either express implied, granted under patent right, copyright, mask work right, other intellectual property right covering relating combination, machine, process which such semiconductor products services might used. TI's publication information regarding third party's products services does constitute TI's approval, warranty, endorsement thereof. Copyright 1999 Texas Instruments Incorporated
Overflow Avoidance Techniques Cascaded Filter Implementations TMS320 DSP's

Other recent searches


TMS320VC5502 - TMS320VC5502   TMS320VC5502 Datasheet
MAX338 - MAX338   MAX338 Datasheet
MAX339 - MAX339   MAX339 Datasheet
MAX328 - MAX328   MAX328 Datasheet
MAX329 - MAX329   MAX329 Datasheet
LT1813 - LT1813   LT1813 Datasheet
K6T0808V1D - K6T0808V1D   K6T0808V1D Datasheet
K6T0808U1D - K6T0808U1D   K6T0808U1D Datasheet
GALI-4+ - GALI-4+   GALI-4+ Datasheet
DFA150AA80 - DFA150AA80   DFA150AA80 Datasheet
DC56-51ZGWA - DC56-51ZGWA   DC56-51ZGWA Datasheet
2SA1437 - 2SA1437   2SA1437 Datasheet
1N5817WB-1N5819WB - 1N5817WB-1N5819WB   1N5817WB-1N5819WB Datasheet

 

Privacy Policy | Disclaimer
© 2012 Datasheet Archive