wavelet-based filter

3 views (last 30 days)
Faraxen
Faraxen on 16 Feb 2022
Answered: Vinay on 7 Oct 2024
I want to create a wavelet-based filter for PQ _APF theory, but each time I increase the level of the decomposition there is this message that appears
"Dimensions of matrices being concatenated are not consistent."
function CA1 = DWT_PQTheo(P)
C = 0;
L = 0;
cA = 0;
cD = 0;
m = 0;
% P1=P(2400:10000-1);
[C, L] = wavedec(P, 12, 'db8');
cA = appcoef(C, L, 'db8', 12);
CA1=zeros(length(P),1);
m=0;
for k=1:length(CA1)
m=m+1;
CA1(k)=cA(m);
end
end

Answers (1)

Vinay
Vinay on 7 Oct 2024
The issue arises because the 'cA' matrix, which contains the approximate coefficients, has incorrect dimensions compared to the 'CA1' matrix, which matches the length of the original signal. To fix this issue, adjust the size of 'CA1' to match that of 'cA'.
Kindly refer to the below documentation of wavedec for more details:
I hope this helps!

Categories

Find more on Filter Banks in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!