Companding in Fixed Point DSPs

Download Report

Transcript Companding in Fixed Point DSPs

Companding in DSPs
Ari Klein
Research Adviser: Professor Yannis Tsividis
PROBLEM WITH SMALL SIGNALS
ADC
Transfer
function
output
•Does not take full
advantage of
available bits
input
•A lot of distortion
in output
ADVANTAGE OF LARGE SIGNALS
ADC
Transfer
function
output
•Takes full advantage
of available bits
•Much less distortion
input
COMPANDING
Input
D.R.
Digital
System
compress
Output
D.R.
expand
If there is only an ADC and a DAC (no DSP in between):
input
X
g(n) = 1/env(n)
output
ADC
DAC
X
1/g(n) = env(n)
What about with a DSP between the ADC and DAC?
Might consider:
input
output
X
ADC
DSP
g(n)
DAC
X
1/g(n)
BUT THIS SCHEME WILL
NOT
WORK SINCE IT HORRIBLY DISTORTS
THE INPUT/OUTPUT BEHAVIOR
IN GENERAL
K-sample delay: y(n)=u(n-k)
If I try:
u(n)
g(n)
X
Z-k
ADC
X
DAC
g(n-k)*u(n-k)
So y(n) =
(
g(n-k)
g(n)
)
X
u(n-k)
y(n)
1/g(n)
u(n-k)
•The output is DISTORTED by the factor
•This is a time-varying distortion.
•More complicated systems will have more
complicated distortions
(
g(n-k)
g(n)
)
The Problem: Get input, output and states
which always have large envelopes
Given a system whose input u, output y, and state vector x
are related by:
x(n+1) = Ax(n) + Bu(n)
y(n) = Cx(n) + Du(n)
Construct a modified system whose input um, output ym, and state
vector xm always have large envelopes, and are related by:
xm(n+1) = Am(n)xm(n) + Bm(n)um(n)
ym(n) = Cm(n)xm(n) + Dm(n)um(n)
•Choose a relationship
between xm,um,ym and x,u,y
•Find the corresponding
relationship between
Am,Bm,Cm,Dm and A,B,C,D
One Solution
•um(n) = u(n)/e(u(n))
•ym(n) = y(n)/e(y(n))
xm(n+1) = Am(n)xm(n) + Bm(n)um(n)
•xm(n) = x(n)/e(x(n))
ym(n) = Cm(n)xm(n) + Dm(n)um(n)
The elements of Am, Bm, Cm, and Dm are then related to the
elements of A, B, C and D by:
am(n,i,j) = a(i,j)*[e(xj(n))/e(xi(n+1))]
bm(n,i) = b(i)*[e(u(n))/e(xi(n+1))]
cm(n,j) = c(j)*[e(xj(n))/e(y(n))]
dm(n) = d*[e(u(n))/e(y(n))]
Only RATIOS of envelopes are required.
Companding for DSPs
input
/
ADC
DSP
DAC
/
e-signals
•This system is INTERNALLY TIME-VARYING
•Its input/output behavior is IDENTICAL to the original
system’s (in the absence of quantization)
•It is therefore EXTERNALLY TIME-INVARIANT
output
Complete Companding System (conceptual):
The e-signals are (roughly) the envelopes of the
corresponding signals in the non-companding DSP
input
output
delay
/
ADC
DSPC
DAC
x
DAC
DAC
ADC
DSP without
companding
Envelope
Detection
Compute
ratios
To date:
•I have simulated the conceptual companding system for the
allpass digital reverberator shown below
• The results have been promising
The left “half” of the companding DSP
Typical Results
(a) Input
(b) State in original system
(c) Corresponding state in
companding system
(d) Output of original
system
(e) Output of I/O
companding system
with no internal
correction
(f)
Output of properly
companding system
Measuring the improvements quantitatively
“Steady-State” case
But I would really like to consider the
transient case. The problems are:
•What should the input be?
•What should be measured and compared at
the output to quantify the inprovements?
(SNDR is not necessarily the best choice)
•When (and over how long an interval)
should I take these measurements?
Work in Progress:
Improving Efficiency:
–Constraining the e-signals to be powers of two :
•Easier to process and store
•Multiplications become shifts
•Division (computing ratios) becomes subtraction
•Errors due to additional “quantization” of e-signals offset by
elimination of division errors
•Similar to floating point!
–Lowpass filtering the e-signals
•Envelopes should be relatively slowly varying, so can LPF without
too much loss of information
•Once LPF, can downsample – potentially MUCH less computation
•But must still ensure that envelope always greater than signal to
avoid overflow – HOW?
A single-ADC solution
•Clocked at twice the sampling rate to avoid algebraic loop
Possible Improvement: Masking
•With companding, get most noise when signals are large
•Suggests that should take advantage of MASKING:
Noise
Noise
Threshold
In
Quiet
Threshold
In Presence
f
of Signal
•The noise threshold is raised for frequencies near a signal
•A significant amount of the noise that is in frequencies close to a large signal is
below threshold and perceptually inaudible – it is masked by the signal
f
To take advantage of this:
Use a bank of bandpass filters
BPF
BPF
BPF
BPF
DSP
BPF
BPF
BPF
BPF
Theoretical Considerations
Already Proven:
Companding does not change the original system’s
•Stability
•Controllability
•Observability
Would like to find:
•General method for easily implementing companding
•The “optimal” e-signals for minimizing quantization errors
•Upper bound on performance improvement due to companding
•General description of the type of systems where companding is most useful
Open Questions
•All measurements shown were in the time domain. To measure in the frequency
domain, what input frequency should I use (as a function of the sampling rate), and
how many points should be used for the FFT?
•I would really like to get quantitative measurements for the transient case. The problems
are:
•What should the input be?
•What should be measured and compared at the output to quantify the improvements?
(SNDR is not necessarily the best choice)
•When (and over how long an interval) should I take these measurements?
•Any ideas how to resolve the algebraic loop in the single-ADC architecture without
doubling the sampling rate?
•I want to LPF/downsample the env det output. How can I still ensure that it stays
above the signal, so that the companded signals don’t overflow?
•Even better would be to have LPF/downsample before the original system, to reduce
processing. Is this equivalent (even roughly) to LPF at output of env det?
Hardware
I have succeeded in getting a complete companding system to work on the TI 6713
floating point DSP in real-time.
The “analog” parts “run” in floating-point.
The digital parts “run” in 8-bit fixed point.
I used Simulink’s Real Time Workshop and Embedded Link to automatically
generate the code. I then edited it to make it more efficient.
It is still very inefficient.
It only runs in real-time at 22.05kHz (I downsample the input)
Eventually, I want to have an efficient fixed point implementation
running at 44.01kHz on a fixed-point DSP in real-time, with the analog
parts actually implemented with analog circuits.