A Method to Correct Data Corrupted by Overflow
description
Transcript of A Method to Correct Data Corrupted by Overflow
A Method to Correct Data Corrupted by Overflow
Ben ChristensenJay Brady
Dec. 5, 2013
TopicsA brief introduction to overflow.How do we identify a signal which has
been corrupted by overflow?How can we correct a corrupted signal?What kind of signals can be corrected?New moving average based unwrap
method.Conclusion.
Overflow
Overflow is a problem that can occur in Digital Signal Processing (DSP).
Overflow occurs when a value is represented in binary using an insufficient number of bits.
Systems are usually designed to avoid overflow, but this is not always possible.
OverflowThe value of ‘5’ using two’s compliment is 0101this requires 4 bits -- 1 ‘sign’ bit plus 3
‘value’ bits
If you try to represent a number using fewer bits, you may lose information and possibly change the sign bit.
0101 has a decimal value of 5
101 has a decimal value of -3!
OverflowExample:
9-bit Sine wave represented with 8 bits
Overflow Identification
For continuous signals, look for sharp jumps or discontinuities.
If the signal is noisy, you need to look at the distribution.◦The distribution will be limited to
values within the representable range
Overflow IdentificationExample:
Correcting Signals with Overflow
If continuous and noise-free, a simple ‘unwrap’ function can be used.
But how can we correct the signal if noise is present?◦A more sophisticated ‘unwrap’
function can be used.
AssumptionsThe signal must be slowly-
varying.The signal must be finely
sampled. The noise cannot exceed the
total bit-range.
◦Our simulations were done using fairly low-frequency sinusoids.
Signal Model
Signals are sinusoidal with added Gaussian noise.
Signal ModelIf the signal overflows, it has an
added ‘overflow factor.’
m – number of times the signal has overflown (positive or negative).
b – number of bits.
Moving Average Unwrap
If can be subtracted from the original signal can be restored.
The trick is finding m and n (i.e. how much correction and where?)
Correcting the signalRegions of overflow are identified using a
moving average estimator◦The difference between the moving average
and signal must be under the overflow detection threshold for some number of samples “c”
The value of the function before and after these regions are used to determine the correction factor needed ( -2b, 0, or 2b)
The areas of overflow are removed, and the correction terms added
Using moving averages to locate overflow regions
0-bit noise (no noise)
7-bit noise
8-bit noise
ConclusionsContinuous signals with added noise that suffer from overflow can be corrected for given:The sampling frequency is much
greater than frequencies that make up the signal
The noise is limited below the bin limits
Questions?