title: perfect reconstruction of wavelet transform using CWT
body: <p>If I perform a standard wavelet transform and then perform the inverse, I was expecting to get the original signal back:</p>
  <pre><code>% dummy series:
  Fs = 1e3;
  t = 0:1/Fs:1;
  x = exp(cos(2*pi*32*t).*(t&gt;=0.1 &amp; t&lt;0.3) + sin(2*pi*64*t).*(t&gt;0.7));
  
  % perform default transform and inverse
  wt=cwt(x)
  rx=icwt(wt)
  
  % plot
  plot(t,x,t,rx)
  </code></pre>
  <p>Apart from the offset, the flat period signals are distorted.<br />
  <a href="https://i.stack.imgur.com/Atc4l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Atc4l.png" alt="original series and reconstruction from cwt and icwt" /></a>
  It seems to be possible to perform a transform/inverse and have something close to the identity function, as here <a href="https://stackoverflow.com/questions/22131080/wavelet-reconstruction-of-time-series-r">Wavelet reconstruction of time series</a> , but reading the tutorials/help for <code>cwt</code> I do not see how to achieve this.</p>