22
Companding in DSPs Ari Klein Research Adviser: Professor Yannis Tsividis

Companding in DSPs

  • Upload
    tuvya

  • View
    55

  • Download
    1

Embed Size (px)

DESCRIPTION

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 A lot of distortion in output. input. ADVANTAGE OF LARGE SIGNALS. ADC Transfer function. output. - PowerPoint PPT Presentation

Citation preview

Page 1: Companding in DSPs

Companding in DSPs

Ari Klein

Research Adviser: Professor Yannis Tsividis

Page 2: Companding in DSPs

PROBLEM WITH SMALL SIGNALS

input

output

•Does not take full advantage of available bits

•A lot of distortion in output

ADCTransfer function

Page 3: Companding in DSPs

ADVANTAGE OF LARGE SIGNALS

•Takes full advantage of available bits

•Much less distortion

input

output

ADCTransfer function

Page 4: Companding in DSPs

COMPANDING

OutputD.R.

InputD.R. Digital

System

compress expand

Page 5: Companding in DSPs

ADC DAC

If there is only an ADC and a DAC (no DSP in between):

X X

g(n) = 1/env(n)

input output

1/g(n) = env(n)

Page 6: Companding in DSPs

What about with a DSP between the ADC and DAC?

Might consider:

BUT THIS SCHEME WILL

NOT WORK SINCE IT HORRIBLY DISTORTS

THE INPUT/OUTPUT BEHAVIORIN GENERAL

ADC DAC

input output

g(n)

X

1/g(n)

DSPX

Page 7: Companding in DSPs

ADC DAC

u(n)

y(n)g(n)

X

1/g(n)

Z-kX

•The output is DISTORTED by the factor•This is a time-varying distortion.•More complicated systems will have more complicated distortions

So y(n) = g(n-k)g(n)( ) u(n-k)X

K-sample delay: y(n)=u(n-k)

If I try:

g(n-k)*u(n-k)

u(n-k)

g(n-k)g(n)( )

Page 8: Companding in DSPs

The Problem: Get input, output and states which always have large envelopes

Given a system whose input u, output y, and state vector xare 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

Page 9: Companding in DSPs

One Solution

•um(n) = u(n)/e(u(n))

•ym(n) = y(n)/e(y(n))

•xm(n) = x(n)/e(x(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))]

xm(n+1) = Am(n)xm(n) + Bm(n)um(n)

ym(n) = Cm(n)xm(n) + Dm(n)um(n)

Only RATIOS of envelopes are required.

Page 10: Companding in DSPs

Companding for DSPs

ADCinput output

/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

Page 11: Companding in DSPs

DSP without companding

EnvelopeDetection

Compute ratios

ADC

DAC

input outputDSPC

ADC

DAC

DAC

delay / x

Complete Companding System (conceptual):The e-signals are (roughly) the envelopes of the corresponding signals in the non-companding DSP

Page 12: Companding in DSPs

To date:•I have simulated the conceptual companding system for the allpass digital reverberator shown below

• The results have been promising

Page 13: Companding in DSPs

The left “half” of the companding DSP

Page 14: Companding in DSPs

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

Page 15: Companding in DSPs

Measuring the improvements quantitatively

“Steady-State” caseBut 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?

Page 16: Companding in DSPs

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?

Page 17: Companding in DSPs

A single-ADC solution

•Clocked at twice the sampling rate to avoid algebraic loop

Page 18: Companding in DSPs

Possible Improvement: Masking

•With companding, get most noise when signals are large•Suggests that should take advantage of MASKING:

ff

NoiseThreshold

In Quiet

Noise

Threshold

In Presence

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

Page 19: Companding in DSPs

To take advantage of this:

Use a bank of bandpass filters

BPF

BPF

BPF

BPF

BPF

BPF

BPF

BPF

DSP

Page 20: Companding in DSPs

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

Page 21: Companding in DSPs

Open Questions

•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?

•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?

Page 22: Companding in DSPs

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 analogparts actually implemented with analog circuits.