- lwt: https://www.mathworks.com/help/releases/R2021b/wavelet/ref/lwt.html
- ilwt: https://www.mathworks.com/help/releases/R2021b/wavelet/ref/ilwt.html
Error using ilwt Expected LEVEL to be a scalar with value <= 1.
3 次查看(过去 30 天)
显示 更早的评论
[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{:});
0 个评论
回答(1 个)
Umeshraja
2024-9-19
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))]);
% 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:');
disp(x11');
For more information on the ‘lwt’ and ‘ilwt’ functions, please refer to these MATLAB R2021b documentation links:
Hope it resolves your issue!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Lifting 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!