Signal go down in low pass filter
1 view (last 30 days)
Show older comments
I am designing a filter to implement in a microcontroller and testing the filter in Matlab. Filter transfer function is this: .
the differance equation is : .
I designed the filter like this
load('118e12m.mat');
figure(1);
plot(val);
%%
y1 = zeros(1,size(val,2));
for i = 13 : size(val,2)
y1(i) = 2*y1(i-1) - y1(i-2) + val(i) - 2*val(i-6) + val(i-12);
end
figure(2)
plot(y1)
My inpput signal looks like this:
My output is look like this:
I want to know is there a way to avoid this signal going down
0 Comments
Answers (1)
Image Analyst
on 16 Oct 2020
Unfortunately you delayed a solution because you bloew by the posting guidelines and forgot to attach '118e12m.mat'.
However, you can still read them here and then after that probably someone will answer.
TUTORIAL: how to ask a question (on Answers) and get a fast answer - MATLAB Answers - MATLAB Central
It's probably because you're doing your filtering recursively, using the new prior y instead of the original prior y. Try calling your output array y2 instead of y1.
See Also
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!