220 likes | 496 Views
Thesis Proposal for: Companding in Fixed Point DSPs. A scheme to reduce the quantization (roundoff) errors in Fixed Point DSPs Ari Klein. ADVANTAGE OF LARGE SIGNALS. When the signals in the DSP are large, they take full advantage of the available bits.
E N D
Thesis Proposal for:Companding in Fixed Point DSPs A scheme to reduce the quantization (roundoff) errors in Fixed Point DSPs Ari Klein
ADVANTAGE OF LARGE SIGNALS • When the signals in the DSP are large, they take full advantage of the available bits. • When the signals in the DSP are small, only a few of the available bits are used. • The roundoff error is essentially independent of the signal level, so the distortion due to roundoff is much worse for small signals
CONSTANT ENVELOPE LARGE SIGNALS • To reduce roundoff error, all signals should be “as large as possible” whenever digital • Since the system has a set overflow tolerance, “as large as possible” means that all digital signals should have a roughly constant envelope, where the constant is slightly lower than the system overflow tolerance
X X ADC DAC If there is only an ADC and a DAC (no DSP in between): u(nT) y(nT) g(n) 1/g(n) • Since the input is NOT generally constant envelope, multiply the input by a time-varying signal, g(n), BEFORE the ADC. • g(n) should be LARGE when the input signal is SMALL, and SMALL when the input signal is LARGE • To make the output equal to the input, the output must be multiplied by 1/g(n) • The multiplication by 1/g(n) must be done AFTER the DAC, so that the signal is large whenever it is digital
X X ADC DSP DAC What about with a DSP between the ADC and DAC? Might consider: y(nT) u(nT) g(n) 1/g(n) Would this scheme work?
X X ADC DSP DAC NO! this will horribly distort the input/output behavior y(nT) u(nT) g(n) 1/g(n) Taking a DSP, multiplying its input by a time-varying signal g(n), and then multiplying the output by 1/g(n) will, in general, CHANGE the input/output behavior of the DSP (dramatically)
X X ADC Z-k DAC For example, let y(n)=u(n-k) So the DSP is a k-sample delay. If I do: y(nT) u(nT) g(n) 1/g(n) • The output is now g(n-k)*u(n-k)/g(n) • This is NOT equal to u(n-k). • It is DISTORTED by the factor g(n-k)/g(n). • This is a time-varying distortion. • More complicated systems will have more complicated distortions
Must make internal corrections in DSP to ensure that there is no change in input/output behavior. Consider a system given by: x(n+1)=A*x(n)+B*u(n) y(n)=C*x(n)+D*u(n) I want the internal states to be large for all n, so set w(n)=G(n)*x(n) Doing the algebra gives Prof. Tsividis’s Equations: w(n+1)= [G(n+1)*A* G-1(n)]*w(n)+[G(n+1)*B]*u(n) y(n)=[C*G-1(n)]*w(n)+D*u(n) This is a new internally time-varying system, whose states are always large, but whose input/output behavior is identical to the original system’s!
X X ADC DSP ADC DAC DAC DAC Companding for DSPs (in principle) input output G(n) generator
X / ADC DSP ADC DAC Single-g Companding: G(n) = g(n) * I Envelope Detection • simple • works well for systems where all the signals are “roughly” in phase with each other • set g(n) = k / env(n) where env(n) is the envelope of the input, and k is a constant dependent on the overflow tolerance
Single-g Companding: G(n) = g(n) * I Starting from Professor Tsividis’s Equations: And setting G(n) = g(n) * I gives: w(n+1) = d(n) * (A*w(n)+B*[g(n)*u(n)] ) [g(n)*y(n)] = C*w(n)+D*[g(n)*u(n)] g(n+1) where d(n) = g(n) • Companding system has: • Input = g(n)*u(n) • Output = g(n)*y(n)
ADC X / / ADC DSP DAC Single-g Companding: G(n) = g(n) * I w(n+1) = d(n) * (A*w(n)+B*[g(n)*u(n)] ) [g(n)*y(n)] = C*w(n)+D*[g(n)*u(n)] In general, Can be implemented as: Z-1 Envelope Detection Z-1
Unfortunately, single-g companding does NOT work well for systems where some signals are large at the same time as other signals are small For such systems, need multi-g companding: G(n) still diagonal, but with unequal elements on diagonal
X X ADC ADC DAC DAC DAC Multi-g Companding G(n) is diagonal, but with unequal elements on diagonal DSP with companding G(n) generator • More complicated than single-g companding • But works for any system The G(n) generator could be (for example): DSP without companding Envelope Detection
Simplifications for multi-g companding Consider a k-delay element: Z-k If the input is large: gi(n) * xi(n) the output is also large: gi(n-k) * xi(n-k) Can get desired Can just delay gi(n) by k,
Thesis Proposal Implement companding on some actual DSPs I have already implemented it on the simple digital reverberator shown below
Thesis ProposalExplore Possible Improvements For example: Taking advantage of masking by using a bank of bandpass filters
Thesis ProposalTheoretical Considerations Already Proven: Companding does not change the original system’s • Stability • Controllability • Observability Would like to find: • General method for easily implementing multi-g companding • The “optimal” G(n) for minimizing quantization errors • Upper bound on performance improvement due to companding • General description of the type of systems where companding is most useful
Thesis ProposalImplementing in Hardware Implement the companding system on an actual fixed-point DSP in real-time • Build the necessary analog components: • Timeshare ADCs and DACs (current implementation requires 2 ADCs and 3 DACs – probably too expensive) • Make them variable gain to “absorb” the multiplies and divides • Get the Simulink model for the digital companding system to work on the DSP in real time • Prototype (non-companding) system • Real-time digital envelope detection to create g(n) signals • Companding system
Thesis ProposalQualitative Comparisons • For a given output “quality” how many bits are needed in the original, non-companding DSP versus in the companding DSP? • For a given number of bits, how does the output “quality” compare between the original, non-companding DSP versus the companding DSP? • Conduct objective listening tests, similar to psychoacoustic experiments
Thesis Proposal Quantitative Comparisons Quantify the improvements as a function of signal level and number of bits • Mean square error of output • SNR • Harmonic distortion in spectrum For example: If these are NOT good metrics for quantifying improvements due to companding, I will also need to FIND some good metrics