Hi Sim,
I understand that you have queries regarding the "wavedec" and "cwt" functions from the "Wavelet toolbox" of MATLAB.
Yes, "wavedec" and "cwt" functions are related in the sense that they both use wavelets to decompose a signal into different scales or frequencies. However, they have some differences in how they discretize the scale parameter and how they represent the output.
- The "wavedec" function uses a "discrete wavelet transform (DWT)" that decomposes the signal into different frequency sub-bands or scales using a wavelet basis. The output of the "wavedec” function is a set of approximation coefficients (low-frequency components) and detail coefficients (high-frequency components) at different levels of decomposition. Sudden changes in the detail coefficients indicate the presence of sharp transitions or high-frequency components in the signal.
- The "cwt" function uses a "continuous wavelet transform (CWT)" that allows finer discretization of the scale parameter. It examines how a wavelet of varying scales matches a given signal at different positions and returns a matrix of wavelet coefficients as a function of scale and position that can be visualized as a scalogram. The rows of the output matrix represent different scales and the columns represent different time points. Large magnitude coefficients indicate the presence of significant changes at that scale and time point.
Both, the "wavedec" and "cwt" functions can be used to detect abrupt changes or discontinuities in signals. However, they have different characteristics and are suitable for different scenarios.
The "wavedec" function is more suitable for analysing signals with discrete changes or localized abrupt transitions. It provides a multi-resolution decomposition that allows you to analyse the signal at different scales and identify abrupt changes in the detail coefficients. The "cwt" function is more suitable for analysing signals with continuous changes or gradual transitions. It provides a continuous representation of the signal at different scales and time points, allowing you to identify abrupt changes based on the magnitude of the wavelet coefficients.
Please refer to the below mentioned MATLAB documentation links to understand more on "Continuous and discrete wavelet transform", "wavedec" function and "cwt" function respectively:
I hope this helps to resolve the query.
Thanks,
Abhimenyu