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

[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{:});

답변 (1개)

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

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

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Lifting에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2024년 1월 25일

편집:

2025년 1월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by