I have a question regarding the output of performing a wavelet transform in MATLAB on an audio signal. I have an audio signal imported into MATLAB using the wavread
function. I then perform a one level wavelet transform on the signal using the wavdec
function (usually a haar or db4 transform). To transform the signal back to the original audio signal, I then perform an inverse wavelet transform on the signal using the function wavrec
. The output of this function brings me back to the original audio signal. However, many data points are slightly off from the original signal (only by about a magnitude of 10^-16 so it is very slight). However, in theory the inverse transform should give me the exact original signal. I am not sure if I am doing something wrong, but is there a reason that after performing a wavelet transform and then performing the inverse that I am not getting an output of exactly the original signal? Thank you very much for any help!
2
votes
this is a very good question! I have seen the same situation in MATLAB with images. The difference is so slight that I didnt look at explanation. I'll follow your post closer to see what the experienced guys say.
– Helder
1 Answers
4
votes
Numbers in a computer are not as perfect as theoretical numbers.
In order to store your data in a finite amount of memory, it's necessary to round it to the nearest representable value. This rounding is very small, but so is the "error" you're seeing.
Go look for the article "What every Computer Scientist should know about Floating-Point Arithmetic", or one of the summaries (The article is great but long, the summaries are shorter but vary in quality).