FIR Filter 10th Order with for loop
Show older comments
i'm trying to filter a signal with a 10th order differential equation and for loop, with the following code, but i'm keep getting this error
" unable to perform assignment because the indices on th left side are not compatible with the size of the right side"
N=10; % Order of Filter
FG=1;
Wn=FG/(F/2); %Nyquist
a=fir1(N,Wn);
mfilter = zeros(size(LHorizontal));
for k=1:length(LHorizontal)
z = [LHorizontal(k); k(1:N)];
LHorizontal(k) = a * z;
end
a is a 1x11 matrix
LHorizontal is a 6000x1 matrix
for some reason k comes out as "1", i don't know what is causing it (k) to come out as 1 and i believe that is what is causing the above stated error message.
I would be grateful for any Help in locating and fixing the code
Accepted Answer
More Answers (0)
Categories
Find more on Digital Filter Analysis 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!