.Wavelet.Denoising.denois

Information

This function carries out the wavelet denoising calculation for a data. The wavelet filter bank must be available for calling this function. This has to be obtained by wavelet filter functions.

It has to be noted that the thresholds calculated by thSelect in this toolbox are valid only if the noise has normal (Gaussian) distribution with zero mean and standard deviation of one! Otherwise, the data have to be pre-conditioned or the thresholds have to be manually selected by the user.

The manual selection of the thresholds has the possibility that the thresholds for the levels can be different. The thresholds are given in the input parameter, th[:], each element of which is used for one level. If a threshold for a level is less than zero, the default threshold automatically calculated by thSelect will be used.

Interface

function denois
  input Real u[:] = {-1.3853, 1.5788, 2.2041, 3.9822, 3.3831, 6.7019, 5.1197, 5.9217, 4.2061, 3.5389, 3.4177, 2.1313, -0.7999, -2.4885, -3.2673, -4.6569, -4.0413, -5.1036, -5.3449, -6.2969, -3.7925, -3.4697, -3.0802, -0.8552, -1.5134, 1.0541, 2.2248, 3.3398, 3.1799, 4.8989, 4.4210, 4.0804, 3.4891, 5.1387, 2.3952, 1.9965, -0.2529, -0.6175, -4.8076, -3.8146, -5.1278, -5.4474, -5.0879, -5.3228, -2.8489, -4.8475, -3.7284, -4.0229, -1.7457, -1.3380} "Data to be denoised";
  input Integer decLevel = 2 "Wavelet decomposition levels";
  input Real lod[:] = {0.7071067811865476, 0.7071067811865476} "Wavelet low pass filter for decomposition";
  input Real hid[:] = {-0.7071067811865476, 0.7071067811865476} "Wavelet high pass filter for decomposition";
  input Real lor[:] = {0.7071067811865476, 0.7071067811865476} "Wavelet low pass filter for reconstruction";
  input Real hir[:] = {0.7071067811865476, -0.7071067811865476} "Wavelet high pass filter for reconstruction";
  input Real th[:] = {-1, -1} "Thresholds for all decomposition levels with th[1] for the first detail level (highest frequency components)";
  input Boolean sorh = true "Soft (false) or hard (true) thresholding for all decomposition levels";
  input Types.threshMethod thMethod = 1 "Method for automatic threshold calculation";
  output Real y[:] "Denoised data";
  output Real noise[:] "Noise removed from the data, = u-y";
  output Real c[:] "Wavelet coefficients before denoising";
  output Real cth[:] "Wavelet coefficients after denoising";
  output Integer len[:] "Length of wavelet coefficients of all levels";
end denois;

Generated at 2024-12-26T19:25:54Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos