Error using ilwt Expected LEVEL to be a scalar with value <= 1.

4 visualizaciones (últimos 30 días)
Baydaa
Baydaa el 25 de En. de 2024
Editada: Walter Roberson el 20 de En. de 2025
[ca,cd] = lwt(x1,'LiftingScheme',lsc,'Level',2,'Int2Int',true);
...working on ca
x11 = ilwt(double(CA), cd, 'LiftingScheme',lsc,'Int2Int',true,'Level',2);
Error using ilwt
Expected LEVEL to be a scalar with value <= 1.
Error in ilwt>ilwtParser (line 339)
validateattributes(level, {'numeric'},...
Error in ilwt (line 82)
[LS,ext,level,~,isI2I] = ilwtParser(lvl,varargin{:});

Respuestas (1)

Umeshraja
Umeshraja el 19 de Sept. de 2024
It seems you're encountering an error while using the 'ilwt' function for the Inverse Lifting Wavelet Transform. The issue arises because the 'Level' argument in the 'ilwt’ function must be a non-negative integer less than or equal to length(cd) - 1 where ‘cd’ is the ‘Detail coefficients’. length of ‘cd’ is Lx1 where ‘L’ is the ‘Level’ mentioned in 'lwt' function.
Below is a demonstration of how to perform these arguments correctly
% Define the input data
x1 = 1:100;
% Create a lifting scheme using the 'db3' wavelet
lsc = liftingScheme('Wavelet', 'db3');
% Perform the Lifting Wavelet Transform on the data
% 'Level' is set to 5
[ca, cd] = lwt(x1, 'LiftingScheme', lsc, 'Level', 5, 'Int2Int', true);
% Display the length of the detail coefficients (cd)
disp(['Length of cd: ', num2str(length(cd))]);
Length of cd: 5
% Perform the Inverse Lifting Wavelet Transform (ILWT)
% 'Level' is set to 4, which must be <= length(cd) - 1
x11 = ilwt(double(ca), cd, 'LiftingScheme', lsc, 'Int2Int', true, 'Level', 4);
% Display the reconstructed data
disp('Reconstructed data using ILWT:');
Reconstructed data using ILWT:
disp(x11');
2 4 6 8 11 12 6
For more information on the ‘lwt’ and ‘ilwt’ functions, please refer to these MATLAB R2021b documentation links:
Hope it resolves your issue!
  1 comentario
Ludovico
Ludovico el 20 de En. de 2025
Hello, I apologize for the intrusion.
I am encountering the following issue: when I perform signal reconstruction in a non-integer scenario , i.e. with 'Int2Int' removed and set to true (I correctly configure the reconstruction coefficients such that the 'Level' is set to 4, which must be ≤ length(cd) − 1)), however, after the reconstruction, the resulting signal does not match the original. In particular, it appears “compressed,” as though it were scaled on the left by a factor less than 1. What could be causing this incorrect reconstruction?
Thanks in advance

Iniciar sesión para comentar.

Categorías

Más información sobre Lifting en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by